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/chunk_demuxer.h" | 5 #include "media/filters/chunk_demuxer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 } | 563 } |
564 | 564 |
565 cb.Run(status); | 565 cb.Run(status); |
566 } | 566 } |
567 | 567 |
568 void ChunkDemuxer::OnAudioRendererDisabled() { | 568 void ChunkDemuxer::OnAudioRendererDisabled() { |
569 base::AutoLock auto_lock(lock_); | 569 base::AutoLock auto_lock(lock_); |
570 audio_ = NULL; | 570 audio_ = NULL; |
571 } | 571 } |
572 | 572 |
573 int ChunkDemuxer::GetBitrate() { | |
574 // TODO(acolwell): Implement bitrate reporting. | |
575 return 0; | |
576 } | |
577 | |
578 // Demuxer implementation. | 573 // Demuxer implementation. |
579 scoped_refptr<DemuxerStream> ChunkDemuxer::GetStream( | 574 scoped_refptr<DemuxerStream> ChunkDemuxer::GetStream( |
580 DemuxerStream::Type type) { | 575 DemuxerStream::Type type) { |
581 if (type == DemuxerStream::VIDEO) | 576 if (type == DemuxerStream::VIDEO) |
582 return video_; | 577 return video_; |
583 | 578 |
584 if (type == DemuxerStream::AUDIO) | 579 if (type == DemuxerStream::AUDIO) |
585 return audio_; | 580 return audio_; |
586 | 581 |
587 return NULL; | 582 return NULL; |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 | 1150 |
1156 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const { | 1151 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const { |
1157 if (audio_ && !video_) | 1152 if (audio_ && !video_) |
1158 return audio_->GetBufferedRanges(duration_); | 1153 return audio_->GetBufferedRanges(duration_); |
1159 else if (!audio_ && video_) | 1154 else if (!audio_ && video_) |
1160 return video_->GetBufferedRanges(duration_); | 1155 return video_->GetBufferedRanges(duration_); |
1161 return ComputeIntersection(); | 1156 return ComputeIntersection(); |
1162 } | 1157 } |
1163 | 1158 |
1164 } // namespace media | 1159 } // namespace media |
OLD | NEW |