Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: media/base/mac/videotoolbox_glue.h

Issue 1636083003: H264 HW encode using VideoToolbox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix cast tests. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 OS X 10.9 and iOS 8 (10.8 has support for
15 // software encoding, but this class exposes the 10.9 API level). Chromium 15 // software encoding, but this class exposes the 10.9 API level). Chromium
16 // requires OS X 10.6 or iOS 6. Linking with VideoToolbox therefore has to 16 // requires OS X 10.6 or iOS 6. Linking with VideoToolbox therefore has to
sandersd (OOO until July 31) 2016/03/09 22:42:08 This comment is out of date now. In fact we are ju
emircan 2016/03/09 23:29:34 Thanks for the heads up. I updated the comment and
17 // happen at runtime. This class is defined to try and load the VideoToolbox 17 // happen at runtime. This class is defined to try and load the VideoToolbox
18 // library. If it succeeds, clients can use VideoToolbox via this class. 18 // library. If it succeeds, clients can use VideoToolbox via this class.
19 class MEDIA_EXPORT VideoToolboxGlue { 19 class MEDIA_EXPORT VideoToolboxGlue {
20 public: 20 public:
21 class Loader; 21 class Loader;
22 22
23 // Returns a glue object if VideoToolbox is supported or null otherwise. 23 // Returns a glue object if VideoToolbox is supported or null otherwise.
24 // Using a glue object allows to avoid expensive atomic operations on every 24 // 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 25 // function call. The object has process life duration and must not be
26 // deleted. 26 // deleted.
(...skipping 15 matching lines...) Expand all
42 VTEncodeInfoFlags infoFlags, 42 VTEncodeInfoFlags infoFlags,
43 CoreMediaGlue::CMSampleBufferRef sampleBuffer); 43 CoreMediaGlue::CMSampleBufferRef sampleBuffer);
44 44
45 // Originally from VTSession.h 45 // Originally from VTSession.h
46 typedef CFTypeRef VTSessionRef; 46 typedef CFTypeRef VTSessionRef;
47 47
48 // Originally from VTCompressionProperties.h 48 // Originally from VTCompressionProperties.h
49 CFStringRef kVTCompressionPropertyKey_AllowFrameReordering() const; 49 CFStringRef kVTCompressionPropertyKey_AllowFrameReordering() const;
50 CFStringRef kVTCompressionPropertyKey_AverageBitRate() const; 50 CFStringRef kVTCompressionPropertyKey_AverageBitRate() const;
51 CFStringRef kVTCompressionPropertyKey_ColorPrimaries() const; 51 CFStringRef kVTCompressionPropertyKey_ColorPrimaries() const;
52 CFStringRef kVTCompressionPropertyKey_DataRateLimits() const;
52 CFStringRef kVTCompressionPropertyKey_ExpectedFrameRate() const; 53 CFStringRef kVTCompressionPropertyKey_ExpectedFrameRate() const;
53 CFStringRef kVTCompressionPropertyKey_MaxFrameDelayCount() const; 54 CFStringRef kVTCompressionPropertyKey_MaxFrameDelayCount() const;
54 CFStringRef kVTCompressionPropertyKey_MaxKeyFrameInterval() const; 55 CFStringRef kVTCompressionPropertyKey_MaxKeyFrameInterval() const;
55 CFStringRef kVTCompressionPropertyKey_MaxKeyFrameIntervalDuration() const; 56 CFStringRef kVTCompressionPropertyKey_MaxKeyFrameIntervalDuration() const;
56 CFStringRef kVTCompressionPropertyKey_ProfileLevel() const; 57 CFStringRef kVTCompressionPropertyKey_ProfileLevel() const;
57 CFStringRef kVTCompressionPropertyKey_RealTime() const; 58 CFStringRef kVTCompressionPropertyKey_RealTime() const;
58 CFStringRef kVTCompressionPropertyKey_TransferFunction() const; 59 CFStringRef kVTCompressionPropertyKey_TransferFunction() const;
59 CFStringRef kVTCompressionPropertyKey_YCbCrMatrix() const; 60 CFStringRef kVTCompressionPropertyKey_YCbCrMatrix() const;
60 61
61 CFStringRef kVTEncodeFrameOptionKey_ForceKeyFrame() const; 62 CFStringRef kVTEncodeFrameOptionKey_ForceKeyFrame() const;
62 63
63 CFStringRef kVTProfileLevel_H264_Baseline_AutoLevel() const; 64 CFStringRef kVTProfileLevel_H264_Baseline_AutoLevel() const;
64 CFStringRef kVTProfileLevel_H264_Main_AutoLevel() const; 65 CFStringRef kVTProfileLevel_H264_Main_AutoLevel() const;
65 CFStringRef kVTProfileLevel_H264_Extended_AutoLevel() const; 66 CFStringRef kVTProfileLevel_H264_Extended_AutoLevel() const;
66 CFStringRef kVTProfileLevel_H264_High_AutoLevel() const; 67 CFStringRef kVTProfileLevel_H264_High_AutoLevel() const;
67 68
68 CFStringRef 69 CFStringRef
69 kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder() 70 kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder()
70 const; 71 const;
72 CFStringRef
73 kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder() const;
71 74
72 // Originally from VTCompressionSession.h 75 // Originally from VTCompressionSession.h
73 OSStatus VTCompressionSessionCreate( 76 OSStatus VTCompressionSessionCreate(
74 CFAllocatorRef allocator, 77 CFAllocatorRef allocator,
75 int32_t width, 78 int32_t width,
76 int32_t height, 79 int32_t height,
77 CoreMediaGlue::CMVideoCodecType codecType, 80 CoreMediaGlue::CMVideoCodecType codecType,
78 CFDictionaryRef encoderSpecification, 81 CFDictionaryRef encoderSpecification,
79 CFDictionaryRef sourceImageBufferAttributes, 82 CFDictionaryRef sourceImageBufferAttributes,
80 CFAllocatorRef compressedDataAllocator, 83 CFAllocatorRef compressedDataAllocator,
(...skipping 21 matching lines...) Expand all
102 CFTypeRef propertyValue) const; 105 CFTypeRef propertyValue) const;
103 106
104 private: 107 private:
105 struct Library; 108 struct Library;
106 VideoToolboxGlue(); 109 VideoToolboxGlue();
107 Library* library_; 110 Library* library_;
108 DISALLOW_COPY_AND_ASSIGN(VideoToolboxGlue); 111 DISALLOW_COPY_AND_ASSIGN(VideoToolboxGlue);
109 }; 112 };
110 113
111 #endif // MEDIA_BASE_MAC_VIDEOTOOLBOX_GLUE_H_ 114 #endif // MEDIA_BASE_MAC_VIDEOTOOLBOX_GLUE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698