| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 (*video_frame)->visible_rect().height()); | 573 (*video_frame)->visible_rect().height()); |
| 574 } | 574 } |
| 575 | 575 |
| 576 (*video_frame)->set_timestamp(base::TimeDelta::FromMicroseconds(timestamp)); | 576 (*video_frame)->set_timestamp(base::TimeDelta::FromMicroseconds(timestamp)); |
| 577 | 577 |
| 578 // Default to the color space from the config, but if the bistream specifies | 578 // Default to the color space from the config, but if the bistream specifies |
| 579 // one, prefer that instead. | 579 // one, prefer that instead. |
| 580 ColorSpace color_space = config_.color_space(); | 580 ColorSpace color_space = config_.color_space(); |
| 581 if (vpx_image->cs == VPX_CS_BT_709) | 581 if (vpx_image->cs == VPX_CS_BT_709) |
| 582 color_space = COLOR_SPACE_HD_REC709; | 582 color_space = COLOR_SPACE_HD_REC709; |
| 583 else if (vpx_image->cs == VPX_CS_BT_601) | 583 else if (vpx_image->cs == VPX_CS_BT_601 || vpx_image->cs == VPX_CS_SMPTE_170) |
| 584 color_space = COLOR_SPACE_SD_REC601; | 584 color_space = COLOR_SPACE_SD_REC601; |
| 585 (*video_frame) | 585 (*video_frame) |
| 586 ->metadata() | 586 ->metadata() |
| 587 ->SetInteger(VideoFrameMetadata::COLOR_SPACE, color_space); | 587 ->SetInteger(VideoFrameMetadata::COLOR_SPACE, color_space); |
| 588 return true; | 588 return true; |
| 589 } | 589 } |
| 590 | 590 |
| 591 VpxVideoDecoder::AlphaDecodeStatus VpxVideoDecoder::DecodeAlphaPlane( | 591 VpxVideoDecoder::AlphaDecodeStatus VpxVideoDecoder::DecodeAlphaPlane( |
| 592 const struct vpx_image* vpx_image, | 592 const struct vpx_image* vpx_image, |
| 593 const struct vpx_image** vpx_image_alpha, | 593 const struct vpx_image** vpx_image_alpha, |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 (*video_frame)->visible_data(VideoFrame::kUPlane), | 731 (*video_frame)->visible_data(VideoFrame::kUPlane), |
| 732 (*video_frame)->stride(VideoFrame::kUPlane), | 732 (*video_frame)->stride(VideoFrame::kUPlane), |
| 733 (*video_frame)->visible_data(VideoFrame::kVPlane), | 733 (*video_frame)->visible_data(VideoFrame::kVPlane), |
| 734 (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(), | 734 (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(), |
| 735 coded_size.height()); | 735 coded_size.height()); |
| 736 | 736 |
| 737 return true; | 737 return true; |
| 738 } | 738 } |
| 739 | 739 |
| 740 } // namespace media | 740 } // namespace media |
| OLD | NEW |