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

Unified Diff: webrtc/modules/video_coding/codecs/h264/h264.mm

Issue 1187573004: iOS HW H264 support. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Unit tests Created 5 years, 6 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: webrtc/modules/video_coding/codecs/h264/h264.mm
diff --git a/webrtc/modules/video_coding/codecs/h264/h264.mm b/webrtc/modules/video_coding/codecs/h264/h264.mm
new file mode 100644
index 0000000000000000000000000000000000000000..f4982443252cac0eb675cb5bff216449a3df8fdc
--- /dev/null
+++ b/webrtc/modules/video_coding/codecs/h264/h264.mm
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ *
+ */
+
+#include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
+
+#if defined(WEBRTC_IOS)
+#import <UIKit/UIKit.h>
+#endif
+
+#if defined(WEBRTC_IOS) || defined(WEBRTC_MAC)
+#include "webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.h"
+#include "webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.h"
+#endif
+
+namespace webrtc {
+
+H264Encoder* H264Encoder::Create() {
+#if defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED)
+#if defined(WEBRTC_IOS)
+ // Bail if we aren't actually running on an iOS8 device.
pbos-webrtc 2015/06/23 19:13:56 I do not believe we handle "return nullptr;" well
tkchin_webrtc 2015/06/24 23:21:14 Done.
+ if ([[[UIDevice currentDevice] systemVersion] doubleValue] < 8.0) {
+ return nullptr;
+ }
+#endif // WEBRTC_IOS
+ return new H264VideoToolboxEncoder();
+#else
+ return nullptr;
+#endif // WEBRTC_VIDEO_TOOLBOX_SUPPORTED
+}
+
+H264Decoder* H264Decoder::Create() {
+#if defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED)
+#if defined(WEBRTC_IOS)
+ // Bail if we aren't actually running on an iOS8 device.
+ if ([[[UIDevice currentDevice] systemVersion] doubleValue] < 8.0) {
+ return nullptr;
+ }
+#endif
+ return new H264VideoToolboxDecoder();
+#else // WEBRTC_IOS
+ return nullptr;
+#endif // WEBRTC_VIDEO_TOOLBOX_SUPPORTED
+}
+
+} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698