| 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(HmacAesDecryptor* 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 scoped_refptr<VideoFrame> FFmpegVideoDecoder::AllocateVideoFrame() { | 428 scoped_refptr<VideoFrame> FFmpegVideoDecoder::AllocateVideoFrame() { |
| 429 VideoFrame::Format format = PixelFormatToVideoFormat(codec_context_->pix_fmt); | 429 VideoFrame::Format format = PixelFormatToVideoFormat(codec_context_->pix_fmt); |
| 430 size_t width = codec_context_->width; | 430 size_t width = codec_context_->width; |
| 431 size_t height = codec_context_->height; | 431 size_t height = codec_context_->height; |
| 432 | 432 |
| 433 return VideoFrame::CreateFrame(format, width, height, | 433 return VideoFrame::CreateFrame(format, width, height, |
| 434 kNoTimestamp(), kNoTimestamp()); | 434 kNoTimestamp(), kNoTimestamp()); |
| 435 } | 435 } |
| 436 | 436 |
| 437 } // namespace media | 437 } // namespace media |
| OLD | NEW |