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

Unified Diff: media/filters/decrypting_video_decoder.cc

Issue 2543623003: media: Allow config change between clear and encrypted streams (Closed)
Patch Set: comments addressed Created 3 years, 10 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
Index: media/filters/decrypting_video_decoder.cc
diff --git a/media/filters/decrypting_video_decoder.cc b/media/filters/decrypting_video_decoder.cc
index 1b541d96231644c33047c5b4e834408bb669d7d6..3a869440d4f1e52e6f8cca1b79db9699b363bfa6 100644
--- a/media/filters/decrypting_video_decoder.cc
+++ b/media/filters/decrypting_video_decoder.cc
@@ -52,7 +52,6 @@ void DecryptingVideoDecoder::Initialize(const VideoDecoderConfig& config,
DCHECK(decode_cb_.is_null());
DCHECK(reset_cb_.is_null());
DCHECK(config.IsValidConfig());
- DCHECK(config.is_encrypted());
init_cb_ = BindToCurrentLoop(init_cb);
output_cb_ = BindToCurrentLoop(output_cb);
@@ -60,6 +59,10 @@ void DecryptingVideoDecoder::Initialize(const VideoDecoderConfig& config,
config_ = config;
if (state_ == kUninitialized) {
+ // DecoderSelector only chooses |this| when the stream is encrypted.
+ // TODO(xhwang): We may also select this decoder for clear stream if a CDM
+ // is attached. Then we need to update this. See http://crbug.com/597443
+ DCHECK(config.is_encrypted());
DCHECK(cdm_context);
if (!cdm_context->GetDecryptor()) {
MEDIA_LOG(DEBUG, media_log_) << GetDisplayName() << ": no decryptor";
@@ -69,7 +72,8 @@ void DecryptingVideoDecoder::Initialize(const VideoDecoderConfig& config,
decryptor_ = cdm_context->GetDecryptor();
} else {
- // Reinitialization.
+ // Reinitialization (i.e. upon a config change). The new config can be
+ // encrypted or clear.
decryptor_->DeinitializeDecoder(Decryptor::kVideo);
}
« no previous file with comments | « media/filters/decrypting_demuxer_stream_unittest.cc ('k') | media/filters/decrypting_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698