gstreamer/gstreamer-sharp/PadTemplate.custom
Sebastian Dröge aa7bb8fa1c Use internal glib-sharp copy everywhere and make it work side-by-side with real glib-sharp
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.
2009-08-05 16:57:20 +02:00

31 lines
1.3 KiB
Text

[DllImport("libgstreamer-0.10.dll") ]
static extern IntPtr gst_pad_template_new (IntPtr name_template, int direction, int presence, IntPtr caps);
[DllImport("libgstreamer-0.10.dll") ]
static extern IntPtr gst_caps_ref (IntPtr handle);
public PadTemplate (string name_template, Gst.PadDirection direction, Gst.PadPresence presence, Gst.Caps caps) : base (IntPtr.Zero) {
if (GetType () != typeof (PadTemplate)) {
ArrayList vals = new ArrayList();
ArrayList names = new ArrayList();
names.Add ("name_template");
vals.Add (new Gst.GLib.Value (name_template));
names.Add ("direction");
vals.Add (new Gst.GLib.Value (direction));
names.Add ("presence");
vals.Add (new Gst.GLib.Value (presence));
if (caps != null) {
names.Add ("caps");
vals.Add (new Gst.GLib.Value (caps));
}
CreateNativeObject ( (string[]) names.ToArray (typeof (string)), (Gst.GLib.Value[]) vals.ToArray (typeof (Gst.GLib.Value)));
return;
}
IntPtr native_name_template = Gst.GLib.Marshaller.StringToPtrGStrdup (name_template);
if (caps != null)
gst_caps_ref (caps.Handle);
Raw = gst_pad_template_new (native_name_template, (int) direction, (int) presence, caps == null ? IntPtr.Zero : caps.Handle);
Gst.GLib.Marshaller.Free (native_name_template);
}