Add Gst.Interfaces.Tuner* bindings

This commit is contained in:
Sebastian Dröge 2009-05-12 12:04:53 +02:00
parent 801680234f
commit 75c1fe23d1
6 changed files with 93 additions and 3 deletions

View file

@ -1023,7 +1023,27 @@
<attr path="/api/namespace/interface[@cname='GstNavigation']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GstPropertyProbe']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GstTuner']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GstTuner']" name="name">Tuner</attr>
<remove-node path="/api/namespace/interface[@cname='GstTuner']/method[@cname='gst_tuner_norm_changed']/parameters/parameter[@name='tuner']" />
<remove-attr path="/api/namespace/interface[@cname='GstTuner']/method[@cname='gst_tuner_norm_changed']" name="shared" />
<remove-node path="/api/namespace/interface[@cname='GstTuner']/method[@cname='gst_tuner_channel_changed']/parameters/parameter[@name='tuner']" />
<remove-attr path="/api/namespace/interface[@cname='GstTuner']/method[@cname='gst_tuner_channel_changed']" name="shared" />
<attr path="/api/namespace/interface[@cname='GstTuner']/virtual_method[@cname='list_channels']/return-type" name="element_type">GstTunerChannel</attr>
<attr path="/api/namespace/interface[@cname='GstTuner']/virtual_method[@cname='list_norms']/return-type" name="element_type">GstTunerChannel</attr>
<attr path="/api/namespace/interface[@cname='GstTuner']/method[@cname='gst_tuner_list_channels']/return-type" name="element_type">GstTunerChannel</attr>
<attr path="/api/namespace/interface[@cname='GstTuner']/method[@cname='gst_tuner_list_norms']/return-type" name="element_type">GstTunerChannel</attr>
<attr path="/api/namespace/interface[@cname='GstTuner']/method[@cname='gst_tuner_channel_changed']" name="name">EmitChannelChanged</attr>
<attr path="/api/namespace/interface[@cname='GstTuner']/method[@cname='gst_tuner_norm_changed']" name="name">EmitNormChanged</attr>
<attr path="/api/namespace/interface[@cname='GstTuner']/method[@cname='gst_tuner_frequency_changed']" name="name">EmitFrequencyChanged</attr>
<attr path="/api/namespace/interface[@cname='GstTuner']/method[@cname='gst_tuner_signal_changed']" name="name">EmitSignalChanged</attr>
<attr path="/api/namespace/object[@cname='GstTunerChannel']" name="name">TunerChannel</attr>
<move-node path="/api/namespace/object[@cname='GstTunerChannel']/method[@cname='gst_tuner_channel_changed']">/api/namespace/interface[@cname='GstTuner']</move-node>
<attr path="/api/namespace/object[@cname='GstTunerNorm']" name="name">TunerNorm</attr>
<attr path="/api/namespace/object[@cname='GstTunerNorm']/field[@name='Framerate']" name="hidden">1</attr>
<move-node path="/api/namespace/object[@cname='GstTunerNorm']/method[@cname='gst_tuner_norm_changed']">/api/namespace/interface[@cname='GstTuner']</move-node>
<attr path="/api/namespace/interface[@cname='GstVideoOrientation']" name="name">VideoOrientation</attr>
<attr path="/api/namespace/interface[@cname='GstVideoOrientation']/virtual_method[@cname='get_hflip']/parameters/parameter[@name='flip']" name="pass_as">out</attr>

View file

@ -91,7 +91,9 @@ customs = \
TagList.custom \
TypeFind.custom \
TypeFindFactory.custom \
MixerTrack.custom
MixerTrack.custom \
TunerNorm.custom \
TunerChannel.custom
build_customs = $(addprefix $(srcdir)/, $(customs))

View file

@ -0,0 +1,31 @@
public TunerChannel (string label, TunerChannelFlags flags, float freq_multiplicator, ulong min_frequency, ulong max_frequency, int min_signal, int max_signal) {
unsafe {
IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + label_offset);
*raw_ptr = GLib.Marshaller.StringToPtrGStrdup (label);
}
unsafe {
int* raw_ptr = (int*) ( ( (byte*) Handle) + flags_offset);
*raw_ptr = (int) flags;
}
unsafe {
float* raw_ptr = (float*) ( ( (byte*) Handle) + freq_multiplicator_offset);
*raw_ptr = freq_multiplicator;
}
unsafe {
UIntPtr* raw_ptr = (UIntPtr*) ( ( (byte*) Handle) + min_frequency_offset);
*raw_ptr = (UIntPtr) min_frequency;
}
unsafe {
UIntPtr* raw_ptr = (UIntPtr*) ( ( (byte*) Handle) + max_frequency_offset);
*raw_ptr = (UIntPtr) max_frequency;
}
unsafe {
int* raw_ptr = (int*) ( ( (byte*) Handle) + min_signal_offset);
*raw_ptr = min_signal;
}
unsafe {
int* raw_ptr = (int*) ( ( (byte*) Handle) + max_signal_offset);
*raw_ptr = max_signal;
}
}

View file

@ -0,0 +1,28 @@
[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);
}
}

View file

@ -16,7 +16,8 @@ libgstreamersharpglue_0_10_la_SOURCES = \
typefind.c \
indexentry.c \
indexfactory.c \
mixertrack.c
mixertrack.c \
tunernorm.c
nodist_libgstreamersharpglue_0_10_la_SOURCES = generated.c

View file

@ -0,0 +1,8 @@
#include <gst/interfaces/tunernorm.h>
guint
gst__interfacessharp_gst__interfaces_tunernorm_get_framerate_offset (void)
{
return (guint)G_STRUCT_OFFSET (GstTunerNorm, framerate);
}