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

Unified Diff: remoting/host/client_connection.cc

Issue 4229003: Add VideoReader and VideoWriter interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 10 years, 1 month 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/host/client_connection.h ('k') | remoting/host/mock_objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/client_connection.cc
diff --git a/remoting/host/client_connection.cc b/remoting/host/client_connection.cc
index e325bf762c9ce703b5df54a9d3ea24b43a5b4223..8d68d6d1fcb8e150be4d011798b7dc9f66a12dc9 100644
--- a/remoting/host/client_connection.cc
+++ b/remoting/host/client_connection.cc
@@ -52,7 +52,7 @@ void ClientConnection::SendInitClientMessage(int width, int height) {
msg.mutable_init_client()->set_width(width);
msg.mutable_init_client()->set_height(height);
DCHECK(msg.IsInitialized());
- video_writer_.SendMessage(msg);
+ control_writer_.SendMessage(msg);
}
void ClientConnection::SendVideoPacket(const VideoPacket& packet) {
@@ -62,18 +62,12 @@ void ClientConnection::SendVideoPacket(const VideoPacket& packet) {
if (!connection_)
return;
- ChromotingHostMessage* message = new ChromotingHostMessage();
- // TODO(sergeyu): avoid memcopy here.
- *message->mutable_video_packet() = packet;
-
- video_writer_.SendMessage(*message);
-
- delete message;
+ video_writer_->SendPacket(packet);
}
int ClientConnection::GetPendingUpdateStreamMessages() {
DCHECK_EQ(loop_, MessageLoop::current());
- return video_writer_.GetPendingMessages();
+ return video_writer_->GetPendingPackets();
}
void ClientConnection::Disconnect() {
@@ -91,10 +85,12 @@ ClientConnection::ClientConnection() {}
void ClientConnection::OnConnectionStateChange(
ChromotocolConnection::State state) {
if (state == ChromotocolConnection::CONNECTED) {
+ control_writer_.Init(connection_->control_channel());
event_reader_.Init<ChromotingClientMessage>(
connection_->event_channel(),
NewCallback(this, &ClientConnection::OnMessageReceived));
- video_writer_.Init(connection_->video_channel());
+ video_writer_.reset(VideoWriter::Create(connection_->config()));
+ video_writer_->Init(connection_);
}
loop_->PostTask(FROM_HERE,
« no previous file with comments | « remoting/host/client_connection.h ('k') | remoting/host/mock_objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698