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

Unified Diff: media/filters/decrypting_video_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_video_decoder.h ('k') | media/filters/decrypting_video_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/decrypting_video_decoder.cc
diff --git a/media/filters/decrypting_video_decoder.cc b/media/filters/decrypting_video_decoder.cc
index fdffe83e84c9448eec856776fad3e93f57624429..3627080a8653f9ae9d85c04b5f6f75f893886c9e 100644
--- a/media/filters/decrypting_video_decoder.cc
+++ b/media/filters/decrypting_video_decoder.cc
@@ -39,7 +39,7 @@ std::string DecryptingVideoDecoder::GetDisplayName() const {
void DecryptingVideoDecoder::Initialize(const VideoDecoderConfig& config,
bool /* low_delay */,
- const PipelineStatusCB& status_cb,
+ const InitCB& init_cb,
const OutputCB& output_cb) {
DVLOG(2) << "Initialize()";
DCHECK(task_runner_->BelongsToCurrentThread());
@@ -51,7 +51,7 @@ void DecryptingVideoDecoder::Initialize(const VideoDecoderConfig& config,
DCHECK(config.IsValidConfig());
DCHECK(config.is_encrypted());
- init_cb_ = BindToCurrentLoop(status_cb);
+ init_cb_ = BindToCurrentLoop(init_cb);
output_cb_ = BindToCurrentLoop(output_cb);
weak_this_ = weak_factory_.GetWeakPtr();
config_ = config;
@@ -146,7 +146,7 @@ DecryptingVideoDecoder::~DecryptingVideoDecoder() {
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())
@@ -164,7 +164,7 @@ void DecryptingVideoDecoder::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;
@@ -189,7 +189,7 @@ void DecryptingVideoDecoder::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;
@@ -202,7 +202,7 @@ void DecryptingVideoDecoder::FinishInitialization(bool success) {
// Success!
state_ = kIdle;
- base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK);
+ base::ResetAndReturn(&init_cb_).Run(true);
}
« no previous file with comments | « media/filters/decrypting_video_decoder.h ('k') | media/filters/decrypting_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698