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

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

Issue 6625059: Implementing preload=metadata for video (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indent Created 9 years, 8 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.h ('k') | media/filters/file_data_source.h » ('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 "base/callback.h" 5 #include "base/callback.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/stl_util-inl.h" 9 #include "base/stl_util-inl.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 294
295 void FFmpegDemuxer::Seek(base::TimeDelta time, FilterCallback* callback) { 295 void FFmpegDemuxer::Seek(base::TimeDelta time, FilterCallback* callback) {
296 // TODO(hclam): by returning from this method, it is assumed that the seek 296 // TODO(hclam): by returning from this method, it is assumed that the seek
297 // operation is completed and filters behind the demuxer is good to issue 297 // operation is completed and filters behind the demuxer is good to issue
298 // more reads, but we are posting a task here, which makes the seek operation 298 // more reads, but we are posting a task here, which makes the seek operation
299 // asynchronous, should change how seek works to make it fully asynchronous. 299 // asynchronous, should change how seek works to make it fully asynchronous.
300 message_loop_->PostTask(FROM_HERE, 300 message_loop_->PostTask(FROM_HERE,
301 NewRunnableMethod(this, &FFmpegDemuxer::SeekTask, time, callback)); 301 NewRunnableMethod(this, &FFmpegDemuxer::SeekTask, time, callback));
302 } 302 }
303 303
304 void FFmpegDemuxer::SetPlaybackRate(float playback_rate) {
305 DCHECK(data_source_.get());
306 data_source_->SetPlaybackRate(playback_rate);
307 }
308
309 void FFmpegDemuxer::SetPreload(Preload preload) {
310 DCHECK(data_source_.get());
311 data_source_->SetPreload(preload);
312 }
313
304 void FFmpegDemuxer::OnAudioRendererDisabled() { 314 void FFmpegDemuxer::OnAudioRendererDisabled() {
305 message_loop_->PostTask(FROM_HERE, 315 message_loop_->PostTask(FROM_HERE,
306 NewRunnableMethod(this, &FFmpegDemuxer::DisableAudioStreamTask)); 316 NewRunnableMethod(this, &FFmpegDemuxer::DisableAudioStreamTask));
307 } 317 }
308 318
309 void FFmpegDemuxer::set_host(FilterHost* filter_host) { 319 void FFmpegDemuxer::set_host(FilterHost* filter_host) {
310 Demuxer::set_host(filter_host); 320 Demuxer::set_host(filter_host);
311 if (data_source_) 321 if (data_source_)
312 data_source_->set_host(filter_host); 322 data_source_->set_host(filter_host);
313 if (max_duration_.InMicroseconds() >= 0) 323 if (max_duration_.InMicroseconds() >= 0)
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 read_event_.Wait(); 651 read_event_.Wait();
642 return last_read_bytes_; 652 return last_read_bytes_;
643 } 653 }
644 654
645 void FFmpegDemuxer::SignalReadCompleted(size_t size) { 655 void FFmpegDemuxer::SignalReadCompleted(size_t size) {
646 last_read_bytes_ = size; 656 last_read_bytes_ = size;
647 read_event_.Signal(); 657 read_event_.Signal();
648 } 658 }
649 659
650 } // namespace media 660 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_demuxer.h ('k') | media/filters/file_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698