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

Unified Diff: media/base/mac/videotoolbox_helpers.h

Issue 1636083003: H264 HW encode using VideoToolbox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: media/base/mac/videotoolbox_helpers.h
diff --git a/media/base/mac/videotoolbox_helpers.h b/media/base/mac/videotoolbox_helpers.h
new file mode 100644
index 0000000000000000000000000000000000000000..08165e3cf70d366b055e33ae141f1611fa3411d5
--- /dev/null
+++ b/media/base/mac/videotoolbox_helpers.h
@@ -0,0 +1,56 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_BASE_MAC_VIDEOTOOLBOX_HELPERS_H_
+#define MEDIA_BASE_MAC_VIDEOTOOLBOX_HELPERS_H_
+
+#include "base/mac/scoped_cftyperef.h"
+#include "media/base/mac/videotoolbox_glue.h"
+#include "media/base/media_export.h"
+
+namespace media {
+
+MEDIA_EXPORT void CopySampleBufferToAnnexBBuffer(
+ CoreMediaGlue::CMSampleBufferRef sbuf,
+ std::string* annexb_buffer,
+ bool keyframe);
+
+template <typename NalSizeType>
+MEDIA_EXPORT void CopyNalsToAnnexB(char* avcc_buffer,
+ const size_t avcc_size,
+ std::string* annexb_buffer);
+
+MEDIA_EXPORT base::ScopedCFTypeRef<CFDictionaryRef>
+DictionaryWithKeysAndValues(CFTypeRef* keys, CFTypeRef* values, size_t size);
+
+MEDIA_EXPORT base::ScopedCFTypeRef<CFDictionaryRef> DictionaryWithKeyValue(
+ CFTypeRef key,
+ CFTypeRef value);
+
+MEDIA_EXPORT base::ScopedCFTypeRef<CFArrayRef> ArrayWithIntegers(const int* v,
+ size_t size);
+
+typedef VideoToolboxGlue::VTCompressionSessionRef VTCompressionSessionRef;
+
+MEDIA_EXPORT bool SetSessionProperty(
+ base::ScopedCFTypeRef<VTCompressionSessionRef> session,
+ const VideoToolboxGlue* const glue,
+ CFStringRef key,
+ int32_t value);
+
+MEDIA_EXPORT bool SetSessionProperty(
+ base::ScopedCFTypeRef<VTCompressionSessionRef> session,
+ const VideoToolboxGlue* const glue,
+ CFStringRef key,
+ bool value);
+
+MEDIA_EXPORT bool SetSessionProperty(
+ base::ScopedCFTypeRef<VTCompressionSessionRef> session,
+ const VideoToolboxGlue* const glue,
+ CFStringRef key,
+ CFStringRef value);
+
+} // namespace media
+
+#endif // MEDIA_BASE_MAC_VIDEOTOOLBOX_HELPERS_H_

Powered by Google App Engine
This is Rietveld 408576698