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

Unified Diff: media/filters/decrypting_audio_decoder.cc

Issue 1143223007: media: Reland "Simplify {Audio|Video}Decoder initialization callback." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 7c8f4b20ec6e72b07e6ecc17d28d22ed8f461991..7b3d279616170f4eecada9596b181ce32bac9e7f 100644
--- a/media/filters/decrypting_audio_decoder.cc
+++ b/media/filters/decrypting_audio_decoder.cc
@@ -48,7 +48,7 @@ std::string DecryptingAudioDecoder::GetDisplayName() const {
}
void DecryptingAudioDecoder::Initialize(const AudioDecoderConfig& config,
- const PipelineStatusCB& status_cb,
+ const InitCB& init_cb,
const OutputCB& output_cb) {
DVLOG(2) << "Initialize()";
DCHECK(task_runner_->BelongsToCurrentThread());
@@ -56,18 +56,18 @@ void DecryptingAudioDecoder::Initialize(const AudioDecoderConfig& config,
DCHECK(reset_cb_.is_null());
weak_this_ = weak_factory_.GetWeakPtr();
- init_cb_ = BindToCurrentLoop(status_cb);
+ init_cb_ = BindToCurrentLoop(init_cb);
output_cb_ = BindToCurrentLoop(output_cb);
if (!config.IsValidConfig()) {
DLOG(ERROR) << "Invalid audio stream config.";
- base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_DECODE);
+ base::ResetAndReturn(&init_cb_).Run(false);
return;
}
// DecryptingAudioDecoder only accepts potentially encrypted stream.
if (!config.is_encrypted()) {
- base::ResetAndReturn(&init_cb_).Run(DECODER_ERROR_NOT_SUPPORTED);
+ base::ResetAndReturn(&init_cb_).Run(false);
return;
}
@@ -162,7 +162,7 @@ DecryptingAudioDecoder::~DecryptingAudioDecoder() {
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);
+ base::ResetAndReturn(&init_cb_).Run(false);
if (!decode_cb_.is_null())
base::ResetAndReturn(&decode_cb_).Run(kAborted);
if (!reset_cb_.is_null())
@@ -181,7 +181,7 @@ void DecryptingAudioDecoder::SetDecryptor(
set_decryptor_ready_cb_.Reset();
if (!decryptor) {
- base::ResetAndReturn(&init_cb_).Run(DECODER_ERROR_NOT_SUPPORTED);
+ base::ResetAndReturn(&init_cb_).Run(false);
state_ = kError;
decryptor_attached_cb.Run(false);
return;
@@ -210,7 +210,7 @@ void DecryptingAudioDecoder::FinishInitialization(bool success) {
DCHECK(decode_cb_.is_null()); // No Decode() before initialization finished.
if (!success) {
- base::ResetAndReturn(&init_cb_).Run(DECODER_ERROR_NOT_SUPPORTED);
+ base::ResetAndReturn(&init_cb_).Run(false);
decryptor_ = NULL;
state_ = kError;
return;
@@ -226,7 +226,7 @@ void DecryptingAudioDecoder::FinishInitialization(bool success) {
base::Bind(&DecryptingAudioDecoder::OnKeyAdded, weak_this_)));
state_ = kIdle;
- base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK);
+ base::ResetAndReturn(&init_cb_).Run(true);
}
void DecryptingAudioDecoder::DecodePendingBuffer() {
« 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