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

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

Issue 1801343002: Revert of H264 HW encode using VideoToolbox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « media/base/mac/videotoolbox_glue.mm ('k') | media/base/mac/videotoolbox_helpers.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 #ifndef MEDIA_BASE_MAC_VIDEOTOOLBOX_HELPERS_H_
6 #define MEDIA_BASE_MAC_VIDEOTOOLBOX_HELPERS_H_
7
8 #include "base/mac/scoped_cftyperef.h"
9 #include "media/base/mac/videotoolbox_glue.h"
10 #include "media/base/media_export.h"
11
12 namespace media {
13
14 namespace video_toolbox {
15
16 // Create a CFDictionaryRef with the given keys and values.
17 MEDIA_EXPORT base::ScopedCFTypeRef<CFDictionaryRef>
18 DictionaryWithKeysAndValues(CFTypeRef* keys, CFTypeRef* values, size_t size);
19
20 // Create a CFDictionaryRef with the given key and value.
21 MEDIA_EXPORT base::ScopedCFTypeRef<CFDictionaryRef> DictionaryWithKeyValue(
22 CFTypeRef key,
23 CFTypeRef value);
24
25 // Create a CFArrayRef with the given array of integers.
26 MEDIA_EXPORT base::ScopedCFTypeRef<CFArrayRef> ArrayWithIntegers(const int* v,
27 size_t size);
28
29 // Create a CFArrayRef with the given int and float values.
30 MEDIA_EXPORT base::ScopedCFTypeRef<CFArrayRef> ArrayWithIntegerAndFloat(
31 int int_val,
32 float float_val);
33
34 // Copy a H.264 frame stored in a CM sample buffer to an Annex B buffer. Copies
35 // parameter sets for keyframes before the frame data as well.
36 MEDIA_EXPORT bool CopySampleBufferToAnnexBBuffer(
37 CoreMediaGlue::CMSampleBufferRef sbuf,
38 bool keyframe,
39 std::string* annexb_buffer);
40 MEDIA_EXPORT bool CopySampleBufferToAnnexBBuffer(
41 CoreMediaGlue::CMSampleBufferRef sbuf,
42 bool keyframe,
43 size_t annexb_buffer_size,
44 char* annexb_buffer,
45 size_t* used_buffer_size);
46
47 // Helper class to add session properties to a VTCompressionSessionRef.
48 class MEDIA_EXPORT SessionPropertySetter {
49 public:
50 SessionPropertySetter(
51 base::ScopedCFTypeRef<VideoToolboxGlue::VTCompressionSessionRef> session,
52 const VideoToolboxGlue* const glue);
53 ~SessionPropertySetter();
54
55 bool Set(CFStringRef key, int32_t value);
56 bool Set(CFStringRef key, bool value);
57 bool Set(CFStringRef key, CFStringRef value);
58 bool Set(CFStringRef key, CFArrayRef value);
59
60 private:
61 base::ScopedCFTypeRef<VideoToolboxGlue::VTCompressionSessionRef> session_;
62 const VideoToolboxGlue* glue_;
63 };
64
65 } // namespace video_toolbox
66
67 } // namespace media
68
69 #endif // MEDIA_BASE_MAC_VIDEOTOOLBOX_HELPERS_H_
OLDNEW
« no previous file with comments | « media/base/mac/videotoolbox_glue.mm ('k') | media/base/mac/videotoolbox_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698