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

Unified Diff: webkit/media/filter_helpers.cc

Issue 11414138: Encrypted Media: No NeedKey if --enable-encrypted-media is not set. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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
Index: webkit/media/filter_helpers.cc
diff --git a/webkit/media/filter_helpers.cc b/webkit/media/filter_helpers.cc
index 8003e2a61a5d4078f495ad2e257a162daf0311a0..70976c706e8073b7d9395c111b1b134e13674eba 100644
--- a/webkit/media/filter_helpers.cc
+++ b/webkit/media/filter_helpers.cc
@@ -36,25 +36,33 @@ static void AddDefaultDecodersToCollection(
base::Bind(&media::MessageLoopFactory::GetMessageLoop,
base::Unretained(message_loop_factory),
media::MessageLoopFactory::kPipeline));
-
- scoped_refptr<media::DecryptingAudioDecoder> decrypting_audio_decoder =
- new media::DecryptingAudioDecoder(
- base::Bind(&media::MessageLoopFactory::GetMessageLoop,
- base::Unretained(message_loop_factory),
- media::MessageLoopFactory::kPipeline),
- base::Bind(&ProxyDecryptor::RequestDecryptorNotification,
- base::Unretained(proxy_decryptor)));
-
filter_collection->GetAudioDecoders()->push_back(ffmpeg_audio_decoder);
- filter_collection->GetAudioDecoders()->push_back(decrypting_audio_decoder);
- scoped_refptr<media::DecryptingVideoDecoder> decrypting_video_decoder =
- new media::DecryptingVideoDecoder(
- base::Bind(&media::MessageLoopFactory::GetMessageLoop,
- base::Unretained(message_loop_factory),
- media::MessageLoopFactory::kPipeline),
- base::Bind(&ProxyDecryptor::RequestDecryptorNotification,
- base::Unretained(proxy_decryptor)));
+ if (proxy_decryptor) {
+ scoped_refptr<media::DecryptingAudioDecoder> decrypting_audio_decoder =
+ new media::DecryptingAudioDecoder(
+ base::Bind(&media::MessageLoopFactory::GetMessageLoop,
+ base::Unretained(message_loop_factory),
+ media::MessageLoopFactory::kPipeline),
+ base::Bind(&ProxyDecryptor::RequestDecryptorNotification,
+ base::Unretained(proxy_decryptor)));
+ filter_collection->GetAudioDecoders()->push_back(decrypting_audio_decoder);
+
+ scoped_refptr<media::DecryptingVideoDecoder> decrypting_video_decoder =
+ new media::DecryptingVideoDecoder(
+ base::Bind(&media::MessageLoopFactory::GetMessageLoop,
+ base::Unretained(message_loop_factory),
+ media::MessageLoopFactory::kPipeline),
+ base::Bind(&ProxyDecryptor::RequestDecryptorNotification,
+ base::Unretained(proxy_decryptor)));
+ // TODO(xhwang): Ideally we should have decrypting video decoder after
+ // regular video decoder since in the real world most videos are not
+ // encrypted. For now FFmpegVideoDecoder can also do decryption
+ // (decrypt-only), and we perfer DecryptingVideoDecoder (decrypt-and-decode)
+ // to FFmpegVideoDecoder. Fix this order when we move decryption out of
+ // FFmpegVideoDecoder.
+ filter_collection->GetVideoDecoders()->push_back(decrypting_video_decoder);
+ }
scoped_refptr<media::FFmpegVideoDecoder> ffmpeg_video_decoder =
new media::FFmpegVideoDecoder(
@@ -63,13 +71,6 @@ static void AddDefaultDecodersToCollection(
media::MessageLoopFactory::kPipeline),
proxy_decryptor);
- // TODO(xhwang): Ideally we should have decrypting video decoder after
- // regular video decoder since in the real world most videos are not
- // encrypted. For now FFmpegVideoDecoder can also do decryption
- // (decrypt-only), and we perfer DecryptingVideoDecoder (decrypt-and-decode)
- // to FFmpegVideoDecoder. Fix this order when we move decryption out of
- // FFmpegVideoDecoder.
- filter_collection->GetVideoDecoders()->push_back(decrypting_video_decoder);
filter_collection->GetVideoDecoders()->push_back(ffmpeg_video_decoder);
}

Powered by Google App Engine
This is Rietveld 408576698