OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef MEDIA_BASE_FAKE_DEMUXER_STREAM_H_ | 5 #ifndef MEDIA_BASE_FAKE_DEMUXER_STREAM_H_ |
6 #define MEDIA_BASE_FAKE_DEMUXER_STREAM_H_ | 6 #define MEDIA_BASE_FAKE_DEMUXER_STREAM_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "media/base/audio_decoder_config.h" | 10 #include "media/base/audio_decoder_config.h" |
11 #include "media/base/demuxer_stream.h" | 11 #include "media/base/demuxer_stream.h" |
12 #include "media/base/demuxer_stream_provider.h" | 12 #include "media/base/media_resource.h" |
13 #include "media/base/video_decoder_config.h" | 13 #include "media/base/video_decoder_config.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
17 } // namespace base | 17 } // namespace base |
18 | 18 |
19 namespace media { | 19 namespace media { |
20 | 20 |
21 class FakeDemuxerStream : public DemuxerStream { | 21 class FakeDemuxerStream : public DemuxerStream { |
22 public: | 22 public: |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 ReadCB read_cb_; | 96 ReadCB read_cb_; |
97 | 97 |
98 int next_read_num_; | 98 int next_read_num_; |
99 // Zero-based number indicating which read operation should be held. -1 means | 99 // Zero-based number indicating which read operation should be held. -1 means |
100 // no read shall be held. | 100 // no read shall be held. |
101 int read_to_hold_; | 101 int read_to_hold_; |
102 | 102 |
103 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStream); | 103 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStream); |
104 }; | 104 }; |
105 | 105 |
106 class FakeDemuxerStreamProvider : public DemuxerStreamProvider { | 106 class FakeMediaResource : public MediaResource { |
107 public: | 107 public: |
108 // Note: FakeDemuxerStream currently only supports a fake video DemuxerStream. | 108 // Note: FakeDemuxerStream currently only supports a fake video DemuxerStream. |
109 FakeDemuxerStreamProvider(int num_video_configs, | 109 FakeMediaResource(int num_video_configs, |
110 int num_video_buffers_in_one_config, | 110 int num_video_buffers_in_one_config, |
111 bool is_video_encrypted); | 111 bool is_video_encrypted); |
112 ~FakeDemuxerStreamProvider() override; | 112 ~FakeMediaResource() override; |
113 | 113 |
114 // DemuxerStreamProvider implementation. | 114 // MediaResource implementation. |
115 DemuxerStream* GetStream(DemuxerStream::Type type) override; | 115 std::vector<DemuxerStream*> GetStreams() override; |
116 | 116 |
117 private: | 117 private: |
118 FakeDemuxerStream fake_video_stream_; | 118 FakeDemuxerStream fake_video_stream_; |
119 | 119 |
120 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStreamProvider); | 120 DISALLOW_COPY_AND_ASSIGN(FakeMediaResource); |
121 }; | 121 }; |
122 | 122 |
123 } // namespace media | 123 } // namespace media |
124 | 124 |
125 #endif // MEDIA_BASE_FAKE_DEMUXER_STREAM_H_ | 125 #endif // MEDIA_BASE_FAKE_DEMUXER_STREAM_H_ |
OLD | NEW |