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

Unified Diff: remoting/protocol/connection_to_host.cc

Issue 577473002: Simplify VideoReader and VideoWriter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
Index: remoting/protocol/connection_to_host.cc
diff --git a/remoting/protocol/connection_to_host.cc b/remoting/protocol/connection_to_host.cc
index 71c7764fd383d7a859385ced6c1e5ce5662e4000..a720b3f48611dda2ca57d186e2fb2631fc828675 100644
--- a/remoting/protocol/connection_to_host.cc
+++ b/remoting/protocol/connection_to_host.cc
@@ -15,11 +15,11 @@
#include "remoting/protocol/client_control_dispatcher.h"
#include "remoting/protocol/client_event_dispatcher.h"
#include "remoting/protocol/client_stub.h"
+#include "remoting/protocol/client_video_dispatcher.h"
#include "remoting/protocol/clipboard_stub.h"
#include "remoting/protocol/errors.h"
#include "remoting/protocol/jingle_session_manager.h"
#include "remoting/protocol/transport.h"
-#include "remoting/protocol/video_reader.h"
#include "remoting/protocol/video_stub.h"
namespace remoting {
@@ -197,10 +197,11 @@ void ConnectionToHost::OnSessionStateChange(
base::Bind(&ConnectionToHost::OnChannelInitialized,
base::Unretained(this)));
- video_reader_ = VideoReader::Create(session_->config());
- video_reader_->Init(session_.get(), monitored_video_stub_.get(),
+ video_dispatcher_.reset(new ClientVideoDispatcher());
+ video_dispatcher_->Init(session_.get(), session_->config().video_config(),
base::Bind(&ConnectionToHost::OnChannelInitialized,
base::Unretained(this)));
+ video_dispatcher_->set_video_stub(monitored_video_stub_.get());
audio_reader_ = AudioReader::Create(session_->config());
if (audio_reader_.get()) {
@@ -263,7 +264,7 @@ void ConnectionToHost::NotifyIfChannelsReady() {
return;
if (!event_dispatcher_.get() || !event_dispatcher_->is_connected())
return;
- if (!video_reader_.get() || !video_reader_->is_connected())
+ if (!video_dispatcher_.get() || !video_dispatcher_->is_connected())
return;
if ((!audio_reader_.get() || !audio_reader_->is_connected()) &&
session_->config().is_audio_enabled()) {
@@ -288,7 +289,7 @@ void ConnectionToHost::CloseChannels() {
event_dispatcher_.reset();
clipboard_forwarder_.set_clipboard_stub(NULL);
event_forwarder_.set_input_stub(NULL);
- video_reader_.reset();
+ video_dispatcher_.reset();
audio_reader_.reset();
}

Powered by Google App Engine
This is Rietveld 408576698