| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #include "media/base/video_frame_impl.h" | 5 #include "media/base/video_frame_impl.h" |
| 6 #include "media/filters/ffmpeg_common.h" | 6 #include "media/filters/ffmpeg_common.h" |
| 7 #include "media/filters/ffmpeg_demuxer.h" | 7 #include "media/filters/ffmpeg_demuxer.h" |
| 8 #include "media/filters/ffmpeg_video_decoder.h" | 8 #include "media/filters/ffmpeg_video_decoder.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // continue processing. Although it'd be nice to have the option of a single | 30 // continue processing. Although it'd be nice to have the option of a single |
| 31 // decoding thread, FFmpeg treats having one thread the same as having zero | 31 // decoding thread, FFmpeg treats having one thread the same as having zero |
| 32 // threads (i.e., avcodec_decode_video() will execute on the calling thread). | 32 // threads (i.e., avcodec_decode_video() will execute on the calling thread). |
| 33 // Yet another reason for having two threads :) | 33 // Yet another reason for having two threads :) |
| 34 // | 34 // |
| 35 // TODO(scherkus): some video codecs might not like avcodec_thread_init() being | 35 // TODO(scherkus): some video codecs might not like avcodec_thread_init() being |
| 36 // called on them... should attempt to find out which ones those are! | 36 // called on them... should attempt to find out which ones those are! |
| 37 static const int kDecodeThreads = 2; | 37 static const int kDecodeThreads = 2; |
| 38 | 38 |
| 39 FFmpegVideoDecoder::FFmpegVideoDecoder() | 39 FFmpegVideoDecoder::FFmpegVideoDecoder() |
| 40 : DecoderBase<VideoDecoder, VideoFrame>("VideoDecoderThread"), | 40 : width_(0), |
| 41 width_(0), | |
| 42 height_(0), | 41 height_(0), |
| 43 time_base_(new AVRational()), | 42 time_base_(new AVRational()), |
| 44 state_(kNormal), | 43 state_(kNormal), |
| 45 codec_context_(NULL) { | 44 codec_context_(NULL) { |
| 46 } | 45 } |
| 47 | 46 |
| 48 FFmpegVideoDecoder::~FFmpegVideoDecoder() { | 47 FFmpegVideoDecoder::~FFmpegVideoDecoder() { |
| 49 } | 48 } |
| 50 | 49 |
| 51 // static | 50 // static |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 // static | 344 // static |
| 346 bool FFmpegVideoDecoder::PtsHeapOrdering::operator()( | 345 bool FFmpegVideoDecoder::PtsHeapOrdering::operator()( |
| 347 const base::TimeDelta& lhs, | 346 const base::TimeDelta& lhs, |
| 348 const base::TimeDelta& rhs) const { | 347 const base::TimeDelta& rhs) const { |
| 349 // std::priority_queue is a max-heap. We want lower timestamps to show up | 348 // std::priority_queue is a max-heap. We want lower timestamps to show up |
| 350 // first so reverse the natural less-than comparison. | 349 // first so reverse the natural less-than comparison. |
| 351 return rhs < lhs; | 350 return rhs < lhs; |
| 352 } | 351 } |
| 353 | 352 |
| 354 } // namespace | 353 } // namespace |
| OLD | NEW |