OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/task.h" | 10 #include "base/task.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 surface_width, surface_height, | 81 surface_width, surface_height, |
82 av_stream->r_frame_rate.num, | 82 av_stream->r_frame_rate.num, |
83 av_stream->r_frame_rate.den, | 83 av_stream->r_frame_rate.den, |
84 av_stream->codec->extradata, | 84 av_stream->codec->extradata, |
85 av_stream->codec->extradata_size); | 85 av_stream->codec->extradata_size); |
86 state_ = kInitializing; | 86 state_ = kInitializing; |
87 decode_engine_->Initialize(message_loop_, this, NULL, config); | 87 decode_engine_->Initialize(message_loop_, this, NULL, config); |
88 } | 88 } |
89 | 89 |
90 void FFmpegVideoDecoder::OnInitializeComplete(const VideoCodecInfo& info) { | 90 void FFmpegVideoDecoder::OnInitializeComplete(const VideoCodecInfo& info) { |
| 91 // TODO(scherkus): Dedup this from OmxVideoDecoder::OnInitializeComplete. |
91 DCHECK_EQ(MessageLoop::current(), message_loop_); | 92 DCHECK_EQ(MessageLoop::current(), message_loop_); |
92 DCHECK(initialize_callback_.get()); | 93 DCHECK(initialize_callback_.get()); |
93 | 94 |
94 info_ = info; | 95 info_ = info; |
95 AutoCallbackRunner done_runner(initialize_callback_.release()); | 96 AutoCallbackRunner done_runner(initialize_callback_.release()); |
96 | 97 |
97 if (info.success) { | 98 if (info.success) { |
98 media_format_.SetAsInteger(MediaFormat::kWidth, | 99 media_format_.SetAsInteger(MediaFormat::kWidth, |
99 info.stream_info.surface_width); | 100 info.stream_info.surface_width); |
100 media_format_.SetAsInteger(MediaFormat::kHeight, | 101 media_format_.SetAsInteger(MediaFormat::kHeight, |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 VideoFrameReady(video_frame); | 374 VideoFrameReady(video_frame); |
374 } | 375 } |
375 } | 376 } |
376 | 377 |
377 void FFmpegVideoDecoder::SetVideoDecodeEngineForTest( | 378 void FFmpegVideoDecoder::SetVideoDecodeEngineForTest( |
378 VideoDecodeEngine* engine) { | 379 VideoDecodeEngine* engine) { |
379 decode_engine_.reset(engine); | 380 decode_engine_.reset(engine); |
380 } | 381 } |
381 | 382 |
382 } // namespace media | 383 } // namespace media |
OLD | NEW |