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

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

Issue 1306813009: H.264 video codec support using OpenH264/FFmpeg (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: RTPDefragmentize, videoprocessor_unittest: H264 with no packet loss Created 5 years, 3 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.cc
diff --git a/webrtc/modules/video_coding/codecs/h264/h264.cc b/webrtc/modules/video_coding/codecs/h264/h264.cc
index d4123a2e777d7ecad519d9fe8b406eebe0777e63..b797f45025a403122e71c4cecbd47ee872b69ade 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264.cc
+++ b/webrtc/modules/video_coding/codecs/h264/h264.cc
@@ -11,6 +11,8 @@
#include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
+#include "webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h"
+#include "webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.h"
#if defined(WEBRTC_IOS)
#include "webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.h"
#include "webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.h"
@@ -23,25 +25,30 @@ namespace webrtc {
// We need this file to be C++ only so it will compile properly for all
// platforms. In order to write ObjC specific implementations we use private
// externs. This function is defined in h264.mm.
-#if defined(WEBRTC_IOS)
+#if defined(WEBRTC_IOS) && defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED)
extern bool IsH264CodecSupportedObjC();
#endif
bool IsH264CodecSupported() {
-#if defined(WEBRTC_IOS)
- return IsH264CodecSupportedObjC();
+#if defined(WEBRTC_IOS) && defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED)
+ if (IsH264CodecSupportedObjC()) {
+ return true;
+ }
#else
- return false;
+ // TODO(hbos): OpenH264 defines?
+ return true;
#endif
}
H264Encoder* H264Encoder::Create() {
DCHECK(H264Encoder::IsSupported());
#if defined(WEBRTC_IOS) && defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED)
- return new H264VideoToolboxEncoder();
+ if (IsH264CodecSupportedObjC()) {
+ return new H264VideoToolboxEncoder();
+ }
#else
- RTC_NOTREACHED();
- return nullptr;
+ // TODO(hbos): OpenH264 defines?
+ return new H264EncoderImpl();
#endif
}
@@ -52,10 +59,12 @@ bool H264Encoder::IsSupported() {
H264Decoder* H264Decoder::Create() {
DCHECK(H264Decoder::IsSupported());
#if defined(WEBRTC_IOS) && defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED)
- return new H264VideoToolboxDecoder();
+ if (IsH264CodecSupportedObjC()) {
+ return new H264VideoToolboxDecoder();
+ }
#else
- RTC_NOTREACHED();
- return nullptr;
+ // TODO(hbos): OpenH264 defines?
+ return new H264DecoderImpl();
#endif
}

Powered by Google App Engine
This is Rietveld 408576698