[DllImport("libgstreamer-0.10.dll") ] static extern IntPtr gst_pad_get_pad_template_caps (IntPtr raw); [DllImport("libgstreamer-0.10.dll") ] static extern IntPtr gst_caps_copy (IntPtr raw); public Gst.Caps PadTemplateCaps { get { IntPtr raw_ret = gst_pad_get_pad_template_caps (Handle); Gst.Caps ret = raw_ret == IntPtr.Zero ? null : (Gst.Caps) Gst.GLib.Opaque.GetOpaque (gst_caps_copy (raw_ret), typeof (Gst.Caps), false); return ret; } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_remove_data_probe (IntPtr raw, uint handler_id); public void RemoveDataProbe (ulong handler_id) { gst_pad_remove_data_probe (Handle, (uint) handler_id); } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_remove_event_probe (IntPtr raw, uint handler_id); public void RemoveEventProbe (ulong handler_id) { gst_pad_remove_event_probe (Handle, (uint) handler_id); } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_remove_buffer_probe (IntPtr raw, uint handler_id); public void RemoveBufferProbe (ulong handler_id) { gst_pad_remove_buffer_probe (Handle, (uint) handler_id); } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_bufferalloc_function (IntPtr raw, GstSharp.PadBufferAllocFunctionNative bufalloc); public Gst.PadBufferAllocFunction BufferAllocFunction { set { if (PersistentData["BufferAllocFunction"] != null) PersistentData["BufferAllocFunction"] = null; GstSharp.PadBufferAllocFunctionWrapper value_wrapper = new GstSharp.PadBufferAllocFunctionWrapper (value); PersistentData["BufferAllocFunction"] = value_wrapper; gst_pad_set_bufferalloc_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_chain_function (IntPtr raw, GstSharp.PadChainFunctionNative chain); public Gst.PadChainFunction ChainFunction { set { if (PersistentData["ChainFunction"] != null) PersistentData["ChainFunction"] = null; GstSharp.PadChainFunctionWrapper value_wrapper = new GstSharp.PadChainFunctionWrapper (value); PersistentData["ChainFunction"] = value_wrapper; gst_pad_set_chain_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_chain_list_function (IntPtr raw, GstSharp.PadChainListFunctionNative chain); public Gst.PadChainListFunction ChainListFunction { set { if (PersistentData["ChainListFunction"] != null) PersistentData["ChainListFunction"] = null; GstSharp.PadChainListFunctionWrapper value_wrapper = new GstSharp.PadChainListFunctionWrapper (value); PersistentData["ChainListFunction"] = value_wrapper; gst_pad_set_chain_list_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_checkgetrange_function (IntPtr raw, GstSharp.PadCheckGetRangeFunctionNative check); public Gst.PadCheckGetRangeFunction CheckGetRangeFunction { set { if (PersistentData["CheckGetRangeFunction"] != null) PersistentData["CheckGetRangeFunction"] = null; GstSharp.PadCheckGetRangeFunctionWrapper value_wrapper = new GstSharp.PadCheckGetRangeFunctionWrapper (value); PersistentData["CheckGetRangeFunction"] = value_wrapper; gst_pad_set_checkgetrange_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_getrange_function (IntPtr raw, GstSharp.PadGetRangeFunctionNative get); public Gst.PadGetRangeFunction GetRangeFunction { set { if (PersistentData["GetRangeFunction"] != null) PersistentData["GetRangeFunction"] = null; GstSharp.PadGetRangeFunctionWrapper value_wrapper = new GstSharp.PadGetRangeFunctionWrapper (value); PersistentData["GetRangeFunction"] = value_wrapper; gst_pad_set_getrange_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_event_function (IntPtr raw, GstSharp.PadEventFunctionNative evnt); public Gst.PadEventFunction EventFunction { set { if (PersistentData["EventFunction"] != null) PersistentData["EventFunction"] = null; GstSharp.PadEventFunctionWrapper value_wrapper = new GstSharp.PadEventFunctionWrapper (value); PersistentData["EventFunction"] = value_wrapper; gst_pad_set_event_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_link_function (IntPtr raw, GstSharp.PadLinkFunctionNative link); public Gst.PadLinkFunction LinkFunction { set { if (PersistentData["LinkFunction"] != null) PersistentData["LinkFunction"] = null; GstSharp.PadLinkFunctionWrapper value_wrapper = new GstSharp.PadLinkFunctionWrapper (value); PersistentData["LinkFunction"] = value_wrapper; gst_pad_set_link_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_unlink_function (IntPtr raw, GstSharp.PadUnlinkFunctionNative unlink); public Gst.PadUnlinkFunction UnlinkFunction { set { if (PersistentData["UnlinkFunction"] != null) PersistentData["UnlinkFunction"] = null; GstSharp.PadUnlinkFunctionWrapper value_wrapper = new GstSharp.PadUnlinkFunctionWrapper (value); PersistentData["UnlinkFunction"] = value_wrapper; gst_pad_set_unlink_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_acceptcaps_function (IntPtr raw, GstSharp.PadAcceptCapsFunctionNative acceptcaps); public Gst.PadAcceptCapsFunction AcceptCapsFunction { set { if (PersistentData["AcceptCapsFunction"] != null) PersistentData["AcceptCapsFunction"] = null; GstSharp.PadAcceptCapsFunctionWrapper value_wrapper = new GstSharp.PadAcceptCapsFunctionWrapper (value); PersistentData["AcceptCapsFunction"] = value_wrapper; gst_pad_set_acceptcaps_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_getcaps_function (IntPtr raw, GstSharp.PadGetCapsFunctionNative getcaps); public Gst.PadGetCapsFunction GetCapsFunction { set { if (PersistentData["GetCapsFunction"] != null) PersistentData["GetCapsFunction"] = null; GstSharp.PadGetCapsFunctionWrapper value_wrapper = new GstSharp.PadGetCapsFunctionWrapper (value); PersistentData["GetCapsFunction"] = value_wrapper; gst_pad_set_getcaps_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_setcaps_function (IntPtr raw, GstSharp.PadSetCapsFunctionNative setcaps); public Gst.PadSetCapsFunction SetCapsFunction { set { if (PersistentData["SetCapsFunction"] != null) PersistentData["SetCapsFunction"] = null; GstSharp.PadSetCapsFunctionWrapper value_wrapper = new GstSharp.PadSetCapsFunctionWrapper (value); PersistentData["SetCapsFunction"] = value_wrapper; gst_pad_set_setcaps_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_fixatecaps_function (IntPtr raw, GstSharp.PadFixateCapsFunctionNative fixatecaps); public Gst.PadFixateCapsFunction FixateCapsFunction { set { if (PersistentData["FixateCapsFunction"] != null) PersistentData["FixateCapsFunction"] = null; GstSharp.PadFixateCapsFunctionWrapper value_wrapper = new GstSharp.PadFixateCapsFunctionWrapper (value); PersistentData["FixateCapsFunction"] = value_wrapper; gst_pad_set_fixatecaps_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_activate_function (IntPtr raw, GstSharp.PadActivateFunctionNative activate); public Gst.PadActivateFunction ActivateFunction { set { if (PersistentData["ActivateFunction"] != null) PersistentData["ActivateFunction"] = null; GstSharp.PadActivateFunctionWrapper value_wrapper = new GstSharp.PadActivateFunctionWrapper (value); PersistentData["ActivateFunction"] = value_wrapper; gst_pad_set_activate_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_activatepull_function (IntPtr raw, GstSharp.PadActivateModeFunctionNative activatepull); public Gst.PadActivateModeFunction ActivatePullFunction { set { if (PersistentData["ActivatePullFunction"] != null) PersistentData["ActivatePullFunction"] = null; GstSharp.PadActivateModeFunctionWrapper value_wrapper = new GstSharp.PadActivateModeFunctionWrapper (value); PersistentData["ActivatePullFunction"] = value_wrapper; gst_pad_set_activatepull_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_activatepush_function (IntPtr raw, GstSharp.PadActivateModeFunctionNative activatepush); public Gst.PadActivateModeFunction ActivatePushFunction { set { if (PersistentData["ActivatePushFunction"] != null) PersistentData["ActivatePushFunction"] = null; GstSharp.PadActivateModeFunctionWrapper value_wrapper = new GstSharp.PadActivateModeFunctionWrapper (value); PersistentData["ActivatePushFunction"] = value_wrapper; gst_pad_set_activatepush_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern int gst_pad_pull_range (IntPtr raw, ulong offset, uint size, out IntPtr buffer); public Gst.FlowReturn PullRange (ulong offset, uint size, out Gst.Buffer buffer) { IntPtr native_buffer; int raw_ret = gst_pad_pull_range (Handle, offset, size, out native_buffer); Gst.FlowReturn ret = (Gst.FlowReturn) raw_ret; buffer = native_buffer == IntPtr.Zero ? null : (Gst.Buffer) Gst.MiniObject.GetObject (native_buffer, true); return ret; } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_query_function (IntPtr raw, GstSharp.PadQueryFunctionNative query); public Gst.PadQueryFunction QueryFunction { set { if (PersistentData["QueryFunction"] != null) PersistentData["QueryFunction"] = null; GstSharp.PadQueryFunctionWrapper value_wrapper = new GstSharp.PadQueryFunctionWrapper (value); PersistentData["QueryFunction"] = value_wrapper; gst_pad_set_query_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern void gst_pad_set_query_type_function (IntPtr raw, GstSharp.PadQueryTypeFunctionNative query); public Gst.PadQueryTypeFunction QueryTypeFunction { set { if (PersistentData["QueryTypeFunction"] != null) PersistentData["QueryTypeFunction"] = null; GstSharp.PadQueryTypeFunctionWrapper value_wrapper = new GstSharp.PadQueryTypeFunctionWrapper (value); PersistentData["QueryTypeFunction"] = value_wrapper; gst_pad_set_query_type_function (Handle, value_wrapper.NativeDelegate); } } [DllImport("libgstreamer-0.10.dll") ] static extern IntPtr gst_pad_get_query_types (IntPtr raw); public Gst.QueryType[] QueryTypes { get { IntPtr raw_ret = gst_pad_get_query_types (Handle); if (raw_ret == IntPtr.Zero) return new Gst.QueryType[] {}; ArrayList result = new ArrayList (); bool term = false; int ofs = 0; while (!term) { Gst.QueryType t = (Gst.QueryType) Marshal.ReadInt32 (raw_ret, ofs); if (t == Gst.QueryType.None) { term = true; } else { result.Add (t); ofs += 4; } } return (Gst.QueryType[]) result.ToArray (typeof (Gst.QueryType)); } } [DllImport("libgstreamer-0.10.dll") ] static extern IntPtr gst_pad_get_query_types_default (IntPtr raw); static Gst.QueryType[] GetQueryTypesDefault (Gst.Pad pad) { IntPtr raw_ret = gst_pad_get_query_types_default ( (pad != null) ? pad.Handle : IntPtr.Zero); if (raw_ret == IntPtr.Zero) return new Gst.QueryType[] {}; ArrayList result = new ArrayList (); bool term = false; int ofs = 0; while (!term) { Gst.QueryType t = (Gst.QueryType) Marshal.ReadInt32 (raw_ret, ofs); if (t == Gst.QueryType.None) { term = true; } else { result.Add (t); ofs += 4; } } return (Gst.QueryType[]) result.ToArray (typeof (Gst.QueryType)); } [DllImport ("gstreamersharpglue-0.10.dll") ] extern static uint gstsharp_gst_pad_get_stream_lock_offset (); static uint stream_lock_offset = gstsharp_gst_pad_get_stream_lock_offset (); private IntPtr StreamLockPtr { get { unsafe { IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + stream_lock_offset); return (*raw_ptr); } } } [DllImport ("libglib-2.0-0.dll") ] static extern void g_static_rec_mutex_lock (IntPtr mutex); [DllImport ("libglib-2.0-0.dll") ] static extern void g_static_rec_mutex_unlock (IntPtr mutex); [DllImport ("libglib-2.0-0.dll") ] static extern void g_static_rec_mutex_lock_full (IntPtr mutex, uint depth); [DllImport ("libglib-2.0-0.dll") ] static extern void g_static_rec_mutex_unlock_full (IntPtr mutex, uint depth); [DllImport ("libglib-2.0-0.dll") ] static extern bool g_static_rec_mutex_trylock (IntPtr mutex); public void StreamLock () { g_static_rec_mutex_lock (StreamLockPtr); } public void StreamUnlock () { g_static_rec_mutex_unlock (StreamLockPtr); } public void StreamLock (uint depth) { g_static_rec_mutex_lock_full (StreamLockPtr, depth); } public void StreamUnlock (uint depth) { g_static_rec_mutex_unlock_full (StreamLockPtr, depth); } public bool StreamTryLock () { return g_static_rec_mutex_trylock (StreamLockPtr); }