| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
| 12 #include "media/base/decoder_buffer.h" | 12 #include "media/base/decoder_buffer.h" |
| 13 #include "media/base/decryptor.h" |
| 13 #include "media/base/demuxer_stream.h" | 14 #include "media/base/demuxer_stream.h" |
| 14 #include "media/base/limits.h" | 15 #include "media/base/limits.h" |
| 15 #include "media/base/media_switches.h" | 16 #include "media/base/media_switches.h" |
| 16 #include "media/base/pipeline.h" | 17 #include "media/base/pipeline.h" |
| 17 #include "media/base/video_decoder_config.h" | 18 #include "media/base/video_decoder_config.h" |
| 18 #include "media/base/video_frame.h" | 19 #include "media/base/video_frame.h" |
| 19 #include "media/base/video_util.h" | 20 #include "media/base/video_util.h" |
| 20 #include "media/ffmpeg/ffmpeg_common.h" | 21 #include "media/ffmpeg/ffmpeg_common.h" |
| 21 #include "media/filters/ffmpeg_glue.h" | 22 #include "media/filters/ffmpeg_glue.h" |
| 22 | 23 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 171 |
| 171 ReleaseFFmpegResources(); | 172 ReleaseFFmpegResources(); |
| 172 state_ = kUninitialized; | 173 state_ = kUninitialized; |
| 173 closure.Run(); | 174 closure.Run(); |
| 174 } | 175 } |
| 175 | 176 |
| 176 const gfx::Size& FFmpegVideoDecoder::natural_size() { | 177 const gfx::Size& FFmpegVideoDecoder::natural_size() { |
| 177 return natural_size_; | 178 return natural_size_; |
| 178 } | 179 } |
| 179 | 180 |
| 180 void FFmpegVideoDecoder::set_decryptor(AesDecryptor* decryptor) { | 181 void FFmpegVideoDecoder::set_decryptor(Decryptor* decryptor) { |
| 181 DCHECK_EQ(state_, kUninitialized); | 182 DCHECK_EQ(state_, kUninitialized); |
| 182 decryptor_ = decryptor; | 183 decryptor_ = decryptor; |
| 183 } | 184 } |
| 184 | 185 |
| 185 FFmpegVideoDecoder::~FFmpegVideoDecoder() { | 186 FFmpegVideoDecoder::~FFmpegVideoDecoder() { |
| 186 ReleaseFFmpegResources(); | 187 ReleaseFFmpegResources(); |
| 187 } | 188 } |
| 188 | 189 |
| 189 void FFmpegVideoDecoder::DoRead(const ReadCB& read_cb) { | 190 void FFmpegVideoDecoder::DoRead(const ReadCB& read_cb) { |
| 190 DCHECK_EQ(MessageLoop::current(), message_loop_); | 191 DCHECK_EQ(MessageLoop::current(), message_loop_); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 scoped_refptr<VideoFrame> FFmpegVideoDecoder::AllocateVideoFrame() { | 433 scoped_refptr<VideoFrame> FFmpegVideoDecoder::AllocateVideoFrame() { |
| 433 VideoFrame::Format format = PixelFormatToVideoFormat(codec_context_->pix_fmt); | 434 VideoFrame::Format format = PixelFormatToVideoFormat(codec_context_->pix_fmt); |
| 434 size_t width = codec_context_->width; | 435 size_t width = codec_context_->width; |
| 435 size_t height = codec_context_->height; | 436 size_t height = codec_context_->height; |
| 436 | 437 |
| 437 return VideoFrame::CreateFrame(format, width, height, | 438 return VideoFrame::CreateFrame(format, width, height, |
| 438 kNoTimestamp(), kNoTimestamp()); | 439 kNoTimestamp(), kNoTimestamp()); |
| 439 } | 440 } |
| 440 | 441 |
| 441 } // namespace media | 442 } // namespace media |
| OLD | NEW |