gstreamer/gstreamer-sharp/VideoUtil.custom
Sebastian Dröge aa7bb8fa1c Use internal glib-sharp copy everywhere and make it work side-by-side with real glib-sharp
glib-sharp will only get a new release with the new API that we need for
3.0 in a year or something. Instead of waiting a year before we can release
something we now have our own internal copy of glib-sharp trunk that will
be dropped once glib-sharp 3.0 is released.

Everything is now compilable and working without any additional patches.
2009-08-05 16:57:20 +02:00

24 lines
837 B
Text

[DllImport ("libgstvideo-0.10.dll") ]
static extern IntPtr gst_video_frame_rate (IntPtr pad);
public static Gst.Fraction GetFrameRate (Gst.Pad pad) {
IntPtr raw_ret = gst_video_frame_rate (pad == null ? IntPtr.Zero : pad.Handle);
if (raw_ret == IntPtr.Zero)
return new Gst.Fraction ();
Gst.GLib.Value ret = (Gst.GLib.Value) Marshal.PtrToStructure (raw_ret, typeof (Gst.GLib.Value));
return (Gst.Fraction) ret.Val;
}
[DllImport ("libgstvideo-0.10.dll") ]
static extern uint gst_video_format_to_fourcc (int format);
public static Gst.Fourcc FormatToFourcc (Gst.Video.VideoFormat format) {
uint raw_ret = gst_video_format_to_fourcc ( (int) format);
uint ret = raw_ret;
return new Gst.Fourcc (ret);
}
public static Gst.Video.VideoFormat FormatFromFourcc (Gst.Fourcc fourcc) {
return FormatFromFourcc (fourcc.Val);
}