mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-04 15:36:35 +00:00
aa7bb8fa1c
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.
28 lines
1 KiB
Text
28 lines
1 KiB
Text
[DllImport ("gstreamersharpglue-0.10.dll") ]
|
|
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);
|
|
Gst.GLib.Value v = (Gst.GLib.Value) Marshal.PtrToStructure (raw_ptr, typeof (Gst.GLib.Value));
|
|
return (Gst.Fraction) v.Val;
|
|
}
|
|
}
|
|
}
|
|
|
|
[DllImport("libgstreamer-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 = Gst.GLib.Marshaller.StringToPtrGStrdup (label);
|
|
|
|
}
|
|
unsafe {
|
|
IntPtr raw_ptr = (IntPtr) ( ( (byte*) Handle) + framerate_offset);
|
|
gst_value_set_fraction (raw_ptr, framerate.Numerator, framerate.Denominator);
|
|
}
|
|
}
|