コード例 #1
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.SetupBlockUnsafe(decompressionOutputHandlerTrampoline, outputHandler);

                try {
                    return(VTDecompressionSessionDecodeFrameWithOutputHandler(Handle,
                                                                              sampleBuffer.Handle, decodeFlags, out infoFlags, blockPtr));
                } finally {
                    blockPtr->CleanupBlock();
                }
            }
        }
コード例 #2
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 ();
				}
			}
		}