2009-06-06 11:14:11 +00:00
|
|
|
[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 ();
|
|
|
|
|
2009-08-05 14:57:20 +00:00
|
|
|
Gst.GLib.Value ret = (Gst.GLib.Value) Marshal.PtrToStructure (raw_ret, typeof (Gst.GLib.Value));
|
2009-06-06 11:14:11 +00:00
|
|
|
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);
|
|
|
|
}
|
2009-09-22 07:37:55 +00:00
|
|
|
|
|
|
|
[DllImport ("gstreamersharpglue-0.10.dll") ]
|
|
|
|
static extern IntPtr gstsharp_gst_videoutil_get_template_caps (Gst.Video.VideoFormat fmt);
|
|
|
|
|
|
|
|
public static Gst.Caps FormatToTemplateCaps (Gst.Video.VideoFormat fmt) {
|
|
|
|
IntPtr raw_ret = gstsharp_gst_videoutil_get_template_caps (fmt);
|
|
|
|
if (raw_ret == IntPtr.Zero)
|
|
|
|
return null;
|
|
|
|
|
|
|
|
return (Gst.Caps) Gst.GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Caps), true);
|
|
|
|
}
|