2009-05-25 10:09:52 +00:00
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
2009-04-16 19:52:47 +00:00
|
|
|
static extern IntPtr gst_pad_template_new (IntPtr name_template, int direction, int presence, IntPtr caps);
|
2009-04-15 12:40:09 +00:00
|
|
|
|
2009-05-25 10:09:52 +00:00
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
2009-04-16 19:52:47 +00:00
|
|
|
static extern IntPtr gst_caps_ref (IntPtr handle);
|
2009-04-15 12:40:09 +00:00
|
|
|
|
2009-04-16 19:52:47 +00:00
|
|
|
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");
|
2009-08-05 14:57:20 +00:00
|
|
|
vals.Add (new Gst.GLib.Value (name_template));
|
2009-04-16 19:52:47 +00:00
|
|
|
names.Add ("direction");
|
2009-08-05 14:57:20 +00:00
|
|
|
vals.Add (new Gst.GLib.Value (direction));
|
2009-04-16 19:52:47 +00:00
|
|
|
names.Add ("presence");
|
2009-08-05 14:57:20 +00:00
|
|
|
vals.Add (new Gst.GLib.Value (presence));
|
2009-04-16 19:52:47 +00:00
|
|
|
if (caps != null) {
|
|
|
|
names.Add ("caps");
|
2009-08-05 14:57:20 +00:00
|
|
|
vals.Add (new Gst.GLib.Value (caps));
|
2009-04-16 19:52:47 +00:00
|
|
|
}
|
2009-08-05 14:57:20 +00:00
|
|
|
CreateNativeObject ( (string[]) names.ToArray (typeof (string)), (Gst.GLib.Value[]) vals.ToArray (typeof (Gst.GLib.Value)));
|
2009-04-16 19:52:47 +00:00
|
|
|
return;
|
|
|
|
}
|
2009-08-05 14:57:20 +00:00
|
|
|
IntPtr native_name_template = Gst.GLib.Marshaller.StringToPtrGStrdup (name_template);
|
2009-04-16 19:52:47 +00:00
|
|
|
if (caps != null)
|
|
|
|
gst_caps_ref (caps.Handle);
|
2009-04-15 12:40:09 +00:00
|
|
|
|
2009-04-16 19:52:47 +00:00
|
|
|
Raw = gst_pad_template_new (native_name_template, (int) direction, (int) presence, caps == null ? IntPtr.Zero : caps.Handle);
|
2009-08-05 14:57:20 +00:00
|
|
|
Gst.GLib.Marshaller.Free (native_name_template);
|
2009-04-16 19:52:47 +00:00
|
|
|
}
|
2009-04-15 12:40:09 +00:00
|
|
|
|