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