| 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/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 if (natural_size.width() > Limits::kMaxDimension || | 83 if (natural_size.width() > Limits::kMaxDimension || |
| 84 natural_size.height() > Limits::kMaxDimension || | 84 natural_size.height() > Limits::kMaxDimension || |
| 85 natural_size.GetArea() > Limits::kMaxCanvas) { | 85 natural_size.GetArea() > Limits::kMaxCanvas) { |
| 86 VideoCodecInfo info = {0}; | 86 VideoCodecInfo info = {0}; |
| 87 OnInitializeComplete(info); | 87 OnInitializeComplete(info); |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 | 90 |
| 91 VideoDecoderConfig config(CodecIDToVideoCodec(av_stream->codec->codec_id), | 91 VideoDecoderConfig config(CodecIDToVideoCodec(av_stream->codec->codec_id), |
| 92 PixelFormatToVideoFormat(av_stream->codec->pix_fmt), |
| 92 coded_size, visible_rect, natural_size, | 93 coded_size, visible_rect, natural_size, |
| 93 av_stream->r_frame_rate.num, | 94 av_stream->r_frame_rate.num, |
| 94 av_stream->r_frame_rate.den, | 95 av_stream->r_frame_rate.den, |
| 95 av_stream->codec->extradata, | 96 av_stream->codec->extradata, |
| 96 av_stream->codec->extradata_size); | 97 av_stream->codec->extradata_size); |
| 97 state_ = kInitializing; | 98 state_ = kInitializing; |
| 98 decode_engine_->Initialize(message_loop_, this, NULL, config); | 99 decode_engine_->Initialize(message_loop_, this, NULL, config); |
| 99 } | 100 } |
| 100 | 101 |
| 101 void FFmpegVideoDecoder::OnInitializeComplete(const VideoCodecInfo& info) { | 102 void FFmpegVideoDecoder::OnInitializeComplete(const VideoCodecInfo& info) { |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 decode_engine_->ProduceVideoFrame(video_frame); | 359 decode_engine_->ProduceVideoFrame(video_frame); |
| 359 } | 360 } |
| 360 } | 361 } |
| 361 | 362 |
| 362 void FFmpegVideoDecoder::SetVideoDecodeEngineForTest( | 363 void FFmpegVideoDecoder::SetVideoDecodeEngineForTest( |
| 363 VideoDecodeEngine* engine) { | 364 VideoDecodeEngine* engine) { |
| 364 decode_engine_.reset(engine); | 365 decode_engine_.reset(engine); |
| 365 } | 366 } |
| 366 | 367 |
| 367 } // namespace media | 368 } // namespace media |
| OLD | NEW |