Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(405)

Side by Side Diff: media/filters/ffmpeg_video_decoder.cc

Issue 8294027: Merge r104540 into 874 (m15). (Closed) Base URL: svn://svn.chromium.org/chrome/branches/874/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/filters/ffmpeg_demuxer.cc ('k') | media/filters/video_renderer_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/task.h" 10 #include "base/task.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 pts_stream_.EnqueuePts(buffer.get()); 263 pts_stream_.EnqueuePts(buffer.get());
264 } 264 }
265 265
266 // Otherwise, attempt to decode a single frame. 266 // Otherwise, attempt to decode a single frame.
267 decode_engine_->ConsumeVideoSample(buffer); 267 decode_engine_->ConsumeVideoSample(buffer);
268 } 268 }
269 269
270 void FFmpegVideoDecoder::ProduceVideoFrame( 270 void FFmpegVideoDecoder::ProduceVideoFrame(
271 scoped_refptr<VideoFrame> video_frame) { 271 scoped_refptr<VideoFrame> video_frame) {
272 if (MessageLoop::current() != message_loop_) { 272 if (MessageLoop::current() != message_loop_) {
273 message_loop_->PostTask( 273 if (state_ != kStopped) {
274 FROM_HERE, 274 message_loop_->PostTask(
275 NewRunnableMethod(this, 275 FROM_HERE,
276 &FFmpegVideoDecoder::ProduceVideoFrame, video_frame)); 276 NewRunnableMethod(this,
277 &FFmpegVideoDecoder::ProduceVideoFrame,
278 video_frame));
279 }
277 return; 280 return;
278 } 281 }
279 282
280 DCHECK_EQ(MessageLoop::current(), message_loop_); 283 DCHECK_EQ(MessageLoop::current(), message_loop_);
281 284
282 // Synchronized flushing before stop should prevent this. 285 // Synchronized flushing before stop should prevent this.
283 DCHECK_NE(state_, kStopped); 286 DCHECK_NE(state_, kStopped);
284 287
285 // If the decoding is finished, we just always return empty frames. 288 // If the decoding is finished, we just always return empty frames.
286 if (state_ == kDecodeFinished) { 289 if (state_ == kDecodeFinished) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 decode_engine_->ProduceVideoFrame(video_frame); 361 decode_engine_->ProduceVideoFrame(video_frame);
359 } 362 }
360 } 363 }
361 364
362 void FFmpegVideoDecoder::SetVideoDecodeEngineForTest( 365 void FFmpegVideoDecoder::SetVideoDecodeEngineForTest(
363 VideoDecodeEngine* engine) { 366 VideoDecodeEngine* engine) {
364 decode_engine_.reset(engine); 367 decode_engine_.reset(engine);
365 } 368 }
366 369
367 } // namespace media 370 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_demuxer.cc ('k') | media/filters/video_renderer_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698