| 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/dummy_demuxer.h" | 5 #include "media/filters/dummy_demuxer.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace media { | 9 namespace media { |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 if (has_audio) | 40 if (has_audio) |
| 41 streams_[DemuxerStream::AUDIO] = | 41 streams_[DemuxerStream::AUDIO] = |
| 42 new DummyDemuxerStream(DemuxerStream::AUDIO); | 42 new DummyDemuxerStream(DemuxerStream::AUDIO); |
| 43 if (has_video) | 43 if (has_video) |
| 44 streams_[DemuxerStream::VIDEO] = | 44 streams_[DemuxerStream::VIDEO] = |
| 45 new DummyDemuxerStream(DemuxerStream::VIDEO); | 45 new DummyDemuxerStream(DemuxerStream::VIDEO); |
| 46 } | 46 } |
| 47 | 47 |
| 48 DummyDemuxer::~DummyDemuxer() {} | 48 DummyDemuxer::~DummyDemuxer() {} |
| 49 | 49 |
| 50 void DummyDemuxer::Initialize(const PipelineStatusCB& status_cb) { | 50 void DummyDemuxer::Initialize(DemuxerHost* host, |
| 51 const PipelineStatusCB& status_cb) { |
| 52 host->SetDuration(media::kInfiniteDuration()); |
| 51 status_cb.Run(PIPELINE_OK); | 53 status_cb.Run(PIPELINE_OK); |
| 52 } | 54 } |
| 53 | 55 |
| 54 scoped_refptr<DemuxerStream> DummyDemuxer::GetStream(DemuxerStream::Type type) { | 56 scoped_refptr<DemuxerStream> DummyDemuxer::GetStream(DemuxerStream::Type type) { |
| 55 return streams_[type]; | 57 return streams_[type]; |
| 56 } | 58 } |
| 57 | 59 |
| 58 void DummyDemuxer::set_host(DemuxerHost* demuxer_host) { | |
| 59 Demuxer::set_host(demuxer_host); | |
| 60 host()->SetDuration(media::kInfiniteDuration()); | |
| 61 } | |
| 62 | |
| 63 base::TimeDelta DummyDemuxer::GetStartTime() const { | 60 base::TimeDelta DummyDemuxer::GetStartTime() const { |
| 64 return base::TimeDelta(); | 61 return base::TimeDelta(); |
| 65 } | 62 } |
| 66 | 63 |
| 67 int DummyDemuxer::GetBitrate() { | 64 int DummyDemuxer::GetBitrate() { |
| 68 return 0; | 65 return 0; |
| 69 } | 66 } |
| 70 | 67 |
| 71 bool DummyDemuxer::IsLocalSource() { | 68 bool DummyDemuxer::IsLocalSource() { |
| 72 return local_source_; | 69 return local_source_; |
| 73 } | 70 } |
| 74 | 71 |
| 75 bool DummyDemuxer::IsSeekable() { | 72 bool DummyDemuxer::IsSeekable() { |
| 76 // This is always false because DummyDemuxer is only used by WebRTC and such | 73 // This is always false because DummyDemuxer is only used by WebRTC and such |
| 77 // streams are not seekable. | 74 // streams are not seekable. |
| 78 return false; | 75 return false; |
| 79 } | 76 } |
| 80 | 77 |
| 81 } // namespace media | 78 } // namespace media |
| OLD | NEW |