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

Unified Diff: media/filters/decrypting_video_decoder.cc

Issue 2543623003: media: Allow config change between clear and encrypted streams (Closed)
Patch Set: media: Allow config change between clear and encrypted streams Created 3 years, 11 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..187cc2e275cb2d3b15bdbf92bdf96cd08dddc5e5 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,8 @@ void DecryptingVideoDecoder::Initialize(const VideoDecoderConfig& config,
config_ = config;
if (state_ == kUninitialized) {
+ // DecoderSelector only chooses |this| when the stream is encrypted.
ddorwin 2017/02/12 04:28:52 ditto
xhwang 2017/02/14 23:59:33 Done.
+ DCHECK(config.is_encrypted());
DCHECK(cdm_context);
if (!cdm_context->GetDecryptor()) {
MEDIA_LOG(DEBUG, media_log_) << GetDisplayName() << ": no decryptor";
@@ -69,7 +70,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);
}

Powered by Google App Engine
This is Rietveld 408576698