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" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 166 |
167 ReleaseFFmpegResources(); | 167 ReleaseFFmpegResources(); |
168 state_ = kUninitialized; | 168 state_ = kUninitialized; |
169 closure.Run(); | 169 closure.Run(); |
170 } | 170 } |
171 | 171 |
172 const gfx::Size& FFmpegVideoDecoder::natural_size() { | 172 const gfx::Size& FFmpegVideoDecoder::natural_size() { |
173 return natural_size_; | 173 return natural_size_; |
174 } | 174 } |
175 | 175 |
176 void FFmpegVideoDecoder::set_decryptor(AesDecryptor* decryptor) { | 176 void FFmpegVideoDecoder::set_decryptor(Decryptor* decryptor) { |
177 DCHECK_EQ(state_, kUninitialized); | 177 DCHECK_EQ(state_, kUninitialized); |
178 decryptor_ = decryptor; | 178 decryptor_ = decryptor; |
179 } | 179 } |
180 | 180 |
181 FFmpegVideoDecoder::~FFmpegVideoDecoder() { | 181 FFmpegVideoDecoder::~FFmpegVideoDecoder() { |
182 ReleaseFFmpegResources(); | 182 ReleaseFFmpegResources(); |
183 } | 183 } |
184 | 184 |
185 void FFmpegVideoDecoder::DoRead(const ReadCB& read_cb) { | 185 void FFmpegVideoDecoder::DoRead(const ReadCB& read_cb) { |
186 DCHECK_EQ(MessageLoop::current(), message_loop_); | 186 DCHECK_EQ(MessageLoop::current(), message_loop_); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 scoped_refptr<VideoFrame> FFmpegVideoDecoder::AllocateVideoFrame() { | 425 scoped_refptr<VideoFrame> FFmpegVideoDecoder::AllocateVideoFrame() { |
426 VideoFrame::Format format = PixelFormatToVideoFormat(codec_context_->pix_fmt); | 426 VideoFrame::Format format = PixelFormatToVideoFormat(codec_context_->pix_fmt); |
427 size_t width = codec_context_->width; | 427 size_t width = codec_context_->width; |
428 size_t height = codec_context_->height; | 428 size_t height = codec_context_->height; |
429 | 429 |
430 return VideoFrame::CreateFrame(format, width, height, | 430 return VideoFrame::CreateFrame(format, width, height, |
431 kNoTimestamp(), kNoTimestamp()); | 431 kNoTimestamp(), kNoTimestamp()); |
432 } | 432 } |
433 | 433 |
434 } // namespace media | 434 } // namespace media |
OLD | NEW |