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

Unified Diff: content/renderer/media/gpu/rtc_video_encoder_factory.cc

Issue 2125163003: Reland "Use kEnableWebRtcHWH264Encoding flag when SW fallback is available" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/gpu/rtc_video_encoder_factory.cc
diff --git a/content/renderer/media/gpu/rtc_video_encoder_factory.cc b/content/renderer/media/gpu/rtc_video_encoder_factory.cc
index 9295464f758e68f3b5aa68032d6da94331f91ae7..6734d4527d488669a32fe10141ba9fc79c300eb0 100644
--- a/content/renderer/media/gpu/rtc_video_encoder_factory.cc
+++ b/content/renderer/media/gpu/rtc_video_encoder_factory.cc
@@ -33,13 +33,18 @@ void VEAToWebRTCCodecs(
webrtc::kVideoCodecVP8, "VP8", width, height, fps));
} else if (profile.profile >= media::H264PROFILE_MIN &&
profile.profile <= media::H264PROFILE_MAX) {
- bool webrtc_h264_enabled = false;
-#if BUILDFLAG(RTC_USE_H264) && defined(OS_MACOSX)
- webrtc_h264_enabled =
+ // Enable H264 HW encode for WebRTC when SW fallback is available, which is
+ // checked by kWebRtcH264WithOpenH264FFmpeg flag. This check should be
+ // removed when SW implementation is fully enabled.
+ // kEnableWebRtcHWH264Encoding flag is only enabled for extensions, and
+ // can be used without SW fallback.
+ bool webrtc_h264_sw_enabled = false;
+#if BUILDFLAG(RTC_USE_H264)
+ webrtc_h264_sw_enabled =
base::FeatureList::IsEnabled(kWebRtcH264WithOpenH264FFmpeg);
-#endif // BUILDFLAG(RTC_USE_H264) && defined(OS_MACOSX)
+#endif // BUILDFLAG(RTC_USE_H264)
if (cmd_line->HasSwitch(switches::kEnableWebRtcHWH264Encoding) ||
- webrtc_h264_enabled) {
+ webrtc_h264_sw_enabled) {
codecs->push_back(cricket::WebRtcVideoEncoderFactory::VideoCodec(
webrtc::kVideoCodecH264, "H264", width, height, fps));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698