| 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" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 // DemuxerStream implementation. | 31 // DemuxerStream implementation. |
| 32 void Read(const ReadCB& read_cb) override; | 32 void Read(const ReadCB& read_cb) override; |
| 33 AudioDecoderConfig audio_decoder_config() override; | 33 AudioDecoderConfig audio_decoder_config() override; |
| 34 VideoDecoderConfig video_decoder_config() override; | 34 VideoDecoderConfig video_decoder_config() override; |
| 35 Type type() const override; | 35 Type type() const override; |
| 36 bool SupportsConfigChanges() override; | 36 bool SupportsConfigChanges() override; |
| 37 VideoRotation video_rotation() override; | 37 VideoRotation video_rotation() override; |
| 38 bool enabled() const override; | 38 bool enabled() const override; |
| 39 void set_enabled(bool enabled, base::TimeDelta timestamp) override; | 39 void set_enabled(bool enabled, base::TimeDelta timestamp) override; |
| 40 void SetStreamStatusChangeCB(const StreamStatusChangeCB& cb) override; | |
| 41 | 40 |
| 42 void Initialize(); | 41 void Initialize(); |
| 43 | 42 |
| 44 int num_buffers_returned() const { return num_buffers_returned_; } | 43 int num_buffers_returned() const { return num_buffers_returned_; } |
| 45 | 44 |
| 46 // Upon the next read, holds the read callback until SatisfyRead() or Reset() | 45 // Upon the next read, holds the read callback until SatisfyRead() or Reset() |
| 47 // is called. | 46 // is called. |
| 48 void HoldNextRead(); | 47 void HoldNextRead(); |
| 49 | 48 |
| 50 // Upon the next config change read, holds the read callback until | 49 // Upon the next config change read, holds the read callback until |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 104 |
| 106 class FakeMediaResource : public MediaResource { | 105 class FakeMediaResource : public MediaResource { |
| 107 public: | 106 public: |
| 108 // Note: FakeDemuxerStream currently only supports a fake video DemuxerStream. | 107 // Note: FakeDemuxerStream currently only supports a fake video DemuxerStream. |
| 109 FakeMediaResource(int num_video_configs, | 108 FakeMediaResource(int num_video_configs, |
| 110 int num_video_buffers_in_one_config, | 109 int num_video_buffers_in_one_config, |
| 111 bool is_video_encrypted); | 110 bool is_video_encrypted); |
| 112 ~FakeMediaResource() override; | 111 ~FakeMediaResource() override; |
| 113 | 112 |
| 114 // MediaResource implementation. | 113 // MediaResource implementation. |
| 115 DemuxerStream* GetStream(DemuxerStream::Type type) override; | 114 std::vector<DemuxerStream*> GetStreams() override; |
| 115 void SetStreamStatusChangeCB(const StreamStatusChangeCB& cb) override; |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 FakeDemuxerStream fake_video_stream_; | 118 FakeDemuxerStream fake_video_stream_; |
| 119 | 119 |
| 120 DISALLOW_COPY_AND_ASSIGN(FakeMediaResource); | 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 |