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

Unified Diff: remoting/protocol/connection_to_client.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
« no previous file with comments | « remoting/protocol/connection_to_client.h ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/connection_to_client.cc
diff --git a/remoting/protocol/connection_to_client.cc b/remoting/protocol/connection_to_client.cc
index a6d31434ab57589cd01a5d9c44b7fc08d48711c2..0da2324e55db79a1802d26f4e6a2b6b3601e75e5 100644
--- a/remoting/protocol/connection_to_client.cc
+++ b/remoting/protocol/connection_to_client.cc
@@ -12,6 +12,7 @@
#include "remoting/protocol/host_control_dispatcher.h"
#include "remoting/protocol/host_event_dispatcher.h"
#include "remoting/protocol/host_stub.h"
+#include "remoting/protocol/host_video_dispatcher.h"
#include "remoting/protocol/input_stub.h"
namespace remoting {
@@ -56,7 +57,7 @@ void ConnectionToClient::UpdateSequenceNumber(int64 sequence_number) {
VideoStub* ConnectionToClient::video_stub() {
DCHECK(CalledOnValidThread());
- return video_writer_.get();
+ return video_dispatcher_.get();
}
AudioStub* ConnectionToClient::audio_stub() {
@@ -134,9 +135,11 @@ void ConnectionToClient::OnSessionStateChange(Session::State state) {
event_dispatcher_->set_sequence_number_callback(base::Bind(
&ConnectionToClient::UpdateSequenceNumber, base::Unretained(this)));
- video_writer_ = VideoWriter::Create(session_->config());
- video_writer_->Init(session_.get(), base::Bind(
- &ConnectionToClient::OnChannelInitialized, base::Unretained(this)));
+ video_dispatcher_.reset(new HostVideoDispatcher());
+ video_dispatcher_->Init(
+ session_.get(), session_->config().video_config(),
+ base::Bind(&ConnectionToClient::OnChannelInitialized,
+ base::Unretained(this)));
audio_writer_ = AudioWriter::Create(session_->config());
if (audio_writer_.get()) {
@@ -186,7 +189,7 @@ void ConnectionToClient::NotifyIfChannelsReady() {
return;
if (!event_dispatcher_.get() || !event_dispatcher_->is_connected())
return;
- if (!video_writer_.get() || !video_writer_->is_connected())
+ if (!video_dispatcher_.get() || !video_dispatcher_->is_connected())
return;
if ((!audio_writer_.get() || !audio_writer_->is_connected()) &&
session_->config().is_audio_enabled()) {
@@ -203,7 +206,7 @@ void ConnectionToClient::Close(ErrorCode error) {
void ConnectionToClient::CloseChannels() {
control_dispatcher_.reset();
event_dispatcher_.reset();
- video_writer_.reset();
+ video_dispatcher_.reset();
audio_writer_.reset();
}
« no previous file with comments | « remoting/protocol/connection_to_client.h ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698