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 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 | 437 |
438 if (vpx_image_alpha->user_priv != | 438 if (vpx_image_alpha->user_priv != |
439 reinterpret_cast<void*>(×tamp_alpha)) { | 439 reinterpret_cast<void*>(×tamp_alpha)) { |
440 LOG(ERROR) << "Invalid output timestamp on alpha."; | 440 LOG(ERROR) << "Invalid output timestamp on alpha."; |
441 return false; | 441 return false; |
442 } | 442 } |
443 } | 443 } |
444 } | 444 } |
445 | 445 |
446 CopyVpxImageTo(vpx_image, vpx_image_alpha, video_frame); | 446 CopyVpxImageTo(vpx_image, vpx_image_alpha, video_frame); |
447 (*video_frame)->SetTimestamp(base::TimeDelta::FromMicroseconds(timestamp)); | 447 (*video_frame)->set_timestamp(base::TimeDelta::FromMicroseconds(timestamp)); |
448 return true; | 448 return true; |
449 } | 449 } |
450 | 450 |
451 void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image, | 451 void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image, |
452 const struct vpx_image* vpx_image_alpha, | 452 const struct vpx_image* vpx_image_alpha, |
453 scoped_refptr<VideoFrame>* video_frame) { | 453 scoped_refptr<VideoFrame>* video_frame) { |
454 CHECK(vpx_image); | 454 CHECK(vpx_image); |
455 CHECK(vpx_image->fmt == VPX_IMG_FMT_I420 || | 455 CHECK(vpx_image->fmt == VPX_IMG_FMT_I420 || |
456 vpx_image->fmt == VPX_IMG_FMT_YV12); | 456 vpx_image->fmt == VPX_IMG_FMT_YV12); |
457 | 457 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get()); | 498 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get()); |
499 return; | 499 return; |
500 } | 500 } |
501 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y], | 501 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y], |
502 vpx_image->stride[VPX_PLANE_Y], | 502 vpx_image->stride[VPX_PLANE_Y], |
503 vpx_image->d_h, | 503 vpx_image->d_h, |
504 video_frame->get()); | 504 video_frame->get()); |
505 } | 505 } |
506 | 506 |
507 } // namespace media | 507 } // namespace media |
OLD | NEW |