OLD | NEW |
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/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 303 |
304 void FFmpegDemuxer::Seek(base::TimeDelta time, FilterCallback* callback) { | 304 void FFmpegDemuxer::Seek(base::TimeDelta time, FilterCallback* callback) { |
305 // TODO(hclam): by returning from this method, it is assumed that the seek | 305 // TODO(hclam): by returning from this method, it is assumed that the seek |
306 // operation is completed and filters behind the demuxer is good to issue | 306 // operation is completed and filters behind the demuxer is good to issue |
307 // more reads, but we are posting a task here, which makes the seek operation | 307 // more reads, but we are posting a task here, which makes the seek operation |
308 // asynchronous, should change how seek works to make it fully asynchronous. | 308 // asynchronous, should change how seek works to make it fully asynchronous. |
309 message_loop_->PostTask(FROM_HERE, | 309 message_loop_->PostTask(FROM_HERE, |
310 NewRunnableMethod(this, &FFmpegDemuxer::SeekTask, time, callback)); | 310 NewRunnableMethod(this, &FFmpegDemuxer::SeekTask, time, callback)); |
311 } | 311 } |
312 | 312 |
| 313 void FFmpegDemuxer::SetPlaybackRate(float playback_rate) { |
| 314 DCHECK(data_source_.get()); |
| 315 data_source_->SetPlaybackRate(playback_rate); |
| 316 } |
| 317 |
| 318 void FFmpegDemuxer::SetPreload(Preload preload) { |
| 319 DCHECK(data_source_.get()); |
| 320 data_source_->SetPreload(preload); |
| 321 } |
| 322 |
313 void FFmpegDemuxer::OnAudioRendererDisabled() { | 323 void FFmpegDemuxer::OnAudioRendererDisabled() { |
314 message_loop_->PostTask(FROM_HERE, | 324 message_loop_->PostTask(FROM_HERE, |
315 NewRunnableMethod(this, &FFmpegDemuxer::DisableAudioStreamTask)); | 325 NewRunnableMethod(this, &FFmpegDemuxer::DisableAudioStreamTask)); |
316 } | 326 } |
317 | 327 |
318 void FFmpegDemuxer::set_host(FilterHost* filter_host) { | 328 void FFmpegDemuxer::set_host(FilterHost* filter_host) { |
319 Demuxer::set_host(filter_host); | 329 Demuxer::set_host(filter_host); |
320 if (data_source_) | 330 if (data_source_) |
321 data_source_->set_host(filter_host); | 331 data_source_->set_host(filter_host); |
322 if (max_duration_.InMicroseconds() >= 0) | 332 if (max_duration_.InMicroseconds() >= 0) |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 read_event_.Wait(); | 660 read_event_.Wait(); |
651 return last_read_bytes_; | 661 return last_read_bytes_; |
652 } | 662 } |
653 | 663 |
654 void FFmpegDemuxer::SignalReadCompleted(size_t size) { | 664 void FFmpegDemuxer::SignalReadCompleted(size_t size) { |
655 last_read_bytes_ = size; | 665 last_read_bytes_ = size; |
656 read_event_.Signal(); | 666 read_event_.Signal(); |
657 } | 667 } |
658 | 668 |
659 } // namespace media | 669 } // namespace media |
OLD | NEW |