OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_REMOTING_FAKE_MEDIA_RESOURCE_H_ | 5 #ifndef MEDIA_REMOTING_FAKE_MEDIA_RESOURCE_H_ |
6 #define MEDIA_REMOTING_FAKE_MEDIA_RESOURCE_H_ | 6 #define MEDIA_REMOTING_FAKE_MEDIA_RESOURCE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "media/base/audio_decoder_config.h" | 10 #include "media/base/audio_decoder_config.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 void FakeRead(const ReadCB& read_cb); | 26 void FakeRead(const ReadCB& read_cb); |
27 AudioDecoderConfig audio_decoder_config() override; | 27 AudioDecoderConfig audio_decoder_config() override; |
28 VideoDecoderConfig video_decoder_config() override; | 28 VideoDecoderConfig video_decoder_config() override; |
29 Type type() const override; | 29 Type type() const override; |
30 Liveness liveness() const override; | 30 Liveness liveness() const override; |
31 void EnableBitstreamConverter() override {} | 31 void EnableBitstreamConverter() override {} |
32 bool SupportsConfigChanges() override; | 32 bool SupportsConfigChanges() override; |
33 VideoRotation video_rotation() override; | 33 VideoRotation video_rotation() override; |
34 bool enabled() const override; | 34 bool enabled() const override; |
35 void set_enabled(bool enabled, base::TimeDelta timestamp) override {} | 35 void set_enabled(bool enabled, base::TimeDelta timestamp) override {} |
36 void SetStreamStatusChangeCB(const StreamStatusChangeCB& cb) override {} | |
37 | 36 |
38 void CreateFakeFrame(size_t size, bool key_frame, int pts_ms); | 37 void CreateFakeFrame(size_t size, bool key_frame, int pts_ms); |
39 | 38 |
40 private: | 39 private: |
41 using BufferQueue = std::deque<scoped_refptr<DecoderBuffer>>; | 40 using BufferQueue = std::deque<scoped_refptr<DecoderBuffer>>; |
42 BufferQueue buffer_queue_; | 41 BufferQueue buffer_queue_; |
43 ReadCB pending_read_cb_; | 42 ReadCB pending_read_cb_; |
44 Type type_; | 43 Type type_; |
45 AudioDecoderConfig audio_config_; | 44 AudioDecoderConfig audio_config_; |
46 VideoDecoderConfig video_config_; | 45 VideoDecoderConfig video_config_; |
47 | 46 |
48 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStream); | 47 DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStream); |
49 }; | 48 }; |
50 | 49 |
51 // Audio only demuxer stream provider | 50 // Audio only demuxer stream provider |
52 class FakeMediaResource : public MediaResource { | 51 class FakeMediaResource : public MediaResource { |
53 public: | 52 public: |
54 FakeMediaResource(); | 53 FakeMediaResource(); |
55 ~FakeMediaResource() final; | 54 ~FakeMediaResource() final; |
56 | 55 |
57 // MediaResource implementation. | 56 // MediaResource implementation. |
58 DemuxerStream* GetStream(DemuxerStream::Type type) override; | 57 std::vector<DemuxerStream*> GetStreams() override; |
| 58 void SetStreamStatusChangeCB(const StreamStatusChangeCB& cb) override; |
59 | 59 |
60 private: | 60 private: |
61 std::unique_ptr<FakeDemuxerStream> demuxer_stream_; | 61 std::unique_ptr<FakeDemuxerStream> demuxer_stream_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(FakeMediaResource); | 63 DISALLOW_COPY_AND_ASSIGN(FakeMediaResource); |
64 }; | 64 }; |
65 | 65 |
66 } // namespace remoting | 66 } // namespace remoting |
67 } // namespace media | 67 } // namespace media |
68 | 68 |
69 #endif // MEDIA_REMOTING_FAKE_MEDIA_RESOURCE_H_ | 69 #endif // MEDIA_REMOTING_FAKE_MEDIA_RESOURCE_H_ |
OLD | NEW |