Chromium Code Reviews| Index: media/filters/decrypting_video_decoder.cc |
| diff --git a/media/filters/decrypting_video_decoder.cc b/media/filters/decrypting_video_decoder.cc |
| index 98367b5e17fe16c9ed3c40f453c67e6ac5e88cc8..6c45ae2f94338f86c1a6f246b316909483a022c0 100644 |
| --- a/media/filters/decrypting_video_decoder.cc |
| +++ b/media/filters/decrypting_video_decoder.cc |
| @@ -56,6 +56,8 @@ void DecryptingVideoDecoder::Reset(const base::Closure& closure) { |
| return; |
| } |
| + DVLOG(2) << "Reset() - state: " << state_; |
| + |
| DCHECK(state_ == kIdle || |
| state_ == kPendingDemuxerRead || |
| state_ == kPendingDecode || |
| @@ -95,6 +97,8 @@ void DecryptingVideoDecoder::Stop(const base::Closure& closure) { |
| return; |
| } |
| + DVLOG(2) << "Stop() - state: " << state_; |
| + |
| DCHECK(stop_cb_.is_null()); |
| stop_cb_ = closure; |
| @@ -158,6 +162,8 @@ void DecryptingVideoDecoder::DoInitialize( |
| DCHECK_EQ(state_, kUninitialized) << state_; |
| DCHECK(stream); |
| + DVLOG(2) << "DoInitialize()"; |
|
ddorwin
2012/10/13 01:40:28
Suggest eliminating the extra line below.
One way
xhwang
2012/10/15 19:53:01
Done.
|
| + |
| const VideoDecoderConfig& config = stream->video_decoder_config(); |
| if (!config.IsValidConfig()) { |
| DLOG(ERROR) << "Invalid video stream config: " |
| @@ -188,6 +194,8 @@ void DecryptingVideoDecoder::SetDecryptor(Decryptor* decryptor) { |
| DCHECK_EQ(state_, kDecryptorRequested) << state_; |
| DCHECK(!init_cb_.is_null()); |
| + DVLOG(2) << "SetDecryptor()"; |
| + |
| if (!stop_cb_.is_null()) { |
| base::ResetAndReturn(&init_cb_).Run(DECODER_ERROR_NOT_SUPPORTED); |
| DoStop(); |
| @@ -213,6 +221,8 @@ void DecryptingVideoDecoder::FinishInitialization(bool success) { |
| DCHECK(reset_cb_.is_null()); // No Reset() before initialization finished. |
| DCHECK(read_cb_.is_null()); // No Read() before initialization finished. |
| + DVLOG(2) << "FinishInitialization()"; |
| + |
| if (!stop_cb_.is_null()) { |
| base::ResetAndReturn(&init_cb_).Run(DECODER_ERROR_NOT_SUPPORTED); |
| DoStop(); |
| @@ -236,6 +246,8 @@ void DecryptingVideoDecoder::DoRead(const ReadCB& read_cb) { |
| DCHECK(!read_cb.is_null()); |
| CHECK(read_cb_.is_null()) << "Overlapping decodes are not supported."; |
| + DVLOG(3) << "DoRead()"; |
| + |
| // Return empty frames if decoding has finished. |
| if (state_ == kDecodeFinished) { |
| read_cb.Run(kOk, VideoFrame::CreateEmptyFrame()); |
| @@ -276,6 +288,8 @@ void DecryptingVideoDecoder::DoDecryptAndDecodeBuffer( |
| DCHECK(!read_cb_.is_null()); |
| DCHECK_EQ(buffer != NULL, status == DemuxerStream::kOk) << status; |
| + DVLOG(3) << "DoDecryptAndDecodeBuffer()"; |
| + |
| if (!reset_cb_.is_null() || !stop_cb_.is_null()) { |
| base::ResetAndReturn(&read_cb_).Run(kOk, NULL); |
| if (!reset_cb_.is_null()) |
| @@ -286,8 +300,9 @@ void DecryptingVideoDecoder::DoDecryptAndDecodeBuffer( |
| } |
| if (status == DemuxerStream::kAborted) { |
| - base::ResetAndReturn(&read_cb_).Run(kOk, NULL); |
| + DVLOG(2) << "DoDecryptAndDecodeBuffer() - kAborted"; |
| state_ = kIdle; |
| + base::ResetAndReturn(&read_cb_).Run(kOk, NULL); |
| return; |
| } |
| @@ -295,6 +310,7 @@ void DecryptingVideoDecoder::DoDecryptAndDecodeBuffer( |
| // TODO(xhwang): Add config change support. |
| // The |state_| is chosen to be kDecodeFinished here to be consistent with |
| // the implementation of FFmpegVideoDecoder. |
| + DVLOG(2) << "DoDecryptAndDecodeBuffer() - kConfigChanged"; |
| state_ = kDecodeFinished; |
| base::ResetAndReturn(&read_cb_).Run(kDecodeError, NULL); |
| return; |
| @@ -337,6 +353,8 @@ void DecryptingVideoDecoder::DoDeliverFrame( |
| DCHECK(!read_cb_.is_null()); |
| DCHECK(pending_buffer_to_decode_); |
| + DVLOG(3) << "DoDeliverFrame()"; |
| + |
| bool need_to_try_again_if_nokey_is_returned = key_added_while_pending_decode_; |
| key_added_while_pending_decode_ = false; |
| @@ -391,6 +409,8 @@ void DecryptingVideoDecoder::DoDeliverFrame( |
| void DecryptingVideoDecoder::OnKeyAdded() { |
| DCHECK(message_loop_->BelongsToCurrentThread()); |
| + DVLOG(2) << "OnKeyAdded()"; |
| + |
| if (state_ == kPendingDecode) { |
| key_added_while_pending_decode_ = true; |
| return; |