OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Implements the Demuxer interface. DummyDemuxer returns corresponding | 5 // Implements the Demuxer interface. DummyDemuxer returns corresponding |
6 // DummyDemuxerStream as signal for media pipeline to construct correct | 6 // DummyDemuxerStream as signal for media pipeline to construct correct |
7 // playback channels. | 7 // playback channels. |
8 | 8 |
9 #ifndef MEDIA_FILTERS_DUMMY_DEMUXER_H_ | 9 #ifndef MEDIA_FILTERS_DUMMY_DEMUXER_H_ |
10 #define MEDIA_FILTERS_DUMMY_DEMUXER_H_ | 10 #define MEDIA_FILTERS_DUMMY_DEMUXER_H_ |
11 | 11 |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "media/base/audio_decoder_config.h" | 14 #include "media/base/audio_decoder_config.h" |
15 #include "media/base/demuxer.h" | 15 #include "media/base/demuxer.h" |
| 16 #include "media/base/video_decoder_config.h" |
16 | 17 |
17 namespace media { | 18 namespace media { |
18 | 19 |
19 class DummyDemuxerStream : public DemuxerStream { | 20 class DummyDemuxerStream : public DemuxerStream { |
20 public: | 21 public: |
21 explicit DummyDemuxerStream(Type type); | 22 explicit DummyDemuxerStream(Type type); |
22 | 23 |
23 // DemuxerStream implementation. | 24 // DemuxerStream implementation. |
24 virtual void Read(const ReadCallback& read_callback) OVERRIDE; | 25 virtual void Read(const ReadCallback& read_callback) OVERRIDE; |
25 virtual Type type() OVERRIDE; | 26 virtual Type type() OVERRIDE; |
26 virtual const AudioDecoderConfig& audio_decoder_config() OVERRIDE; | 27 virtual const AudioDecoderConfig& audio_decoder_config() OVERRIDE; |
| 28 virtual const VideoDecoderConfig& video_decoder_config() OVERRIDE; |
27 virtual void EnableBitstreamConverter() OVERRIDE; | 29 virtual void EnableBitstreamConverter() OVERRIDE; |
28 | 30 |
29 private: | 31 private: |
30 virtual ~DummyDemuxerStream(); | 32 virtual ~DummyDemuxerStream(); |
31 | 33 |
32 Type type_; | 34 Type type_; |
33 AudioDecoderConfig audio_config_; | 35 AudioDecoderConfig audio_config_; |
| 36 VideoDecoderConfig video_config_; |
34 | 37 |
35 DISALLOW_COPY_AND_ASSIGN(DummyDemuxerStream); | 38 DISALLOW_COPY_AND_ASSIGN(DummyDemuxerStream); |
36 }; | 39 }; |
37 | 40 |
38 class DummyDemuxer : public Demuxer { | 41 class DummyDemuxer : public Demuxer { |
39 public: | 42 public: |
40 DummyDemuxer(bool has_video, bool has_audio); | 43 DummyDemuxer(bool has_video, bool has_audio); |
41 virtual ~DummyDemuxer(); | 44 virtual ~DummyDemuxer(); |
42 | 45 |
43 // Demuxer implementation. | 46 // Demuxer implementation. |
44 virtual scoped_refptr<DemuxerStream> GetStream( | 47 virtual scoped_refptr<DemuxerStream> GetStream( |
45 DemuxerStream::Type type) OVERRIDE; | 48 DemuxerStream::Type type) OVERRIDE; |
46 virtual void SetPreload(Preload preload) OVERRIDE; | 49 virtual void SetPreload(Preload preload) OVERRIDE; |
47 virtual base::TimeDelta GetStartTime() const OVERRIDE; | 50 virtual base::TimeDelta GetStartTime() const OVERRIDE; |
48 | 51 |
49 private: | 52 private: |
50 bool has_video_; | 53 bool has_video_; |
51 bool has_audio_; | 54 bool has_audio_; |
52 std::vector< scoped_refptr<DummyDemuxerStream> > streams_; | 55 std::vector< scoped_refptr<DummyDemuxerStream> > streams_; |
53 | 56 |
54 DISALLOW_COPY_AND_ASSIGN(DummyDemuxer); | 57 DISALLOW_COPY_AND_ASSIGN(DummyDemuxer); |
55 }; | 58 }; |
56 | 59 |
57 } // namespace media | 60 } // namespace media |
58 | 61 |
59 #endif // MEDIA_FILTERS_DUMMY_DEMUXER_H_ | 62 #endif // MEDIA_FILTERS_DUMMY_DEMUXER_H_ |
OLD | NEW |