OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 NewRunnableMethod(this, &FFmpegDemuxer::SeekTask, time, callback)); | 303 NewRunnableMethod(this, &FFmpegDemuxer::SeekTask, time, callback)); |
304 } | 304 } |
305 | 305 |
306 void FFmpegDemuxer::OnAudioRendererDisabled() { | 306 void FFmpegDemuxer::OnAudioRendererDisabled() { |
307 message_loop()->PostTask(FROM_HERE, | 307 message_loop()->PostTask(FROM_HERE, |
308 NewRunnableMethod(this, &FFmpegDemuxer::DisableAudioStreamTask)); | 308 NewRunnableMethod(this, &FFmpegDemuxer::DisableAudioStreamTask)); |
309 } | 309 } |
310 | 310 |
311 void FFmpegDemuxer::Initialize(DataSource* data_source, | 311 void FFmpegDemuxer::Initialize(DataSource* data_source, |
312 FilterCallback* callback) { | 312 FilterCallback* callback) { |
313 message_loop()->PostTask(FROM_HERE, | 313 message_loop()->PostTask( |
314 NewRunnableMethod(this, &FFmpegDemuxer::InitializeTask, data_source, | 314 FROM_HERE, |
| 315 NewRunnableMethod(this, |
| 316 &FFmpegDemuxer::InitializeTask, |
| 317 make_scoped_refptr(data_source), |
315 callback)); | 318 callback)); |
316 } | 319 } |
317 | 320 |
318 size_t FFmpegDemuxer::GetNumberOfStreams() { | 321 size_t FFmpegDemuxer::GetNumberOfStreams() { |
319 return streams_.size(); | 322 return streams_.size(); |
320 } | 323 } |
321 | 324 |
322 scoped_refptr<DemuxerStream> FFmpegDemuxer::GetStream(int stream) { | 325 scoped_refptr<DemuxerStream> FFmpegDemuxer::GetStream(int stream) { |
323 DCHECK_GE(stream, 0); | 326 DCHECK_GE(stream, 0); |
324 DCHECK_LT(stream, static_cast<int>(streams_.size())); | 327 DCHECK_LT(stream, static_cast<int>(streams_.size())); |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 read_event_.Wait(); | 611 read_event_.Wait(); |
609 return last_read_bytes_; | 612 return last_read_bytes_; |
610 } | 613 } |
611 | 614 |
612 void FFmpegDemuxer::SignalReadCompleted(size_t size) { | 615 void FFmpegDemuxer::SignalReadCompleted(size_t size) { |
613 last_read_bytes_ = size; | 616 last_read_bytes_ = size; |
614 read_event_.Signal(); | 617 read_event_.Signal(); |
615 } | 618 } |
616 | 619 |
617 } // namespace media | 620 } // namespace media |
OLD | NEW |