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

Side by Side Diff: media/filters/vpx_video_decoder.cc

Issue 123213006: Make VideoDecoder use (kAborted, NULL) to signify an aborted decode, instead of (kOk, NULL). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests 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 unified diff | Download patch
« no previous file with comments | « media/filters/video_renderer_impl_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/vpx_video_decoder.h" 5 #include "media/filters/vpx_video_decoder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 200 }
201 201
202 void VpxVideoDecoder::Stop(const base::Closure& closure) { 202 void VpxVideoDecoder::Stop(const base::Closure& closure) {
203 DCHECK(task_runner_->BelongsToCurrentThread()); 203 DCHECK(task_runner_->BelongsToCurrentThread());
204 base::ScopedClosureRunner runner(BindToCurrentLoop(closure)); 204 base::ScopedClosureRunner runner(BindToCurrentLoop(closure));
205 205
206 if (state_ == kUninitialized) 206 if (state_ == kUninitialized)
207 return; 207 return;
208 208
209 if (!decode_cb_.is_null()) { 209 if (!decode_cb_.is_null()) {
210 base::ResetAndReturn(&decode_cb_).Run(kOk, NULL); 210 base::ResetAndReturn(&decode_cb_).Run(kAborted, NULL);
211 // Reset is pending only when decode is pending. 211 // Reset is pending only when decode is pending.
212 if (!reset_cb_.is_null()) 212 if (!reset_cb_.is_null())
213 base::ResetAndReturn(&reset_cb_).Run(); 213 base::ResetAndReturn(&reset_cb_).Run();
214 } 214 }
215 215
216 state_ = kUninitialized; 216 state_ = kUninitialized;
217 } 217 }
218 218
219 bool VpxVideoDecoder::HasAlpha() const { 219 bool VpxVideoDecoder::HasAlpha() const {
220 return vpx_codec_alpha_ != NULL; 220 return vpx_codec_alpha_ != NULL;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get()); 368 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get());
369 return; 369 return;
370 } 370 }
371 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y], 371 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y],
372 vpx_image->stride[VPX_PLANE_Y], 372 vpx_image->stride[VPX_PLANE_Y],
373 vpx_image->d_h, 373 vpx_image->d_h,
374 video_frame->get()); 374 video_frame->get());
375 } 375 }
376 376
377 } // namespace media 377 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/video_renderer_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698