Commit 842e677a authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Add MediaLog on selected DecryptingDemuxerStream

Currently when DecryptingDemuxerStream is selected, we only have
"video_dds = true" in MediaLog, which isn't obvious for readers. This CL
adds an explicit log event to make it clear.

Unit test is not updated because it's not trivial to set when we expect this to
be logged. For example, even with encrypted stream and a valid Decryptor, we
don't expect this log when decoder initialization failed.

Test: Manually tested. See note above.
Change-Id: If2149cd73c51916f1aa55e6f073ed2f73d65f28a
Reviewed-on: https://chromium-review.googlesource.com/c/1457432Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630033}
parent 678abf5a
......@@ -346,14 +346,21 @@ void DecoderStream<StreamType>::OnDecoderSelected(
DCHECK(decoder_);
}
decoder_ = std::move(selected_decoder);
auto* original_stream = stream_;
bool is_decrypting_demuxer_stream_selected = !!decrypting_demuxer_stream;
if (decrypting_demuxer_stream) {
// Override |stream_| with the decrypted stream provided by
// DecryptingDemuxerStream.
decrypting_demuxer_stream_ = std::move(decrypting_demuxer_stream);
stream_ = decrypting_demuxer_stream_.get();
// Also clear |cdm_context_|, it shouldn't be passed during reinitialize for
// a sream that isn't encrypted.
// a stream that isn't encrypted.
cdm_context_ = nullptr;
}
decoder_ = std::move(selected_decoder);
if (decoder_change_observer_cb_)
decoder_change_observer_cb_.Run(decoder_.get());
......@@ -389,6 +396,13 @@ void DecoderStream<StreamType>::OnDecoderSelected(
"is_platform_" + GetStreamTypeString() + "_decoder",
decoder_->IsPlatformDecoder());
if (is_decrypting_demuxer_stream_selected) {
MEDIA_LOG(INFO, media_log_)
<< "Selected DecryptingDemuxerStream for " << GetStreamTypeString()
<< " decryption, config: "
<< traits_->GetDecoderConfig(original_stream).AsHumanReadableString();
}
MEDIA_LOG(INFO, media_log_)
<< "Selected " << decoder_->GetDisplayName() << " for "
<< GetStreamTypeString() << " decoding, config: "
......
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