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

Unified Diff: webrtc/media/engine/videoencodersoftwarefallbackwrapper.cc

Issue 2997423002: Reland of Modify profiles for H264 encode SW fallback (Closed)
Patch Set: Fix gn issues Created 3 years, 4 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/media/engine/videoencodersoftwarefallbackwrapper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/videoencodersoftwarefallbackwrapper.cc
diff --git a/webrtc/media/engine/videoencodersoftwarefallbackwrapper.cc b/webrtc/media/engine/videoencodersoftwarefallbackwrapper.cc
index 2bc74a7e724578392b6bf4f544bdc2c1c76da0dd..540597838a9058bd187f76eac5bfc9d6baf9aafc 100644
--- a/webrtc/media/engine/videoencodersoftwarefallbackwrapper.cc
+++ b/webrtc/media/engine/videoencodersoftwarefallbackwrapper.cc
@@ -10,6 +10,7 @@
#include "webrtc/media/engine/videoencodersoftwarefallbackwrapper.h"
+#include "webrtc/media/base/h264_profile_level_id.h"
#include "webrtc/media/engine/internalencoderfactory.h"
#include "webrtc/modules/video_coding/include/video_error_codes.h"
#include "webrtc/rtc_base/checks.h"
@@ -89,6 +90,7 @@ VideoEncoderSoftwareFallbackWrapper::VideoEncoderSoftwareFallbackWrapper(
}
bool VideoEncoderSoftwareFallbackWrapper::InitFallbackEncoder() {
+ MaybeModifyCodecForFallback();
cricket::InternalEncoderFactory internal_factory;
if (!FindMatchingCodec(internal_factory.supported_codecs(), codec_)) {
LOG(LS_WARNING)
@@ -355,4 +357,13 @@ bool VideoEncoderSoftwareFallbackWrapper::ForcedFallbackParams::ShouldStop(
(codec.width * codec.height >= kMinPixelsStop);
}
+void VideoEncoderSoftwareFallbackWrapper::MaybeModifyCodecForFallback() {
+ // We have a specific case for H264 ConstrainedBaseline because that is the
+ // only supported profile in Sw fallback.
+ if (!cricket::CodecNamesEq(codec_.name.c_str(), cricket::kH264CodecName))
+ return;
+ codec_.SetParam(cricket::kH264FmtpProfileLevelId,
+ cricket::kH264ProfileLevelConstrainedBaseline);
+}
+
} // namespace webrtc
« no previous file with comments | « webrtc/media/engine/videoencodersoftwarefallbackwrapper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698