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> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/callback_helpers.h" | 14 #include "base/callback_helpers.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/location.h" | 16 #include "base/location.h" |
17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
19 #include "media/base/bind_to_current_loop.h" | 19 #include "media/base/bind_to_current_loop.h" |
20 #include "media/base/decoder_buffer.h" | 20 #include "media/base/decoder_buffer.h" |
21 #include "media/base/limits.h" | 21 #include "media/base/limits.h" |
22 #include "media/base/media_switches.h" | 22 #include "media/base/media_switches.h" |
23 #include "media/base/pipeline.h" | |
24 #include "media/base/timestamp_constants.h" | 23 #include "media/base/timestamp_constants.h" |
25 #include "media/base/video_frame.h" | 24 #include "media/base/video_frame.h" |
26 #include "media/base/video_util.h" | 25 #include "media/base/video_util.h" |
27 #include "media/ffmpeg/ffmpeg_common.h" | 26 #include "media/ffmpeg/ffmpeg_common.h" |
28 #include "media/filters/ffmpeg_glue.h" | 27 #include "media/filters/ffmpeg_glue.h" |
29 | 28 |
30 namespace media { | 29 namespace media { |
31 | 30 |
32 // Always try to use three threads for video decoding. There is little reason | 31 // Always try to use three threads for video decoding. There is little reason |
33 // not to since current day CPUs tend to be multi-core and we measured | 32 // not to since current day CPUs tend to be multi-core and we measured |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { | 374 if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { |
376 ReleaseFFmpegResources(); | 375 ReleaseFFmpegResources(); |
377 return false; | 376 return false; |
378 } | 377 } |
379 | 378 |
380 av_frame_.reset(av_frame_alloc()); | 379 av_frame_.reset(av_frame_alloc()); |
381 return true; | 380 return true; |
382 } | 381 } |
383 | 382 |
384 } // namespace media | 383 } // namespace media |
OLD | NEW |