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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 message_loop_->PostTask(FROM_HERE, base::Bind( | 132 message_loop_->PostTask(FROM_HERE, base::Bind( |
133 &FFmpegVideoDecoder::Stop, this, callback)); | 133 &FFmpegVideoDecoder::Stop, this, callback)); |
134 return; | 134 return; |
135 } | 135 } |
136 | 136 |
137 ReleaseFFmpegResources(); | 137 ReleaseFFmpegResources(); |
138 state_ = kUninitialized; | 138 state_ = kUninitialized; |
139 callback.Run(); | 139 callback.Run(); |
140 } | 140 } |
141 | 141 |
142 void FFmpegVideoDecoder::Seek(base::TimeDelta time, const FilterStatusCB& cb) { | 142 void FFmpegVideoDecoder::Seek(base::TimeDelta time, |
| 143 const PipelineStatusCB& cb) { |
143 if (MessageLoop::current() != message_loop_) { | 144 if (MessageLoop::current() != message_loop_) { |
144 message_loop_->PostTask(FROM_HERE, base::Bind( | 145 message_loop_->PostTask(FROM_HERE, base::Bind( |
145 &FFmpegVideoDecoder::Seek, this, time, cb)); | 146 &FFmpegVideoDecoder::Seek, this, time, cb)); |
146 return; | 147 return; |
147 } | 148 } |
148 | 149 |
149 cb.Run(PIPELINE_OK); | 150 cb.Run(PIPELINE_OK); |
150 } | 151 } |
151 | 152 |
152 void FFmpegVideoDecoder::Pause(const base::Closure& callback) { | 153 void FFmpegVideoDecoder::Pause(const base::Closure& callback) { |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 scoped_refptr<VideoFrame> FFmpegVideoDecoder::AllocateVideoFrame() { | 440 scoped_refptr<VideoFrame> FFmpegVideoDecoder::AllocateVideoFrame() { |
440 VideoFrame::Format format = PixelFormatToVideoFormat(codec_context_->pix_fmt); | 441 VideoFrame::Format format = PixelFormatToVideoFormat(codec_context_->pix_fmt); |
441 size_t width = codec_context_->width; | 442 size_t width = codec_context_->width; |
442 size_t height = codec_context_->height; | 443 size_t height = codec_context_->height; |
443 | 444 |
444 return VideoFrame::CreateFrame(format, width, height, | 445 return VideoFrame::CreateFrame(format, width, height, |
445 kNoTimestamp(), kNoTimestamp()); | 446 kNoTimestamp(), kNoTimestamp()); |
446 } | 447 } |
447 | 448 |
448 } // namespace media | 449 } // namespace media |
OLD | NEW |