OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_VIDEOTOOLBOX_GLUE_H_ | 5 #ifndef MEDIA_BASE_MAC_VIDEOTOOLBOX_GLUE_H_ |
6 #define MEDIA_BASE_MAC_VIDEOTOOLBOX_GLUE_H_ | 6 #define MEDIA_BASE_MAC_VIDEOTOOLBOX_GLUE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "media/base/mac/coremedia_glue.h" | 11 #include "media/base/mac/coremedia_glue.h" |
12 #include "media/base/media_export.h" | 12 #include "media/base/media_export.h" |
13 | 13 |
14 // VideoToolbox API is available in OS X 10.9 and iOS 8 (10.8 has support for | 14 // VideoToolbox API is available in and after OS X 10.9 and iOS 8 (10.8 has |
15 // software encoding, but this class exposes the 10.9 API level). Chromium | 15 // support for software encoding, but this class exposes the 10.9 API level). |
16 // requires OS X 10.6 or iOS 6. Linking with VideoToolbox therefore has to | 16 // Chromium requires OS X 10.9 or iOS 9. This class is defined to try and load |
17 // happen at runtime. This class is defined to try and load the VideoToolbox | 17 // the VideoToolbox library at runtime. If it succeeds, clients can use |
18 // library. If it succeeds, clients can use VideoToolbox via this class. | 18 // VideoToolbox via this class. |
| 19 // Note that this file is necessary because Chromium still targets OS X 10.6 for |
| 20 // deployment. It should be deprecated soon, see crbug.com/579648. |
19 class MEDIA_EXPORT VideoToolboxGlue { | 21 class MEDIA_EXPORT VideoToolboxGlue { |
20 public: | 22 public: |
21 class Loader; | 23 class Loader; |
22 | 24 |
23 // Returns a glue object if VideoToolbox is supported or null otherwise. | 25 // Returns a glue object if VideoToolbox is supported or null otherwise. |
24 // Using a glue object allows to avoid expensive atomic operations on every | 26 // Using a glue object allows to avoid expensive atomic operations on every |
25 // function call. The object has process life duration and must not be | 27 // function call. The object has process life duration and must not be |
26 // deleted. | 28 // deleted. |
27 static const VideoToolboxGlue* Get(); | 29 static const VideoToolboxGlue* Get(); |
28 | 30 |
(...skipping 13 matching lines...) Expand all Loading... |
42 VTEncodeInfoFlags infoFlags, | 44 VTEncodeInfoFlags infoFlags, |
43 CoreMediaGlue::CMSampleBufferRef sampleBuffer); | 45 CoreMediaGlue::CMSampleBufferRef sampleBuffer); |
44 | 46 |
45 // Originally from VTSession.h | 47 // Originally from VTSession.h |
46 typedef CFTypeRef VTSessionRef; | 48 typedef CFTypeRef VTSessionRef; |
47 | 49 |
48 // Originally from VTCompressionProperties.h | 50 // Originally from VTCompressionProperties.h |
49 CFStringRef kVTCompressionPropertyKey_AllowFrameReordering() const; | 51 CFStringRef kVTCompressionPropertyKey_AllowFrameReordering() const; |
50 CFStringRef kVTCompressionPropertyKey_AverageBitRate() const; | 52 CFStringRef kVTCompressionPropertyKey_AverageBitRate() const; |
51 CFStringRef kVTCompressionPropertyKey_ColorPrimaries() const; | 53 CFStringRef kVTCompressionPropertyKey_ColorPrimaries() const; |
| 54 CFStringRef kVTCompressionPropertyKey_DataRateLimits() const; |
52 CFStringRef kVTCompressionPropertyKey_ExpectedFrameRate() const; | 55 CFStringRef kVTCompressionPropertyKey_ExpectedFrameRate() const; |
53 CFStringRef kVTCompressionPropertyKey_MaxFrameDelayCount() const; | 56 CFStringRef kVTCompressionPropertyKey_MaxFrameDelayCount() const; |
54 CFStringRef kVTCompressionPropertyKey_MaxKeyFrameInterval() const; | 57 CFStringRef kVTCompressionPropertyKey_MaxKeyFrameInterval() const; |
55 CFStringRef kVTCompressionPropertyKey_MaxKeyFrameIntervalDuration() const; | 58 CFStringRef kVTCompressionPropertyKey_MaxKeyFrameIntervalDuration() const; |
56 CFStringRef kVTCompressionPropertyKey_ProfileLevel() const; | 59 CFStringRef kVTCompressionPropertyKey_ProfileLevel() const; |
57 CFStringRef kVTCompressionPropertyKey_RealTime() const; | 60 CFStringRef kVTCompressionPropertyKey_RealTime() const; |
58 CFStringRef kVTCompressionPropertyKey_TransferFunction() const; | 61 CFStringRef kVTCompressionPropertyKey_TransferFunction() const; |
59 CFStringRef kVTCompressionPropertyKey_YCbCrMatrix() const; | 62 CFStringRef kVTCompressionPropertyKey_YCbCrMatrix() const; |
60 | 63 |
61 CFStringRef kVTEncodeFrameOptionKey_ForceKeyFrame() const; | 64 CFStringRef kVTEncodeFrameOptionKey_ForceKeyFrame() const; |
62 | 65 |
63 CFStringRef kVTProfileLevel_H264_Baseline_AutoLevel() const; | 66 CFStringRef kVTProfileLevel_H264_Baseline_AutoLevel() const; |
64 CFStringRef kVTProfileLevel_H264_Main_AutoLevel() const; | 67 CFStringRef kVTProfileLevel_H264_Main_AutoLevel() const; |
65 CFStringRef kVTProfileLevel_H264_Extended_AutoLevel() const; | 68 CFStringRef kVTProfileLevel_H264_Extended_AutoLevel() const; |
66 CFStringRef kVTProfileLevel_H264_High_AutoLevel() const; | 69 CFStringRef kVTProfileLevel_H264_High_AutoLevel() const; |
67 | 70 |
68 CFStringRef | 71 CFStringRef |
69 kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder() | 72 kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder() |
70 const; | 73 const; |
| 74 CFStringRef |
| 75 kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder() const; |
71 | 76 |
72 // Originally from VTCompressionSession.h | 77 // Originally from VTCompressionSession.h |
73 OSStatus VTCompressionSessionCreate( | 78 OSStatus VTCompressionSessionCreate( |
74 CFAllocatorRef allocator, | 79 CFAllocatorRef allocator, |
75 int32_t width, | 80 int32_t width, |
76 int32_t height, | 81 int32_t height, |
77 CoreMediaGlue::CMVideoCodecType codecType, | 82 CoreMediaGlue::CMVideoCodecType codecType, |
78 CFDictionaryRef encoderSpecification, | 83 CFDictionaryRef encoderSpecification, |
79 CFDictionaryRef sourceImageBufferAttributes, | 84 CFDictionaryRef sourceImageBufferAttributes, |
80 CFAllocatorRef compressedDataAllocator, | 85 CFAllocatorRef compressedDataAllocator, |
(...skipping 21 matching lines...) Expand all Loading... |
102 CFTypeRef propertyValue) const; | 107 CFTypeRef propertyValue) const; |
103 | 108 |
104 private: | 109 private: |
105 struct Library; | 110 struct Library; |
106 VideoToolboxGlue(); | 111 VideoToolboxGlue(); |
107 Library* library_; | 112 Library* library_; |
108 DISALLOW_COPY_AND_ASSIGN(VideoToolboxGlue); | 113 DISALLOW_COPY_AND_ASSIGN(VideoToolboxGlue); |
109 }; | 114 }; |
110 | 115 |
111 #endif // MEDIA_BASE_MAC_VIDEOTOOLBOX_GLUE_H_ | 116 #endif // MEDIA_BASE_MAC_VIDEOTOOLBOX_GLUE_H_ |
OLD | NEW |