Index: remoting/protocol/host_video_dispatcher.cc |
diff --git a/remoting/protocol/host_video_dispatcher.cc b/remoting/protocol/host_video_dispatcher.cc |
index 0d7c0de53997277767537159cf5f6165dc823b23..ca9b63436d493ac7fb32719b8af1e236a2628bac 100644 |
--- a/remoting/protocol/host_video_dispatcher.cc |
+++ b/remoting/protocol/host_video_dispatcher.cc |
@@ -9,6 +9,7 @@ |
#include "base/bind.h" |
#include "net/socket/stream_socket.h" |
#include "remoting/base/constants.h" |
+#include "remoting/proto/video.pb.h" |
#include "remoting/protocol/message_serialization.h" |
#include "remoting/protocol/video_feedback_stub.h" |
@@ -16,12 +17,7 @@ namespace remoting { |
namespace protocol { |
HostVideoDispatcher::HostVideoDispatcher() |
- : ChannelDispatcherBase(kVideoChannelName), |
- parser_( |
- base::Bind(&HostVideoDispatcher::OnVideoAck, base::Unretained(this)), |
- reader()), |
- video_feedback_stub_(nullptr) {} |
- |
+ : ChannelDispatcherBase(kVideoChannelName) {} |
HostVideoDispatcher::~HostVideoDispatcher() {} |
void HostVideoDispatcher::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, |
@@ -29,7 +25,11 @@ void HostVideoDispatcher::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, |
writer()->Write(SerializeAndFrameMessage(*packet), done); |
} |
-void HostVideoDispatcher::OnVideoAck(scoped_ptr<VideoAck> ack) { |
+void HostVideoDispatcher::OnIncomingMessage( |
+ scoped_ptr<CompoundBuffer> message) { |
+ scoped_ptr<VideoAck> ack = ParseMessage<VideoAck>(message.get()); |
+ if (!ack) |
+ return; |
if (video_feedback_stub_) |
video_feedback_stub_->ProcessVideoAck(std::move(ack)); |
} |