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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 void FFmpegDemuxer::Seek(base::TimeDelta time, const PipelineStatusCB& cb) { | 322 void FFmpegDemuxer::Seek(base::TimeDelta time, const PipelineStatusCB& cb) { |
323 message_loop_->PostTask(FROM_HERE, | 323 message_loop_->PostTask(FROM_HERE, |
324 base::Bind(&FFmpegDemuxer::SeekTask, this, time, cb)); | 324 base::Bind(&FFmpegDemuxer::SeekTask, this, time, cb)); |
325 } | 325 } |
326 | 326 |
327 void FFmpegDemuxer::SetPlaybackRate(float playback_rate) { | 327 void FFmpegDemuxer::SetPlaybackRate(float playback_rate) { |
328 DCHECK(data_source_.get()); | 328 DCHECK(data_source_.get()); |
329 data_source_->SetPlaybackRate(playback_rate); | 329 data_source_->SetPlaybackRate(playback_rate); |
330 } | 330 } |
331 | 331 |
332 void FFmpegDemuxer::SetPreload(Preload preload) { | |
333 DCHECK(data_source_.get()); | |
334 data_source_->SetPreload(preload); | |
335 } | |
336 | |
337 void FFmpegDemuxer::OnAudioRendererDisabled() { | 332 void FFmpegDemuxer::OnAudioRendererDisabled() { |
338 message_loop_->PostTask(FROM_HERE, base::Bind( | 333 message_loop_->PostTask(FROM_HERE, base::Bind( |
339 &FFmpegDemuxer::DisableAudioStreamTask, this)); | 334 &FFmpegDemuxer::DisableAudioStreamTask, this)); |
340 } | 335 } |
341 | 336 |
342 void FFmpegDemuxer::set_host(DemuxerHost* demuxer_host) { | 337 void FFmpegDemuxer::set_host(DemuxerHost* demuxer_host) { |
343 Demuxer::set_host(demuxer_host); | 338 Demuxer::set_host(demuxer_host); |
344 if (data_source_) | 339 if (data_source_) |
345 data_source_->set_host(demuxer_host); | 340 data_source_->set_host(demuxer_host); |
346 if (max_duration_.InMicroseconds() >= 0) | 341 if (max_duration_.InMicroseconds() >= 0) |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 read_event_.Wait(); | 736 read_event_.Wait(); |
742 return last_read_bytes_; | 737 return last_read_bytes_; |
743 } | 738 } |
744 | 739 |
745 void FFmpegDemuxer::SignalReadCompleted(size_t size) { | 740 void FFmpegDemuxer::SignalReadCompleted(size_t size) { |
746 last_read_bytes_ = size; | 741 last_read_bytes_ = size; |
747 read_event_.Signal(); | 742 read_event_.Signal(); |
748 } | 743 } |
749 | 744 |
750 } // namespace media | 745 } // namespace media |
OLD | NEW |