Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: remoting/protocol/webrtc_connection_to_client.cc

Issue 1571543002: Implement missing features in WebrtcVideoStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/protocol/webrtc_video_capturer_adapter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | remoting/protocol/webrtc_video_capturer_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698