gstreamer/gstreamer-sharp/TunerNorm.custom

29 lines
1 KiB
Text
Raw Normal View History

[DllImport ("gstreamersharpglue-0.10.dll") ]
extern static uint gst__interfacessharp_gst__interfaces_tunernorm_get_framerate_offset ();
2009-05-12 10:04:53 +00:00
static uint framerate_offset = gst__interfacessharp_gst__interfaces_tunernorm_get_framerate_offset ();
public Gst.Fraction Framerate {
get {
unsafe {
IntPtr raw_ptr = (IntPtr) ( ( (byte*) Handle) + framerate_offset);
Gst.GLib.Value v = (Gst.GLib.Value) Marshal.PtrToStructure (raw_ptr, typeof (Gst.GLib.Value));
return (Gst.Fraction) v.Val;
}
}
}
2009-05-12 10:04:53 +00:00
2009-09-20 08:19:49 +00:00
[DllImport ("libgstreamer-0.10.dll") ]
private static extern void gst_value_set_fraction (IntPtr v, int numerator, int denominator);
2009-05-12 10:04:53 +00:00
public TunerNorm (string label, Gst.Fraction framerate) {
unsafe {
IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + label_offset);
*raw_ptr = Gst.GLib.Marshaller.StringToPtrGStrdup (label);
2009-05-12 10:04:53 +00:00
}
unsafe {
IntPtr raw_ptr = (IntPtr) ( ( (byte*) Handle) + framerate_offset);
gst_value_set_fraction (raw_ptr, framerate.Numerator, framerate.Denominator);
}
}