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

Unified Diff: remoting/protocol/webrtc_connection_to_host.cc

Issue 1580823003: Implement client-side video stream support for WebRTC-based protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@packet_options_rem
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 | « remoting/protocol/webrtc_connection_to_host.h ('k') | remoting/protocol/webrtc_transport.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/webrtc_connection_to_host.cc
diff --git a/remoting/protocol/webrtc_connection_to_host.cc b/remoting/protocol/webrtc_connection_to_host.cc
index 9733163a3e1cf86e1fd98061531710e50f149a65..351bb8d3535b06540e519069fc2ae0a818280a47 100644
--- a/remoting/protocol/webrtc_connection_to_host.cc
+++ b/remoting/protocol/webrtc_connection_to_host.cc
@@ -12,7 +12,9 @@
#include "remoting/protocol/client_stub.h"
#include "remoting/protocol/clipboard_stub.h"
#include "remoting/protocol/transport_context.h"
+#include "remoting/protocol/video_renderer.h"
#include "remoting/protocol/webrtc_transport.h"
+#include "remoting/protocol/webrtc_video_renderer_adapter.h"
namespace remoting {
namespace protocol {
@@ -64,7 +66,7 @@ void WebrtcConnectionToHost::set_clipboard_stub(ClipboardStub* clipboard_stub) {
}
void WebrtcConnectionToHost::set_video_renderer(VideoRenderer* video_renderer) {
- NOTIMPLEMENTED();
+ video_renderer_ = video_renderer;
}
void WebrtcConnectionToHost::set_audio_stub(AudioStub* audio_stub) {
@@ -88,9 +90,13 @@ void WebrtcConnectionToHost::OnSessionStateChange(Session::State state) {
break;
case Session::CLOSED:
+ CloseChannels();
+ SetState(CLOSED, OK);
+ break;
+
case Session::FAILED:
CloseChannels();
- SetState(CLOSED, state == Session::FAILED ? session_->error() : OK);
+ SetState(FAILED, session_->error());
break;
}
}
@@ -112,6 +118,22 @@ void WebrtcConnectionToHost::OnWebrtcTransportError(ErrorCode error) {
SetState(FAILED, error);
}
+void WebrtcConnectionToHost::OnWebrtcTransportMediaStreamAdded(
+ scoped_refptr<webrtc::MediaStreamInterface> stream) {
+ if (video_adapter_) {
+ LOG(WARNING)
+ << "Received multiple media streams. Ignoring all except the last one.";
+ }
+ video_adapter_.reset(new WebrtcVideoRendererAdapter(
+ stream, video_renderer_->GetFrameConsumer()));
+}
+
+void WebrtcConnectionToHost::OnWebrtcTransportMediaStreamRemoved(
+ scoped_refptr<webrtc::MediaStreamInterface> stream) {
+ if (video_adapter_ && video_adapter_->label() == stream->label())
+ video_adapter_.reset();
+}
+
void WebrtcConnectionToHost::OnChannelInitialized(
ChannelDispatcherBase* channel_dispatcher) {
NotifyIfChannelsReady();
« no previous file with comments | « remoting/protocol/webrtc_connection_to_host.h ('k') | remoting/protocol/webrtc_transport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698