예제 #1
0
        public Gst.FlowReturn AcquireBuffer(out Gst.Buffer buffer, Gst.BufferPoolAcquireParams parms)
        {
            IntPtr native_buffer;
            IntPtr native_parms = GLib.Marshaller.StructureToPtrAlloc(parms);
            int    raw_ret      = gst_buffer_pool_acquire_buffer(Handle, out native_buffer, native_parms);

            Gst.FlowReturn ret = (Gst.FlowReturn)raw_ret;
            buffer = native_buffer == IntPtr.Zero ? null : (Gst.Buffer)GLib.Opaque.GetOpaque(native_buffer, typeof(Gst.Buffer), true);
            Marshal.FreeHGlobal(native_parms);
            return(ret);
        }
예제 #2
0
        private Gst.FlowReturn InternalAllocBuffer(Gst.Buffer buffer, Gst.BufferPoolAcquireParams parms)
        {
            AllocBufferNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("alloc_buffer"));
                unmanaged = (AllocBufferNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AllocBufferNativeDelegate));
            }
            if (unmanaged == null)
            {
                return((Gst.FlowReturn) 0);
            }

            IntPtr native_parms = GLib.Marshaller.StructureToPtrAlloc(parms);
            int    __result     = unmanaged(this.Handle, buffer == null ? IntPtr.Zero : buffer.Handle, native_parms);

            Marshal.FreeHGlobal(native_parms);
            return((Gst.FlowReturn)__result);
        }
예제 #3
0
        private Gst.FlowReturn InternalAcquireBuffer(out Gst.Buffer buffer, Gst.BufferPoolAcquireParams parms)
        {
            AcquireBufferNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("acquire_buffer"));
                unmanaged = (AcquireBufferNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AcquireBufferNativeDelegate));
            }
            if (unmanaged == null)
            {
                throw new InvalidOperationException("No base method to invoke");
            }

            IntPtr native_buffer;
            IntPtr native_parms = GLib.Marshaller.StructureToPtrAlloc(parms);
            int    __result     = unmanaged(this.Handle, out native_buffer, native_parms);

            buffer = native_buffer == IntPtr.Zero ? null : (Gst.Buffer)GLib.Opaque.GetOpaque(native_buffer, typeof(Gst.Buffer), true);
            Marshal.FreeHGlobal(native_parms);
            return((Gst.FlowReturn)__result);
        }
예제 #4
0
 protected virtual Gst.FlowReturn OnAllocBuffer(Gst.Buffer buffer, Gst.BufferPoolAcquireParams parms)
 {
     return(InternalAllocBuffer(buffer, parms));
 }