1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include <CoreFoundation/CoreFoundation.h>
10 // Declare CoreMedia types.
13 typedef signed long CMItemCount;
14 typedef uint32_t CMBlockBufferFlags;
15 typedef struct OpaqueCMBlockBuffer *CMBlockBufferRef;
16 typedef const struct opaqueCMFormatDescription *CMFormatDescriptionRef;
17 typedef CMFormatDescriptionRef CMVideoFormatDescriptionRef;
18 typedef struct opaqueCMSampleBuffer *CMSampleBufferRef;
20 typedef int64_t CMTimeValue;
21 typedef int32_t CMTimeScale;
22 typedef int64_t CMTimeEpoch;
23 typedef uint32_t CMTimeFlags;
27 CMTimeScale timescale;
34 CMTime presentationTimeStamp;
35 CMTime decodeTimeStamp;
45 void *(*AllocateBlock)(void *refCon, size_t sizeInBytes);
46 void (*FreeBlock)(void *refCon, void *doomedMemoryBlock, size_t sizeInBytes);
48 } CMBlockBufferCustomBlockSource;
50 typedef OSStatus (*CMSampleBufferMakeDataReadyCallback)(
51 CMSampleBufferRef sbuf,
52 void *makeDataReadyRefcon);
55 // Declare VideoToolbox types.
58 typedef struct __CVBuffer *CVBufferRef;
59 typedef CVBufferRef CVImageBufferRef;
60 typedef uint32_t VTDecodeFrameFlags;
62 kVTDecodeFrame_EnableAsynchronousDecompression = 1 << 0,
63 kVTDecodeFrame_DoNotOutputFrame = 1 << 1,
64 kVTDecodeFrame_1xRealTimePlayback = 1 << 2,
65 kVTDecodeFrame_EnableTemporalProcessing = 1 << 3,
67 typedef UInt32 VTDecodeInfoFlags;
68 typedef struct OpaqueVTDecompressionSession* VTDecompressionSessionRef;
69 typedef CFTypeRef VTSessionRef;
71 typedef void (*VTDecompressionOutputCallback)(
72 void *decompressionOutputRefCon,
73 void *sourceFrameRefCon,
75 VTDecodeInfoFlags infoFlags,
76 CVImageBufferRef imageBuffer,
77 CMTime presentationTimeStamp,
78 CMTime presentationDuration);
81 VTDecompressionOutputCallback decompressionOutputCallback;
82 void *decompressionOutputRefCon;
83 } VTDecompressionOutputCallbackRecord;