OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <deque> | 7 #include <deque> |
8 | 8 |
9 #include "base/task.h" | 9 #include "base/task.h" |
10 #include "media/base/callback.h" | 10 #include "media/base/callback.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 // be reevaluated to correctly handle decode errors. | 284 // be reevaluated to correctly handle decode errors. |
285 if (state_ == kNormal && !buffer->IsEndOfStream() && | 285 if (state_ == kNormal && !buffer->IsEndOfStream() && |
286 buffer->GetTimestamp() != kNoTimestamp) { | 286 buffer->GetTimestamp() != kNoTimestamp) { |
287 pts_heap_.Push(buffer->GetTimestamp()); | 287 pts_heap_.Push(buffer->GetTimestamp()); |
288 } | 288 } |
289 | 289 |
290 // Otherwise, attempt to decode a single frame. | 290 // Otherwise, attempt to decode a single frame. |
291 decode_engine_->ConsumeVideoSample(buffer); | 291 decode_engine_->ConsumeVideoSample(buffer); |
292 } | 292 } |
293 | 293 |
| 294 const MediaFormat& FFmpegVideoDecoder::media_format() { |
| 295 return media_format_; |
| 296 } |
| 297 |
294 void FFmpegVideoDecoder::ProduceVideoFrame( | 298 void FFmpegVideoDecoder::ProduceVideoFrame( |
295 scoped_refptr<VideoFrame> video_frame) { | 299 scoped_refptr<VideoFrame> video_frame) { |
296 if (MessageLoop::current() != message_loop()) { | 300 if (MessageLoop::current() != message_loop()) { |
297 message_loop()->PostTask( | 301 message_loop()->PostTask( |
298 FROM_HERE, | 302 FROM_HERE, |
299 NewRunnableMethod(this, | 303 NewRunnableMethod(this, |
300 &FFmpegVideoDecoder::ProduceVideoFrame, video_frame)); | 304 &FFmpegVideoDecoder::ProduceVideoFrame, video_frame)); |
301 return; | 305 return; |
302 } | 306 } |
303 | 307 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 VideoFrameReady(video_frame); | 436 VideoFrameReady(video_frame); |
433 } | 437 } |
434 } | 438 } |
435 | 439 |
436 void FFmpegVideoDecoder::SetVideoDecodeEngineForTest( | 440 void FFmpegVideoDecoder::SetVideoDecodeEngineForTest( |
437 VideoDecodeEngine* engine) { | 441 VideoDecodeEngine* engine) { |
438 decode_engine_.reset(engine); | 442 decode_engine_.reset(engine); |
439 } | 443 } |
440 | 444 |
441 } // namespace media | 445 } // namespace media |
OLD | NEW |