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

Unified Diff: media/filters/decrypting_audio_decoder.cc

Issue 139513007: Revert of Add Stop() to AudioDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « media/filters/decrypting_audio_decoder.h ('k') | media/filters/decrypting_audio_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/decrypting_audio_decoder.cc
diff --git a/media/filters/decrypting_audio_decoder.cc b/media/filters/decrypting_audio_decoder.cc
index 92c0ae681858189235f5c5310b8268409f500d97..63c3c43912c9d5828bbb86bebb3eb410cde97485 100644
--- a/media/filters/decrypting_audio_decoder.cc
+++ b/media/filters/decrypting_audio_decoder.cc
@@ -120,7 +120,7 @@
DCHECK(init_cb_.is_null()); // No Reset() during pending initialization.
DCHECK(reset_cb_.is_null());
- reset_cb_ = BindToCurrentLoop(closure);
+ reset_cb_ = closure;
decryptor_->ResetDecoder(Decryptor::kAudio);
@@ -145,28 +145,6 @@
DoReset();
}
-void DecryptingAudioDecoder::Stop(const base::Closure& closure) {
- DVLOG(2) << "Stop() - state: " << state_;
- DCHECK(task_runner_->BelongsToCurrentThread());
-
- if (decryptor_) {
- decryptor_->RegisterNewKeyCB(Decryptor::kAudio, Decryptor::NewKeyCB());
- decryptor_->DeinitializeDecoder(Decryptor::kAudio);
- decryptor_ = NULL;
- }
- if (!set_decryptor_ready_cb_.is_null())
- base::ResetAndReturn(&set_decryptor_ready_cb_).Run(DecryptorReadyCB());
- pending_buffer_to_decode_ = NULL;
- if (!init_cb_.is_null())
- base::ResetAndReturn(&init_cb_).Run(DECODER_ERROR_NOT_SUPPORTED);
- if (!read_cb_.is_null())
- base::ResetAndReturn(&read_cb_).Run(kAborted, NULL);
- if (!reset_cb_.is_null())
- base::ResetAndReturn(&reset_cb_).Run();
- state_ = kStopped;
- task_runner_->PostTask(FROM_HERE, closure);
-}
-
int DecryptingAudioDecoder::bits_per_channel() {
DCHECK(task_runner_->BelongsToCurrentThread());
return bits_per_channel_;
@@ -183,16 +161,11 @@
}
DecryptingAudioDecoder::~DecryptingAudioDecoder() {
- DCHECK(state_ == kUninitialized || state_ == kStopped) << state_;
}
void DecryptingAudioDecoder::SetDecryptor(Decryptor* decryptor) {
DVLOG(2) << "SetDecryptor()";
DCHECK(task_runner_->BelongsToCurrentThread());
-
- if (state_ == kStopped)
- return;
-
DCHECK_EQ(state_, kDecryptorRequested) << state_;
DCHECK(!init_cb_.is_null());
DCHECK(!set_decryptor_ready_cb_.is_null());
@@ -202,7 +175,7 @@
if (!decryptor) {
base::ResetAndReturn(&init_cb_).Run(DECODER_ERROR_NOT_SUPPORTED);
// TODO(xhwang): Add kError state. See http://crbug.com/251503
- state_ = kStopped;
+ state_ = kDecodeFinished;
return;
}
@@ -232,10 +205,6 @@
void DecryptingAudioDecoder::FinishInitialization(bool success) {
DVLOG(2) << "FinishInitialization()";
DCHECK(task_runner_->BelongsToCurrentThread());
-
- if (state_ == kStopped)
- return;
-
DCHECK_EQ(state_, kPendingDecoderInit) << state_;
DCHECK(!init_cb_.is_null());
DCHECK(reset_cb_.is_null()); // No Reset() before initialization finished.
@@ -243,7 +212,7 @@
if (!success) {
base::ResetAndReturn(&init_cb_).Run(DECODER_ERROR_NOT_SUPPORTED);
- state_ = kStopped;
+ state_ = kDecodeFinished;
return;
}
@@ -375,10 +344,6 @@
const Decryptor::AudioBuffers& frames) {
DVLOG(3) << "DeliverFrame() - status: " << status;
DCHECK(task_runner_->BelongsToCurrentThread());
-
- if (state_ == kStopped)
- return;
-
DCHECK_EQ(state_, kPendingDecode) << state_;
DCHECK(!read_cb_.is_null());
DCHECK(pending_buffer_to_decode_.get());
« no previous file with comments | « media/filters/decrypting_audio_decoder.h ('k') | media/filters/decrypting_audio_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698