Commit db0e70db authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Forgo DecryptingAudioDecoder except for tests

DecryptingAudioDecoder was added to support decrypt-and-decode of audio
buffers by a CDM using the Decryptor interface. Since then CDMs have
evolved and today there's no CDM supporting this path in production.
Though in browser tests, this paths is still used where the Clear Key
CDM can decrypt-and-decode audio.

This CL changes DefaultDecoderFactory such that by default
DecryptingAudioDecoder will not be created except when External Clear
Key is enabled, which typically is only set in browser tests.

This will save an IPC round trip during initialization when playing
media with encrypted audio, and hopefully will improve start-to-play
time.

Note that decrypt-and-decode of audio is supported on Android, but via
MojoAudioDecoder directly, not through an explicit Decryptor interface.

Bug: 846064
Test: browser tests still pass
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Iffcbd488e613b63d50bf077dc27b4e5c4105adc3
Reviewed-on: https://chromium-review.googlesource.com/1070554Reviewed-by: default avatarJohn Rummell <jrummell@chromium.org>
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561354}
parent 1c15aee7
...@@ -477,7 +477,7 @@ TEST_F(VideoDecoderSelectorTest, ...@@ -477,7 +477,7 @@ TEST_F(VideoDecoderSelectorTest,
UseEncryptedStream(); UseEncryptedStream();
InitializeDecoderSelector(kDecryptAndDecode, 2); InitializeDecoderSelector(kDecryptAndDecode, 2);
// DecryptingAudioDecoder is blacklisted so we'll fallback to use // DecryptingVideoDecoder is blacklisted so we'll fallback to use
// DecryptingDemuxerStream to do decrypt-only. // DecryptingDemuxerStream to do decrypt-only.
EXPECT_CALL(*this, OnDecoderOneInitialized(EncryptedConfig(), _, _, _, _, _)) EXPECT_CALL(*this, OnDecoderOneInitialized(EncryptedConfig(), _, _, _, _, _))
.WillOnce(RunCallback<3>(false)); .WillOnce(RunCallback<3>(false));
......
...@@ -52,8 +52,12 @@ void DefaultDecoderFactory::CreateAudioDecoders( ...@@ -52,8 +52,12 @@ void DefaultDecoderFactory::CreateAudioDecoders(
MediaLog* media_log, MediaLog* media_log,
std::vector<std::unique_ptr<AudioDecoder>>* audio_decoders) { std::vector<std::unique_ptr<AudioDecoder>>* audio_decoders) {
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
audio_decoders->push_back( // DecryptingAudioDecoder is only needed in External Clear Key testing to
std::make_unique<DecryptingAudioDecoder>(task_runner, media_log)); // cover the audio decrypt-and-decode path.
if (base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting)) {
audio_decoders->push_back(
std::make_unique<DecryptingAudioDecoder>(task_runner, media_log));
}
#endif #endif
#if BUILDFLAG(ENABLE_FFMPEG) #if BUILDFLAG(ENABLE_FFMPEG)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment