예제 #1
0
		static void CompressionCallback (IntPtr outputCallbackClosure, IntPtr sourceFrame, VTStatus status, VTEncodeInfoFlags infoFlags, IntPtr cmSampleBufferPtr)
		{
			var gch = GCHandle.FromIntPtr (outputCallbackClosure);
			var func = (VTCompressionOutputCallback) gch.Target;
			using (var sampleBuffer = new CMSampleBuffer (cmSampleBufferPtr)) {
				func (sourceFrame, status, infoFlags, sampleBuffer);
			}
		}
예제 #2
0
		public int/*CMSampleBufferError*/ TrackDataReadiness (CMSampleBuffer bufferToTrack)
		{
			var handleToTrack = IntPtr.Zero;
			if (bufferToTrack != null) {
				handleToTrack = bufferToTrack.handle;
			}
			return (int)CMSampleBufferTrackDataReadiness (handle, handleToTrack);
		}
예제 #3
0
		public CMSampleBufferError TrackDataReadiness (CMSampleBuffer bufferToTrack)
		{
			var handleToTrack = bufferToTrack == null ? IntPtr.Zero : bufferToTrack.handle;
			return CMSampleBufferTrackDataReadiness (handle, handleToTrack);
		}
예제 #4
0
		public unsafe static CMSampleBuffer CreateWithNewTiming (CMSampleBuffer original, CMSampleTimingInfo [] timing, out OSStatus status)
		{
			if (original == null)
				throw new ArgumentNullException ("original");

			nint count = timing == null ? 0 : timing.Length;
			IntPtr handle;

			fixed (CMSampleTimingInfo *t = timing)
				if ((status = CMSampleBufferCreateCopyWithNewTiming (IntPtr.Zero, original.Handle, count, t, out handle)) != 0)
					return null;
			
			return new CMSampleBuffer (handle, true);
		}
예제 #5
0
		public static CMSampleBuffer CreateWithNewTiming (CMSampleBuffer original, CMSampleTimingInfo [] timing)
		{
			OSStatus status;
			return CreateWithNewTiming (original, timing, out status);
		}
예제 #6
0
 public static void DidDropSampleBuffer(IAVCaptureAudioDataOutputSampleBufferDelegate This, AVCaptureOutput captureOutput, CMSampleBuffer sampleBuffer, AVCaptureConnection connection)
 {
 }
예제 #7
0
 public virtual void DidDropSampleBuffer(AVCaptureOutput captureOutput, CMSampleBuffer sampleBuffer, AVCaptureConnection connection)
 {
 }
예제 #8
0
		public VTStatus DecodeFrame (CMSampleBuffer sampleBuffer, VTDecodeFrameFlags decodeFlags,
			out VTDecodeInfoFlags infoFlags, VTDecompressionOutputHandler outputHandler)
		{
			if (Handle == IntPtr.Zero)
				throw new ObjectDisposedException ("DecompressionSession");
			if (sampleBuffer == null)
				throw new ArgumentNullException ("sampleBuffer");
			if (outputHandler == null)
				throw new ArgumentNullException ("outputHandler");

			unsafe {
				var block = new BlockLiteral ();
				var blockPtr = █
				block.SetupBlock (decompressionOutputHandlerTrampoline, outputHandler);

				try {
					return VTDecompressionSessionDecodeFrameWithOutputHandler (Handle,
						sampleBuffer.Handle, decodeFlags, out infoFlags, blockPtr);
				} finally {
					blockPtr->CleanupBlock ();
				}
			}
		}
예제 #9
0
		public VTStatus DecodeFrame (CMSampleBuffer sampleBuffer, VTDecodeFrameFlags decodeFlags, IntPtr sourceFrame, out VTDecodeInfoFlags infoFlags)
		{
			if (Handle == IntPtr.Zero)
				throw new ObjectDisposedException ("DecompressionSession");
			if (sampleBuffer == null)
				throw new ArgumentNullException ("sampleBuffer");

			return VTDecompressionSessionDecodeFrame (Handle, sampleBuffer.Handle, decodeFlags, sourceFrame, out infoFlags);
		}
예제 #10
0
        public CMSampleBufferError TrackDataReadiness(CMSampleBuffer bufferToTrack)
        {
            var handleToTrack = bufferToTrack == null ? IntPtr.Zero : bufferToTrack.handle;

            return(CMSampleBufferTrackDataReadiness(handle, handleToTrack));
        }
예제 #11
0
        public static CMSampleBuffer CreateWithNewTiming(CMSampleBuffer original, CMSampleTimingInfo [] timing)
        {
            OSStatus status;

            return(CreateWithNewTiming(original, timing, out status));
        }
예제 #12
0
		public VTStatus AddSampleBuffer (CMSampleBuffer sampleBuffer)
		{
			if (sampleBuffer == null)
				throw new ArgumentNullException ("sampleBuffer");

			var status = VTFrameSiloAddSampleBuffer (handle, sampleBuffer.Handle);
			return status;
		}
예제 #13
0
		static VTStatus BufferCallback (IntPtr callbackInfo, IntPtr sampleBufferPtr)
		{
			var gch = GCHandle.FromIntPtr (callbackInfo);
			var func = (Func<CMSampleBuffer, VTStatus>) gch.Target;
			var sampleBuffer = new CMSampleBuffer (sampleBufferPtr, false);
			return func (sampleBuffer);
		}