OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "media/filters/dummy_demuxer.h" | |
6 | |
7 #include "base/logging.h" | |
8 | |
9 namespace media { | |
10 | |
11 DummyDemuxerStream::DummyDemuxerStream(Type type) | |
12 : type_(type) { | |
13 } | |
14 | |
15 DummyDemuxerStream::~DummyDemuxerStream() {} | |
16 | |
17 DemuxerStream::Type DummyDemuxerStream::type() { | |
18 return type_; | |
19 } | |
20 | |
21 const AudioDecoderConfig& DummyDemuxerStream::audio_decoder_config() { | |
22 CHECK_EQ(type_, AUDIO); | |
23 return audio_config_; | |
24 } | |
25 | |
26 const VideoDecoderConfig& DummyDemuxerStream::video_decoder_config() { | |
27 CHECK_EQ(type_, VIDEO); | |
28 return video_config_; | |
29 } | |
30 | |
31 void DummyDemuxerStream::Read(const ReadCB& read_cb) {} | |
32 | |
33 void DummyDemuxerStream::EnableBitstreamConverter() {} | |
34 | |
35 DummyDemuxer::DummyDemuxer(bool has_video, bool has_audio) { | |
36 streams_.resize(DemuxerStream::NUM_TYPES); | |
37 if (has_audio) | |
38 streams_[DemuxerStream::AUDIO] = | |
39 new DummyDemuxerStream(DemuxerStream::AUDIO); | |
40 if (has_video) | |
41 streams_[DemuxerStream::VIDEO] = | |
42 new DummyDemuxerStream(DemuxerStream::VIDEO); | |
43 } | |
44 | |
45 void DummyDemuxer::Initialize(DemuxerHost* host, | |
46 const PipelineStatusCB& status_cb) { | |
47 host->SetDuration(media::kInfiniteDuration()); | |
48 status_cb.Run(PIPELINE_OK); | |
49 } | |
50 | |
51 scoped_refptr<DemuxerStream> DummyDemuxer::GetStream(DemuxerStream::Type type) { | |
52 return streams_[type]; | |
53 } | |
54 | |
55 base::TimeDelta DummyDemuxer::GetStartTime() const { | |
56 return base::TimeDelta(); | |
57 } | |
58 | |
59 DummyDemuxer::~DummyDemuxer() {} | |
60 | |
61 } // namespace media | |
OLD | NEW |