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/ffmpeg_video_decoder.h" | 5 #include "media/filters/ffmpeg_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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 std::string threads(cmd_line->GetSwitchValueASCII(switches::kVideoThreads)); | 52 std::string threads(cmd_line->GetSwitchValueASCII(switches::kVideoThreads)); |
53 if (threads.empty() || !base::StringToInt(threads, &decode_threads)) { | 53 if (threads.empty() || !base::StringToInt(threads, &decode_threads)) { |
54 // Some ffmpeg codecs don't actually benefit from using more threads. | 54 // Some ffmpeg codecs don't actually benefit from using more threads. |
55 // Only add more threads for those codecs that we know will benefit. | 55 // Only add more threads for those codecs that we know will benefit. |
56 switch (config.codec()) { | 56 switch (config.codec()) { |
57 case kUnknownVideoCodec: | 57 case kUnknownVideoCodec: |
58 case kCodecVC1: | 58 case kCodecVC1: |
59 case kCodecMPEG2: | 59 case kCodecMPEG2: |
60 case kCodecHEVC: | 60 case kCodecHEVC: |
61 case kCodecVP9: | 61 case kCodecVP9: |
| 62 case kCodecDolbyVision: |
62 // We do not compile ffmpeg with support for any of these codecs. | 63 // We do not compile ffmpeg with support for any of these codecs. |
63 break; | 64 break; |
64 | 65 |
65 case kCodecTheora: | 66 case kCodecTheora: |
66 // No extra threads for these codecs. | 67 // No extra threads for these codecs. |
67 break; | 68 break; |
68 | 69 |
69 case kCodecH264: | 70 case kCodecH264: |
70 case kCodecMPEG4: | 71 case kCodecMPEG4: |
71 case kCodecVP8: | 72 case kCodecVP8: |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { | 428 if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { |
428 ReleaseFFmpegResources(); | 429 ReleaseFFmpegResources(); |
429 return false; | 430 return false; |
430 } | 431 } |
431 | 432 |
432 av_frame_.reset(av_frame_alloc()); | 433 av_frame_.reset(av_frame_alloc()); |
433 return true; | 434 return true; |
434 } | 435 } |
435 | 436 |
436 } // namespace media | 437 } // namespace media |
OLD | NEW |