Skip to content

Commit

Permalink
Add kExposeSwDecodersToWebRTC media switch.
Browse files Browse the repository at this point in the history
Instead of having kUseDecoderStreamForWebRTC gate both HW/SW fallback decoding and exposing SW decoders to WebRTC directly, add this switch for more fine grained control.

(cherry picked from commit 34d7d9a)

Bug: chromium:1173503
Change-Id: If4b1c1242935c7ca1f01772fbdd310587b60da81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2721726
Commit-Queue: Philip Eliasson <philipel@chromium.org>
Reviewed-by: Frank Liberato <liberato@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#858947}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2735054
Cr-Commit-Position: refs/branch-heads/4430@{#241}
Cr-Branched-From: e5ce7dc-refs/heads/master@{#857950}
  • Loading branch information
philipel authored and Chromium LUCI CQ committed Mar 8, 2021
1 parent bdbc5ca commit b54e449
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions media/base/media_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ const base::Feature kUseAndroidOverlayAggressively{
const base::Feature kUseDecoderStreamForWebRTC{
"UseDecoderStreamForWebRTC", base::FEATURE_DISABLED_BY_DEFAULT};

// If enabled, when RTCVideoDecoderAdapter is used then SW decoders will be
// exposed directly to WebRTC.
const base::Feature kExposeSwDecodersToWebRTC{
"ExposeSwDecodersToWebRTC", base::FEATURE_DISABLED_BY_DEFAULT};

// Let video without audio be paused when it is playing in the background.
const base::Feature kBackgroundVideoPauseOptimization{
"BackgroundVideoPauseOptimization", base::FEATURE_ENABLED_BY_DEFAULT};
Expand Down
1 change: 1 addition & 0 deletions media/base/media_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ MEDIA_EXPORT extern const base::Feature kD3D11VideoDecoderSkipMultithreaded;
MEDIA_EXPORT extern const base::Feature kD3D11VideoDecoderAlwaysCopy;
MEDIA_EXPORT extern const base::Feature kD3D11VideoDecoderAllowOverlay;
MEDIA_EXPORT extern const base::Feature kEnableMediaInternals;
MEDIA_EXPORT extern const base::Feature kExposeSwDecodersToWebRTC;
MEDIA_EXPORT extern const base::Feature kExternalClearKeyForTesting;
MEDIA_EXPORT extern const base::Feature kFFmpegDecodeOpaqueVP8;
MEDIA_EXPORT extern const base::Feature kFailUrlProvisionFetcherForTesting;
Expand Down
3 changes: 3 additions & 0 deletions media/renderers/default_decoder_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ DefaultDecoderFactory::GetSupportedVideoDecoderConfigsForWebRTC() {
}
#endif

if (!base::FeatureList::IsEnabled(media::kExposeSwDecodersToWebRTC))
return supported_configs;

#if BUILDFLAG(ENABLE_LIBVPX)
SupportedVideoDecoderConfigs vpx_configs =
VpxVideoDecoder::SupportedConfigs();
Expand Down

0 comments on commit b54e449

Please sign in to comment.