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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 0); | 252 0); |
253 if (status != VPX_CODEC_OK) { | 253 if (status != VPX_CODEC_OK) { |
254 LOG(ERROR) << "vpx_codec_dec_init failed, status=" << status; | 254 LOG(ERROR) << "vpx_codec_dec_init failed, status=" << status; |
255 delete context; | 255 delete context; |
256 return NULL; | 256 return NULL; |
257 } | 257 } |
258 return context; | 258 return context; |
259 } | 259 } |
260 | 260 |
261 bool VpxVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config) { | 261 bool VpxVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config) { |
262 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 262 if (config.codec() == kCodecVP8 && config.format() != VideoFrame::YV12A) { |
ddorwin
2014/03/06 21:57:17
It appears the old code would not support VP8 enti
vignesh
2014/03/06 22:06:53
the current check is wrong. this will always rejec
DaleCurtis
2014/03/06 22:13:24
Whoops, fixed.
| |
263 bool can_handle = false; | 263 return false; |
264 if (config.codec() == kCodecVP9) | 264 } else if (config.codec() != kCodecVP9) { |
265 can_handle = true; | 265 return false; |
266 if (!cmd_line->HasSwitch(switches::kDisableVp8AlphaPlayback) && | |
267 config.codec() == kCodecVP8 && config.format() == VideoFrame::YV12A) { | |
268 can_handle = true; | |
269 } | 266 } |
270 if (!can_handle) | |
271 return false; | |
272 | 267 |
273 CloseDecoder(); | 268 CloseDecoder(); |
274 | 269 |
275 vpx_codec_ = InitializeVpxContext(vpx_codec_, config); | 270 vpx_codec_ = InitializeVpxContext(vpx_codec_, config); |
276 if (!vpx_codec_) | 271 if (!vpx_codec_) |
277 return false; | 272 return false; |
278 | 273 |
279 // We use our own buffers for VP9 so that there is no need to copy data after | 274 // We use our own buffers for VP9 so that there is no need to copy data after |
280 // decoding. | 275 // decoding. |
281 if (config.codec() == kCodecVP9) { | 276 if (config.codec() == kCodecVP9) { |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
531 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get()); | 526 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get()); |
532 return; | 527 return; |
533 } | 528 } |
534 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y], | 529 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y], |
535 vpx_image->stride[VPX_PLANE_Y], | 530 vpx_image->stride[VPX_PLANE_Y], |
536 vpx_image->d_h, | 531 vpx_image->d_h, |
537 video_frame->get()); | 532 video_frame->get()); |
538 } | 533 } |
539 | 534 |
540 } // namespace media | 535 } // namespace media |
OLD | NEW |