OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_BASE_MAC_COREMEDIA_GLUE_H_ | 5 #ifndef MEDIA_BASE_MAC_COREMEDIA_GLUE_H_ |
6 #define MEDIA_BASE_MAC_COREMEDIA_GLUE_H_ | 6 #define MEDIA_BASE_MAC_COREMEDIA_GLUE_H_ |
7 | 7 |
8 #include <CoreVideo/CoreVideo.h> | 8 #include <CoreVideo/CoreVideo.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 typedef int32_t CMTimeScale; | 21 typedef int32_t CMTimeScale; |
22 typedef int64_t CMTimeEpoch; | 22 typedef int64_t CMTimeEpoch; |
23 typedef uint32_t CMTimeFlags; | 23 typedef uint32_t CMTimeFlags; |
24 typedef struct { | 24 typedef struct { |
25 CMTimeValue value; | 25 CMTimeValue value; |
26 CMTimeScale timescale; | 26 CMTimeScale timescale; |
27 CMTimeFlags flags; | 27 CMTimeFlags flags; |
28 CMTimeEpoch epoch; | 28 CMTimeEpoch epoch; |
29 } CMTime; | 29 } CMTime; |
30 | 30 |
31 // Originally from CMBlockBuffer.h | |
32 typedef uint32_t CMBlockBufferFlags; | |
33 typedef struct OpaqueCMBlockBuffer* CMBlockBufferRef; | |
34 typedef struct { | |
35 uint32_t version; | |
36 void* (*AllocateBlock)(void*, size_t); | |
37 void (*FreeBlock)(void*, void*, size_t); | |
38 void* refCon; | |
39 } CMBlockBufferCustomBlockSource; | |
40 | |
31 // Originally from CMFormatDescription.h. | 41 // Originally from CMFormatDescription.h. |
32 typedef const struct opaqueCMFormatDescription* CMFormatDescriptionRef; | 42 typedef const struct opaqueCMFormatDescription* CMFormatDescriptionRef; |
33 typedef CMFormatDescriptionRef CMVideoFormatDescriptionRef; | 43 typedef CMFormatDescriptionRef CMVideoFormatDescriptionRef; |
44 typedef FourCharCode CMVideoCodecType; | |
34 typedef struct { | 45 typedef struct { |
35 int32_t width; | 46 int32_t width; |
36 int32_t height; | 47 int32_t height; |
37 } CMVideoDimensions; | 48 } CMVideoDimensions; |
38 enum { | 49 enum { |
39 kCMPixelFormat_422YpCbCr8_yuvs = 'yuvs', | 50 kCMPixelFormat_422YpCbCr8_yuvs = 'yuvs', |
40 }; | 51 }; |
41 enum { | 52 enum { |
42 kCMVideoCodecType_JPEG_OpenDML = 'dmb1', | 53 kCMVideoCodecType_JPEG_OpenDML = 'dmb1', |
54 kCMVideoCodecType_H264 = 'avc1', | |
55 }; | |
56 | |
57 // Originally from CMFormatDescriptionBridge.h | |
58 enum { | |
59 kCMFormatDescriptionBridgeError_InvalidParameter = -12712, | |
43 }; | 60 }; |
44 | 61 |
45 // Originally from CMSampleBuffer.h. | 62 // Originally from CMSampleBuffer.h. |
46 typedef struct OpaqueCMSampleBuffer* CMSampleBufferRef; | 63 typedef struct OpaqueCMSampleBuffer* CMSampleBufferRef; |
47 | 64 |
48 // Originally from CMTime.h. | 65 // Originally from CMTime.h. |
49 static CMTime CMTimeMake(int64_t value, int32_t timescale); | 66 static CMTime CMTimeMake(int64_t value, int32_t timescale); |
50 | 67 |
68 // Originally from CMBlockBuffer.h | |
69 static OSStatus CMBlockBufferCreateContiguous( | |
70 CFAllocatorRef structureAllocator, | |
71 CMBlockBufferRef sourceBuffer, | |
72 CFAllocatorRef blockAllocator, | |
73 const CMBlockBufferCustomBlockSource* customBlockSource, | |
74 size_t offsetToData, | |
75 size_t dataLength, | |
76 CMBlockBufferFlags flags, | |
77 CMBlockBufferRef* newBBufOut); | |
78 static size_t CMBlockBufferGetDataLength(CMBlockBufferRef theBuffer); | |
79 static OSStatus CMBlockBufferGetDataPointer(CMBlockBufferRef theBuffer, | |
80 size_t offset, | |
81 size_t* lengthAtOffset, | |
82 size_t* totalLength, | |
83 char** dataPointer); | |
84 static Boolean CMBlockBufferIsRangeContiguous(CMBlockBufferRef theBuffer, | |
85 size_t offset, | |
86 size_t length); | |
87 | |
51 // Originally from CMSampleBuffer.h. | 88 // Originally from CMSampleBuffer.h. |
89 static CMBlockBufferRef CMSampleBufferGetDataBuffer(CMSampleBufferRef sbuf); | |
90 static CMFormatDescriptionRef CMSampleBufferGetFormatDescription( | |
91 CMSampleBufferRef sbuf); | |
52 static CVImageBufferRef CMSampleBufferGetImageBuffer( | 92 static CVImageBufferRef CMSampleBufferGetImageBuffer( |
53 CMSampleBufferRef buffer); | 93 CMSampleBufferRef buffer); |
94 static CFArrayRef CMSampleBufferGetSampleAttachmentsArray( | |
95 CMSampleBufferRef sbuf, | |
96 Boolean createIfNecessary); | |
97 static CFStringRef kCMSampleAttachmentKey_NotSync(); | |
54 | 98 |
55 // Originally from CMFormatDescription.h. | 99 // Originally from CMFormatDescription.h. |
56 static FourCharCode CMFormatDescriptionGetMediaSubType( | 100 static FourCharCode CMFormatDescriptionGetMediaSubType( |
57 CMFormatDescriptionRef desc); | 101 CMFormatDescriptionRef desc); |
58 static CMVideoDimensions CMVideoFormatDescriptionGetDimensions( | 102 static CMVideoDimensions CMVideoFormatDescriptionGetDimensions( |
59 CMVideoFormatDescriptionRef videoDesc); | 103 CMVideoFormatDescriptionRef videoDesc); |
104 static OSStatus CMVideoFormatDescriptionGetH264ParameterSetAtIndex( | |
105 CMFormatDescriptionRef videoDesc, | |
106 size_t parameterSetIndex, | |
107 const uint8_t** parameterSetPointerOut, | |
108 size_t* parameterSetSizeOut, | |
109 size_t* parameterSetCountOut, | |
110 int* NALUnitHeaderLengthOut) | |
111 /*__OSX_AVAILABLE_STARTING(__MAC_10_9,__IPHONE_7_0)*/; | |
Robert Sesek
2014/09/12 16:16:16
None of the other functions carry these comments,
jfroy
2014/09/12 17:11:46
Unlike every other function in the CoreMedia glue,
| |
60 | 112 |
61 private: | 113 private: |
62 DISALLOW_IMPLICIT_CONSTRUCTORS(CoreMediaGlue); | 114 DISALLOW_IMPLICIT_CONSTRUCTORS(CoreMediaGlue); |
63 }; | 115 }; |
64 | 116 |
65 #endif // MEDIA_BASE_MAC_COREMEDIA_GLUE_H_ | 117 #endif // MEDIA_BASE_MAC_COREMEDIA_GLUE_H_ |
OLD | NEW |