| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 thread_checker_.DetachFromThread(); | 342 thread_checker_.DetachFromThread(); |
| 343 } | 343 } |
| 344 | 344 |
| 345 VpxVideoDecoder::~VpxVideoDecoder() { | 345 VpxVideoDecoder::~VpxVideoDecoder() { |
| 346 DCHECK(thread_checker_.CalledOnValidThread()); | 346 DCHECK(thread_checker_.CalledOnValidThread()); |
| 347 CloseDecoder(); | 347 CloseDecoder(); |
| 348 // Ensure CloseDecoder() released the offload thread. | 348 // Ensure CloseDecoder() released the offload thread. |
| 349 DCHECK(!offload_task_runner_); | 349 DCHECK(!offload_task_runner_); |
| 350 } | 350 } |
| 351 | 351 |
| 352 // static |
| 353 bool VpxVideoDecoder::IsVideoConfigSupported(const VideoConfig& config) { |
| 354 if (config.codec != kCodecVP8 && config.codec != kCodecVP9) |
| 355 return false; |
| 356 |
| 357 if (config.codec == kCodecVP9) { |
| 358 switch (config.profile) { |
| 359 case VP9PROFILE_PROFILE0: |
| 360 case VP9PROFILE_PROFILE1: |
| 361 return true; |
| 362 case VP9PROFILE_PROFILE2: |
| 363 case VP9PROFILE_PROFILE3: { |
| 364 vpx_codec_caps_t vp9_caps = vpx_codec_get_caps(vpx_codec_vp9_dx()); |
| 365 return (vp9_caps & VPX_CODEC_CAP_HIGHBITDEPTH); |
| 366 } |
| 367 default: |
| 368 NOTREACHED(); |
| 369 } |
| 370 } |
| 371 |
| 372 return false; |
| 373 } |
| 374 |
| 352 std::string VpxVideoDecoder::GetDisplayName() const { | 375 std::string VpxVideoDecoder::GetDisplayName() const { |
| 353 return "VpxVideoDecoder"; | 376 return "VpxVideoDecoder"; |
| 354 } | 377 } |
| 355 | 378 |
| 356 void VpxVideoDecoder::Initialize(const VideoDecoderConfig& config, | 379 void VpxVideoDecoder::Initialize(const VideoDecoderConfig& config, |
| 357 bool /* low_delay */, | 380 bool /* low_delay */, |
| 358 CdmContext* /* cdm_context */, | 381 CdmContext* /* cdm_context */, |
| 359 const InitCB& init_cb, | 382 const InitCB& init_cb, |
| 360 const OutputCB& output_cb) { | 383 const OutputCB& output_cb) { |
| 361 DCHECK(thread_checker_.CalledOnValidThread()); | 384 DCHECK(thread_checker_.CalledOnValidThread()); |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 (*video_frame)->visible_data(VideoFrame::kUPlane), | 869 (*video_frame)->visible_data(VideoFrame::kUPlane), |
| 847 (*video_frame)->stride(VideoFrame::kUPlane), | 870 (*video_frame)->stride(VideoFrame::kUPlane), |
| 848 (*video_frame)->visible_data(VideoFrame::kVPlane), | 871 (*video_frame)->visible_data(VideoFrame::kVPlane), |
| 849 (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(), | 872 (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(), |
| 850 coded_size.height()); | 873 coded_size.height()); |
| 851 | 874 |
| 852 return true; | 875 return true; |
| 853 } | 876 } |
| 854 | 877 |
| 855 } // namespace media | 878 } // namespace media |
| OLD | NEW |