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 "media/filters/ffmpeg_demuxer.h" | 5 #include "media/filters/ffmpeg_demuxer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 CHECK(blocking_thread_.Start()); | 645 CHECK(blocking_thread_.Start()); |
646 base::PostTaskAndReplyWithResult( | 646 base::PostTaskAndReplyWithResult( |
647 blocking_thread_.message_loop_proxy().get(), | 647 blocking_thread_.message_loop_proxy().get(), |
648 FROM_HERE, | 648 FROM_HERE, |
649 base::Bind(&FFmpegGlue::OpenContext, base::Unretained(glue_.get())), | 649 base::Bind(&FFmpegGlue::OpenContext, base::Unretained(glue_.get())), |
650 base::Bind(&FFmpegDemuxer::OnOpenContextDone, | 650 base::Bind(&FFmpegDemuxer::OnOpenContextDone, |
651 weak_factory_.GetWeakPtr(), | 651 weak_factory_.GetWeakPtr(), |
652 status_cb)); | 652 status_cb)); |
653 } | 653 } |
654 | 654 |
| 655 base::Time FFmpegDemuxer::GetTimelineOffset() const { |
| 656 return timeline_offset_; |
| 657 } |
| 658 |
655 DemuxerStream* FFmpegDemuxer::GetStream(DemuxerStream::Type type) { | 659 DemuxerStream* FFmpegDemuxer::GetStream(DemuxerStream::Type type) { |
656 DCHECK(task_runner_->BelongsToCurrentThread()); | 660 DCHECK(task_runner_->BelongsToCurrentThread()); |
657 return GetFFmpegStream(type); | 661 return GetFFmpegStream(type); |
658 } | 662 } |
659 | 663 |
660 FFmpegDemuxerStream* FFmpegDemuxer::GetFFmpegStream( | 664 FFmpegDemuxerStream* FFmpegDemuxer::GetFFmpegStream( |
661 DemuxerStream::Type type) const { | 665 DemuxerStream::Type type) const { |
662 StreamVector::const_iterator iter; | 666 StreamVector::const_iterator iter; |
663 for (iter = streams_.begin(); iter != streams_.end(); ++iter) { | 667 for (iter = streams_.begin(); iter != streams_.end(); ++iter) { |
664 if (*iter && (*iter)->type() == type) { | 668 if (*iter && (*iter)->type() == type) { |
665 return *iter; | 669 return *iter; |
666 } | 670 } |
667 } | 671 } |
668 return NULL; | 672 return NULL; |
669 } | 673 } |
670 | 674 |
671 base::Time FFmpegDemuxer::GetTimelineOffset() const { | |
672 return timeline_offset_; | |
673 } | |
674 | |
675 Demuxer::Liveness FFmpegDemuxer::GetLiveness() const { | 675 Demuxer::Liveness FFmpegDemuxer::GetLiveness() const { |
676 DCHECK(task_runner_->BelongsToCurrentThread()); | 676 DCHECK(task_runner_->BelongsToCurrentThread()); |
677 return liveness_; | 677 return liveness_; |
678 } | 678 } |
679 | 679 |
680 void FFmpegDemuxer::AddTextStreams() { | 680 void FFmpegDemuxer::AddTextStreams() { |
681 DCHECK(task_runner_->BelongsToCurrentThread()); | 681 DCHECK(task_runner_->BelongsToCurrentThread()); |
682 | 682 |
683 for (StreamVector::size_type idx = 0; idx < streams_.size(); ++idx) { | 683 for (StreamVector::size_type idx = 0; idx < streams_.size(); ++idx) { |
684 FFmpegDemuxerStream* stream = streams_[idx]; | 684 FFmpegDemuxerStream* stream = streams_[idx]; |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 } | 1230 } |
1231 for (size_t i = 0; i < buffered.size(); ++i) | 1231 for (size_t i = 0; i < buffered.size(); ++i) |
1232 host_->AddBufferedTimeRange(buffered.start(i), buffered.end(i)); | 1232 host_->AddBufferedTimeRange(buffered.start(i), buffered.end(i)); |
1233 } | 1233 } |
1234 | 1234 |
1235 void FFmpegDemuxer::OnDataSourceError() { | 1235 void FFmpegDemuxer::OnDataSourceError() { |
1236 host_->OnDemuxerError(PIPELINE_ERROR_READ); | 1236 host_->OnDemuxerError(PIPELINE_ERROR_READ); |
1237 } | 1237 } |
1238 | 1238 |
1239 } // namespace media | 1239 } // namespace media |
OLD | NEW |