| 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 #include "content/renderer/media/mock_media_stream_registry.h" | 5 #include "content/renderer/media/mock_media_stream_registry.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/renderer/media/media_stream.h" | 10 #include "content/renderer/media/media_stream.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 void MockMediaStreamRegistry::AddVideoTrack( | 59 void MockMediaStreamRegistry::AddVideoTrack( |
| 60 const std::string& track_id, | 60 const std::string& track_id, |
| 61 const VideoTrackAdapterSettings& adapter_settings, | 61 const VideoTrackAdapterSettings& adapter_settings, |
| 62 const base::Optional<bool>& noise_reduction, | 62 const base::Optional<bool>& noise_reduction, |
| 63 bool is_screencast, | 63 bool is_screencast, |
| 64 double min_frame_rate) { | 64 double min_frame_rate) { |
| 65 blink::WebMediaStreamSource blink_source; | 65 blink::WebMediaStreamSource blink_source; |
| 66 blink_source.Initialize("mock video source id", | 66 blink_source.Initialize("mock video source id", |
| 67 blink::WebMediaStreamSource::kTypeVideo, | 67 blink::WebMediaStreamSource::kTypeVideo, |
| 68 "mock video source name", false /* remote */); | 68 "mock video source name", false /* remote */); |
| 69 MockMediaStreamVideoSource* native_source = | 69 MockMediaStreamVideoSource* native_source = new MockMediaStreamVideoSource(); |
| 70 new MockMediaStreamVideoSource(false /* manual get supported formats */); | |
| 71 blink_source.SetExtraData(native_source); | 70 blink_source.SetExtraData(native_source); |
| 72 blink::WebMediaStreamTrack blink_track; | 71 blink::WebMediaStreamTrack blink_track; |
| 73 blink_track.Initialize(blink::WebString::FromUTF8(track_id), blink_source); | 72 blink_track.Initialize(blink::WebString::FromUTF8(track_id), blink_source); |
| 74 | 73 |
| 75 MediaStreamVideoTrack* native_track = new MediaStreamVideoTrack( | 74 MediaStreamVideoTrack* native_track = new MediaStreamVideoTrack( |
| 76 native_source, adapter_settings, noise_reduction, is_screencast, | 75 native_source, adapter_settings, noise_reduction, is_screencast, |
| 77 min_frame_rate, MediaStreamVideoSource::ConstraintsCallback(), | 76 min_frame_rate, MediaStreamVideoSource::ConstraintsCallback(), |
| 78 true /* enabled */); | 77 true /* enabled */); |
| 79 blink_track.SetTrackData(native_track); | 78 blink_track.SetTrackData(native_track); |
| 80 test_stream_.AddTrack(blink_track); | 79 test_stream_.AddTrack(blink_track); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 99 | 98 |
| 100 test_stream_.AddTrack(blink_track); | 99 test_stream_.AddTrack(blink_track); |
| 101 } | 100 } |
| 102 | 101 |
| 103 blink::WebMediaStream MockMediaStreamRegistry::GetMediaStream( | 102 blink::WebMediaStream MockMediaStreamRegistry::GetMediaStream( |
| 104 const std::string& url) { | 103 const std::string& url) { |
| 105 return (url != stream_url_) ? blink::WebMediaStream() : test_stream_; | 104 return (url != stream_url_) ? blink::WebMediaStream() : test_stream_; |
| 106 } | 105 } |
| 107 | 106 |
| 108 } // namespace content | 107 } // namespace content |
| OLD | NEW |