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

Unified Diff: media/filters/decrypting_video_decoder.cc

Issue 1834303005: Refactor audio and video decoder status into common file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments. Created 4 years, 9 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
Index: media/filters/decrypting_video_decoder.cc
diff --git a/media/filters/decrypting_video_decoder.cc b/media/filters/decrypting_video_decoder.cc
index a639130d8e58177ca19cd5ede862738298d712f5..a03e711b8b40357bc60138f4f70c89fcef4df794 100644
--- a/media/filters/decrypting_video_decoder.cc
+++ b/media/filters/decrypting_video_decoder.cc
@@ -91,13 +91,13 @@ void DecryptingVideoDecoder::Decode(const scoped_refptr<DecoderBuffer>& buffer,
decode_cb_ = BindToCurrentLoop(decode_cb);
if (state_ == kError) {
- base::ResetAndReturn(&decode_cb_).Run(kDecodeError);
+ base::ResetAndReturn(&decode_cb_).Run(DecodeStatus::DECODE_ERROR);
return;
}
// Return empty frames if decoding has finished.
if (state_ == kDecodeFinished) {
- base::ResetAndReturn(&decode_cb_).Run(kOk);
+ base::ResetAndReturn(&decode_cb_).Run(DecodeStatus::OK);
return;
}
@@ -133,7 +133,7 @@ void DecryptingVideoDecoder::Reset(const base::Closure& closure) {
if (state_ == kWaitingForKey) {
DCHECK(!decode_cb_.is_null());
pending_buffer_to_decode_ = NULL;
- base::ResetAndReturn(&decode_cb_).Run(kAborted);
+ base::ResetAndReturn(&decode_cb_).Run(DecodeStatus::ABORTED);
}
DCHECK(decode_cb_.is_null());
@@ -154,7 +154,7 @@ DecryptingVideoDecoder::~DecryptingVideoDecoder() {
if (!init_cb_.is_null())
base::ResetAndReturn(&init_cb_).Run(false);
if (!decode_cb_.is_null())
- base::ResetAndReturn(&decode_cb_).Run(kAborted);
+ base::ResetAndReturn(&decode_cb_).Run(DecodeStatus::ABORTED);
if (!reset_cb_.is_null())
base::ResetAndReturn(&reset_cb_).Run();
}
@@ -225,7 +225,7 @@ void DecryptingVideoDecoder::DeliverFrame(
pending_buffer_to_decode_ = NULL;
if (!reset_cb_.is_null()) {
- base::ResetAndReturn(&decode_cb_).Run(kAborted);
+ base::ResetAndReturn(&decode_cb_).Run(DecodeStatus::ABORTED);
DoReset();
return;
}
@@ -236,7 +236,7 @@ void DecryptingVideoDecoder::DeliverFrame(
DVLOG(2) << "DeliverFrame() - kError";
MEDIA_LOG(ERROR, media_log_) << GetDisplayName() << ": decode error";
state_ = kError;
- base::ResetAndReturn(&decode_cb_).Run(kDecodeError);
+ base::ResetAndReturn(&decode_cb_).Run(DecodeStatus::DECODE_ERROR);
return;
}
@@ -263,7 +263,7 @@ void DecryptingVideoDecoder::DeliverFrame(
DVLOG(2) << "DeliverFrame() - kNeedMoreData";
state_ = scoped_pending_buffer_to_decode->end_of_stream() ? kDecodeFinished
: kIdle;
- base::ResetAndReturn(&decode_cb_).Run(kOk);
+ base::ResetAndReturn(&decode_cb_).Run(DecodeStatus::OK);
return;
}
@@ -281,7 +281,7 @@ void DecryptingVideoDecoder::DeliverFrame(
}
state_ = kIdle;
- base::ResetAndReturn(&decode_cb_).Run(kOk);
+ base::ResetAndReturn(&decode_cb_).Run(DecodeStatus::OK);
}
void DecryptingVideoDecoder::OnKeyAdded() {
« no previous file with comments | « media/filters/decrypting_audio_decoder_unittest.cc ('k') | media/filters/decrypting_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698