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

Unified Diff: remoting/protocol/ice_connection_to_host.cc

Issue 1559933003: Pass VideoRenderer interface to ConnectionToHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_frame_consumer
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/ice_connection_to_host.h ('k') | remoting/protocol/webrtc_connection_to_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/ice_connection_to_host.cc
diff --git a/remoting/protocol/ice_connection_to_host.cc b/remoting/protocol/ice_connection_to_host.cc
index ddb77c73b1d0884ab88ed073670069d41ca0a5b0..28e5e620ee5b0b78a595dac9b65ff6fc6b2d8a1a 100644
--- a/remoting/protocol/ice_connection_to_host.cc
+++ b/remoting/protocol/ice_connection_to_host.cc
@@ -21,7 +21,7 @@
#include "remoting/protocol/errors.h"
#include "remoting/protocol/ice_transport.h"
#include "remoting/protocol/transport_context.h"
-#include "remoting/protocol/video_stub.h"
+#include "remoting/protocol/video_renderer.h"
namespace remoting {
namespace protocol {
@@ -35,7 +35,7 @@ void IceConnectionToHost::Connect(
HostEventCallback* event_callback) {
DCHECK(client_stub_);
DCHECK(clipboard_stub_);
- DCHECK(monitored_video_stub_);
+ DCHECK(video_renderer_);
transport_.reset(new IceTransport(transport_context, this));
@@ -73,13 +73,10 @@ void IceConnectionToHost::set_clipboard_stub(ClipboardStub* clipboard_stub) {
clipboard_stub_ = clipboard_stub;
}
-void IceConnectionToHost::set_video_stub(VideoStub* video_stub) {
- DCHECK(video_stub);
- monitored_video_stub_.reset(new MonitoredVideoStub(
- video_stub, base::TimeDelta::FromSeconds(
- MonitoredVideoStub::kConnectivityCheckDelaySeconds),
- base::Bind(&IceConnectionToHost::OnVideoChannelStatus,
- base::Unretained(this))));
+void IceConnectionToHost::set_video_renderer(VideoRenderer* video_renderer) {
+ DCHECK(video_renderer);
+ DCHECK(!monitored_video_stub_);
+ video_renderer_ = video_renderer;
}
void IceConnectionToHost::set_audio_stub(AudioStub* audio_stub) {
@@ -101,19 +98,31 @@ void IceConnectionToHost::OnSessionStateChange(Session::State state) {
case Session::AUTHENTICATED:
SetState(AUTHENTICATED, OK);
+
+ // Setup control channel.
control_dispatcher_.reset(new ClientControlDispatcher());
control_dispatcher_->Init(transport_->GetMultiplexedChannelFactory(),
this);
control_dispatcher_->set_client_stub(client_stub_);
control_dispatcher_->set_clipboard_stub(clipboard_stub_);
+ // Setup event channel.
event_dispatcher_.reset(new ClientEventDispatcher());
event_dispatcher_->Init(transport_->GetMultiplexedChannelFactory(), this);
+ // Configure video pipeline.
+ video_renderer_->OnSessionConfig(session_->config());
+ monitored_video_stub_.reset(new MonitoredVideoStub(
+ video_renderer_->GetVideoStub(),
+ base::TimeDelta::FromSeconds(
+ MonitoredVideoStub::kConnectivityCheckDelaySeconds),
+ base::Bind(&IceConnectionToHost::OnVideoChannelStatus,
+ base::Unretained(this))));
video_dispatcher_.reset(
new ClientVideoDispatcher(monitored_video_stub_.get()));
video_dispatcher_->Init(transport_->GetStreamChannelFactory(), this);
+ // Configure audio pipeline if necessary.
if (session_->config().is_audio_enabled()) {
audio_reader_.reset(new AudioReader(audio_stub_));
audio_reader_->Init(transport_->GetMultiplexedChannelFactory(), this);
« no previous file with comments | « remoting/protocol/ice_connection_to_host.h ('k') | remoting/protocol/webrtc_connection_to_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698