mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +00:00
cf9fd6ec9a
Also fix indention everywhere and change code to use Gst.MiniObject.GetObject() instead of GLib.Opaque.GetOpaque(). It's currently not possible to implement or use GInterfaces on mini objects but apart from that this should be a great improvement, especially new mini object classes can be defined in C# now.
28 lines
1,002 B
Text
28 lines
1,002 B
Text
[DllImport ("gstreamersharpglue-0.10") ]
|
|
extern static uint gst__interfacessharp_gst__interfaces_tunernorm_get_framerate_offset ();
|
|
|
|
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);
|
|
GLib.Value v = (GLib.Value) Marshal.PtrToStructure (raw_ptr, typeof (GLib.Value));
|
|
return (Gst.Fraction) v.Val;
|
|
}
|
|
}
|
|
}
|
|
|
|
[DllImport ("gstreamer-0.10.dll") ]
|
|
private static extern void gst_value_set_fraction (IntPtr v, int numerator, int denominator);
|
|
|
|
public TunerNorm (string label, Gst.Fraction framerate) {
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + label_offset);
|
|
*raw_ptr = GLib.Marshaller.StringToPtrGStrdup (label);
|
|
|
|
}
|
|
unsafe {
|
|
IntPtr raw_ptr = (IntPtr) ( ( (byte*) Handle) + framerate_offset);
|
|
gst_value_set_fraction (raw_ptr, framerate.Numerator, framerate.Denominator);
|
|
}
|
|
}
|