2009-06-12 13:21:28 +00:00
|
|
|
[DllImport ("libgstreamer-0.10.dll") ]
|
|
|
|
static extern IntPtr gst_element_factory_make (IntPtr element, IntPtr name);
|
|
|
|
|
|
|
|
public AppSrc (string name) : base (IntPtr.Zero) {
|
|
|
|
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
|
|
|
IntPtr native_element = GLib.Marshaller.StringToPtrGStrdup ("appsrc");
|
|
|
|
Raw = gst_element_factory_make (native_element, native_name);
|
|
|
|
GLib.Marshaller.Free (native_name);
|
|
|
|
GLib.Marshaller.Free (native_element);
|
|
|
|
if (Raw == IntPtr.Zero)
|
|
|
|
throw new Exception ("Failed to instantiate element \"appsrc\"");
|
|
|
|
}
|
|
|
|
|
|
|
|
public AppSrc () : this ( (string) null) { }
|
|
|
|
|
|
|
|
[DllImport ("libgstapp-0.10.dll") ]
|
|
|
|
static extern int gst_app_src_push_buffer (IntPtr raw, IntPtr buffer);
|
|
|
|
|
|
|
|
public Gst.FlowReturn PushBuffer (Gst.Buffer buffer) {
|
|
|
|
int raw_ret = gst_app_src_push_buffer (Handle, buffer == null ? IntPtr.Zero : buffer.OwnedHandle);
|
|
|
|
Gst.FlowReturn ret = (Gst.FlowReturn) raw_ret;
|
|
|
|
return ret;
|
|
|
|
}
|