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( | 313 message_loop()->PostTask(FROM_HERE, |
314 FROM_HERE, | 314 NewRunnableMethod(this, &FFmpegDemuxer::InitializeTask, data_source, |
315 NewRunnableMethod(this, | |
316 &FFmpegDemuxer::InitializeTask, | |
317 make_scoped_refptr(data_source), | |
318 callback)); | 315 callback)); |
319 } | 316 } |
320 | 317 |
321 size_t FFmpegDemuxer::GetNumberOfStreams() { | 318 size_t FFmpegDemuxer::GetNumberOfStreams() { |
322 return streams_.size(); | 319 return streams_.size(); |
323 } | 320 } |
324 | 321 |
325 scoped_refptr<DemuxerStream> FFmpegDemuxer::GetStream(int stream) { | 322 scoped_refptr<DemuxerStream> FFmpegDemuxer::GetStream(int stream) { |
326 DCHECK_GE(stream, 0); | 323 DCHECK_GE(stream, 0); |
327 DCHECK_LT(stream, static_cast<int>(streams_.size())); | 324 DCHECK_LT(stream, static_cast<int>(streams_.size())); |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 read_event_.Wait(); | 608 read_event_.Wait(); |
612 return last_read_bytes_; | 609 return last_read_bytes_; |
613 } | 610 } |
614 | 611 |
615 void FFmpegDemuxer::SignalReadCompleted(size_t size) { | 612 void FFmpegDemuxer::SignalReadCompleted(size_t size) { |
616 last_read_bytes_ = size; | 613 last_read_bytes_ = size; |
617 read_event_.Signal(); | 614 read_event_.Signal(); |
618 } | 615 } |
619 | 616 |
620 } // namespace media | 617 } // namespace media |
OLD | NEW |