| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |