diff options
author | Ben Murdoch <benm@google.com> | 2014-04-03 12:29:45 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2014-04-03 12:29:45 +0100 |
commit | e5d81f57cb97b3b6b7fccc9c5610d21eb81db09d (patch) | |
tree | f266aab56db899073b21c1edd1d0e00055b9a2cf /media/filters/vpx_video_decoder.cc | |
parent | 67e8dac6e410a019f58fc452b262a184e8e7fd12 (diff) | |
download | chromium_org-e5d81f57cb97b3b6b7fccc9c5610d21eb81db09d.tar.gz |
Merge from Chromium at DEPS revision 261286
This commit was generated by merge_to_master.py.
Change-Id: Iea9643ce91618057f128e9a5b62c07be152f2b89
Diffstat (limited to 'media/filters/vpx_video_decoder.cc')
-rw-r--r-- | media/filters/vpx_video_decoder.cc | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc index ecef96cf16..69d137b94e 100644 --- a/media/filters/vpx_video_decoder.cc +++ b/media/filters/vpx_video_decoder.cc @@ -219,7 +219,6 @@ void VpxVideoDecoder::Initialize(const VideoDecoderConfig& config, DCHECK(config.IsValidConfig()); DCHECK(!config.is_encrypted()); DCHECK(decode_cb_.is_null()); - DCHECK(reset_cb_.is_null()); if (!ConfigureDecoder(config)) { status_cb.Run(DECODER_ERROR_NOT_SUPPORTED); @@ -329,29 +328,14 @@ void VpxVideoDecoder::Decode(const scoped_refptr<DecoderBuffer>& buffer, void VpxVideoDecoder::Reset(const base::Closure& closure) { DCHECK(task_runner_->BelongsToCurrentThread()); - DCHECK(reset_cb_.is_null()); - reset_cb_ = BindToCurrentLoop(closure); - - // Defer the reset if a decode is pending. - if (!decode_cb_.is_null()) - return; + DCHECK(decode_cb_.is_null()); - DoReset(); + state_ = kNormal; + task_runner_->PostTask(FROM_HERE, closure); } -void VpxVideoDecoder::Stop(const base::Closure& closure) { +void VpxVideoDecoder::Stop() { DCHECK(task_runner_->BelongsToCurrentThread()); - base::ScopedClosureRunner runner(BindToCurrentLoop(closure)); - - if (state_ == kUninitialized) - return; - - if (!decode_cb_.is_null()) { - base::ResetAndReturn(&decode_cb_).Run(kAborted, NULL); - // Reset is pending only when decode is pending. - if (!reset_cb_.is_null()) - base::ResetAndReturn(&reset_cb_).Run(); - } state_ = kUninitialized; } @@ -365,7 +349,6 @@ void VpxVideoDecoder::DecodeBuffer(const scoped_refptr<DecoderBuffer>& buffer) { DCHECK_NE(state_, kUninitialized); DCHECK_NE(state_, kDecodeFinished); DCHECK_NE(state_, kError); - DCHECK(reset_cb_.is_null()); DCHECK(!decode_cb_.is_null()); DCHECK(buffer); @@ -465,14 +448,6 @@ bool VpxVideoDecoder::VpxDecode(const scoped_refptr<DecoderBuffer>& buffer, return true; } -void VpxVideoDecoder::DoReset() { - DCHECK(decode_cb_.is_null()); - - state_ = kNormal; - reset_cb_.Run(); - reset_cb_.Reset(); -} - void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image, const struct vpx_image* vpx_image_alpha, scoped_refptr<VideoFrame>* video_frame) { |