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

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

Issue 1657273002: Ability to disable the effects of |rtc_use_h264| with DisableRtcUseH264. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Gyp comment with #, not //, oops 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
« no previous file with comments | « webrtc/modules/video_coding/BUILD.gn ('k') | webrtc/modules/video_coding/codecs/h264/h264.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6f7316b10a69e9cd1db76ed0b5aa37cd15ae13fa..9fdc4d4623c232b859e8de1f214ced85c5894803 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264.cc
+++ b/webrtc/modules/video_coding/codecs/h264/h264.cc
@@ -11,9 +11,9 @@
#include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
-#if defined(WEBRTC_THIRD_PARTY_H264)
-#include "webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h"
+#if defined(WEBRTC_USE_H264)
#include "webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.h"
+#include "webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h"
#endif
#if defined(WEBRTC_IOS)
#include "webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_decoder.h"
@@ -25,6 +25,20 @@
namespace webrtc {
+namespace {
+
+#if defined(WEBRTC_USE_H264)
+bool g_rtc_use_h264 = true;
+#endif
+
+} // namespace
+
+void DisableRtcUseH264() {
+#if defined(WEBRTC_USE_H264)
+ g_rtc_use_h264 = false;
+#endif
+}
+
// 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.
@@ -39,8 +53,8 @@ bool IsH264CodecSupported() {
return true;
}
#endif
-#if defined(WEBRTC_THIRD_PARTY_H264)
- return true;
+#if defined(WEBRTC_USE_H264)
+ return g_rtc_use_h264;
#else
return false;
#endif
@@ -54,7 +68,8 @@ H264Encoder* H264Encoder::Create() {
return new H264VideoToolboxEncoder();
}
#endif
-#if defined(WEBRTC_THIRD_PARTY_H264)
+#if defined(WEBRTC_USE_H264)
+ RTC_CHECK(g_rtc_use_h264);
LOG(LS_INFO) << "Creating H264EncoderImpl.";
return new H264EncoderImpl();
#else
@@ -75,7 +90,8 @@ H264Decoder* H264Decoder::Create() {
return new H264VideoToolboxDecoder();
}
#endif
-#if defined(WEBRTC_THIRD_PARTY_H264)
+#if defined(WEBRTC_USE_H264)
+ RTC_CHECK(g_rtc_use_h264);
LOG(LS_INFO) << "Creating H264DecoderImpl.";
return new H264DecoderImpl();
#else
« no previous file with comments | « webrtc/modules/video_coding/BUILD.gn ('k') | webrtc/modules/video_coding/codecs/h264/h264.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698