| 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 CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_REGISTRY_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_REGISTRY_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_REGISTRY_H_ | 6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/optional.h" | 10 #include "base/optional.h" |
| 11 #include "content/renderer/media/media_stream_registry_interface.h" | 11 #include "content/renderer/media/media_stream_registry_interface.h" |
| 12 | 12 |
| 13 namespace blink { | |
| 14 class WebMediaConstraints; | |
| 15 } | |
| 16 | |
| 17 namespace content { | 13 namespace content { |
| 18 | 14 |
| 19 struct VideoTrackAdapterSettings; | 15 struct VideoTrackAdapterSettings; |
| 20 | 16 |
| 21 // This class encapsulates creation of a Blink MediaStream having inside the | 17 // This class encapsulates creation of a Blink MediaStream having inside the |
| 22 // necessary Blink and Chromium, track and source. The Chrome Video source is | 18 // necessary Blink and Chromium, track and source. The Chrome Video source is |
| 23 // a mock. | 19 // a mock. |
| 24 class MockMediaStreamRegistry final : public MediaStreamRegistryInterface { | 20 class MockMediaStreamRegistry final : public MediaStreamRegistryInterface { |
| 25 public: | 21 public: |
| 26 MockMediaStreamRegistry(); | 22 MockMediaStreamRegistry(); |
| 27 | 23 |
| 28 void Init(const std::string& stream_url); | 24 void Init(const std::string& stream_url); |
| 29 // TODO(guidou): Remove this method. http://crbug.com/706408 | |
| 30 void AddVideoTrack(const std::string& track_id, | |
| 31 const blink::WebMediaConstraints& constraints); | |
| 32 void AddVideoTrack(const std::string& track_id, | 25 void AddVideoTrack(const std::string& track_id, |
| 33 const VideoTrackAdapterSettings& adapter_settings, | 26 const VideoTrackAdapterSettings& adapter_settings, |
| 34 const base::Optional<bool>& noise_reduction, | 27 const base::Optional<bool>& noise_reduction, |
| 35 bool is_screen_cast, | 28 bool is_screen_cast, |
| 36 double min_frame_rate); | 29 double min_frame_rate); |
| 37 void AddVideoTrack(const std::string& track_id); | 30 void AddVideoTrack(const std::string& track_id); |
| 38 void AddAudioTrack(const std::string& track_id); | 31 void AddAudioTrack(const std::string& track_id); |
| 39 blink::WebMediaStream GetMediaStream(const std::string& url) override; | 32 blink::WebMediaStream GetMediaStream(const std::string& url) override; |
| 40 | 33 |
| 41 const blink::WebMediaStream test_stream() const { return test_stream_; } | 34 const blink::WebMediaStream test_stream() const { return test_stream_; } |
| 42 | 35 |
| 43 void reset() { test_stream_.Reset(); } | 36 void reset() { test_stream_.Reset(); } |
| 44 | 37 |
| 45 private: | 38 private: |
| 46 blink::WebMediaStream test_stream_; | 39 blink::WebMediaStream test_stream_; |
| 47 std::string stream_url_; | 40 std::string stream_url_; |
| 48 }; | 41 }; |
| 49 | 42 |
| 50 } // namespace content | 43 } // namespace content |
| 51 | 44 |
| 52 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_REGISTRY_H_ | 45 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_REGISTRY_H_ |
| OLD | NEW |