Index: remoting/protocol/webrtc_connection_to_client.cc |
diff --git a/remoting/protocol/webrtc_connection_to_client.cc b/remoting/protocol/webrtc_connection_to_client.cc |
index 3f3180485b180d401e4817c6e2b565312b2b8b81..1fbbad117d954f4391ba1a528da9fb882d78fb73 100644 |
--- a/remoting/protocol/webrtc_connection_to_client.cc |
+++ b/remoting/protocol/webrtc_connection_to_client.cc |
@@ -31,9 +31,6 @@ |
namespace remoting { |
namespace protocol { |
-const char kStreamLabel[] = "screen_stream"; |
-const char kVideoLabel[] = "screen_video"; |
- |
// Currently the network thread is also used as worker thread for webrtc. |
// |
// TODO(sergeyu): Figure out if we would benefit from using a separate |
@@ -79,31 +76,13 @@ void WebrtcConnectionToClient::OnInputEventReceived(int64_t timestamp) { |
scoped_ptr<VideoStream> WebrtcConnectionToClient::StartVideoStream( |
scoped_ptr<webrtc::DesktopCapturer> desktop_capturer) { |
- scoped_ptr<WebrtcVideoCapturerAdapter> video_capturer_adapter( |
- new WebrtcVideoCapturerAdapter(std::move(desktop_capturer))); |
- |
- // Set video stream constraints. |
- webrtc::FakeConstraints video_constraints; |
- video_constraints.AddMandatory( |
- webrtc::MediaConstraintsInterface::kMinFrameRate, 5); |
- |
- rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track = |
- transport_.peer_connection_factory()->CreateVideoTrack( |
- kVideoLabel, |
- transport_.peer_connection_factory()->CreateVideoSource( |
- video_capturer_adapter.release(), &video_constraints)); |
- |
- rtc::scoped_refptr<webrtc::MediaStreamInterface> video_stream = |
- transport_.peer_connection_factory()->CreateLocalMediaStream( |
- kStreamLabel); |
- |
- if (!video_stream->AddTrack(video_track) || |
- !transport_.peer_connection()->AddStream(video_stream)) { |
+ scoped_ptr<WebrtcVideoStream> stream(new WebrtcVideoStream()); |
+ if (!stream->Start(std::move(desktop_capturer), transport_.peer_connection(), |
+ transport_.peer_connection_factory())) { |
return nullptr; |
} |
+ return std::move(stream); |
- return make_scoped_ptr( |
- new WebrtcVideoStream(transport_.peer_connection(), video_stream)); |
} |
AudioStub* WebrtcConnectionToClient::audio_stub() { |