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

Unified Diff: remoting/protocol/host_video_dispatcher.h

Issue 850983002: Implement video frame acknowledgements in the chromoting protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: remoting/protocol/host_video_dispatcher.h
diff --git a/remoting/protocol/host_video_dispatcher.h b/remoting/protocol/host_video_dispatcher.h
index c1a957397c0ab6a018f12b8414df98a84b55bc9d..0c17e2d2403ceb49212335961840f57128204de9 100644
--- a/remoting/protocol/host_video_dispatcher.h
+++ b/remoting/protocol/host_video_dispatcher.h
@@ -5,17 +5,19 @@
#ifndef REMOTING_PROTOCOL_HOST_VIDEO_DISPATCHER_H_
#define REMOTING_PROTOCOL_HOST_VIDEO_DISPATCHER_H_
+#include <deque>
#include <string>
#include "base/compiler_specific.h"
-#include "remoting/protocol/buffered_socket_writer.h"
+#include "remoting/proto/video.pb.h"
#include "remoting/protocol/channel_dispatcher_base.h"
-#include "remoting/protocol/video_stub.h"
+#include "remoting/protocol/protobuf_message_parser.h"
+#include "remoting/protocol/video_sender.h"
namespace remoting {
namespace protocol {
-class HostVideoDispatcher : public ChannelDispatcherBase, public VideoStub {
+class HostVideoDispatcher : public ChannelDispatcherBase, public VideoSender {
public:
HostVideoDispatcher();
~HostVideoDispatcher() override;
@@ -23,8 +25,23 @@ class HostVideoDispatcher : public ChannelDispatcherBase, public VideoStub {
// VideoStub interface.
void ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
const base::Closure& done) override;
+ bool SupportsAcks() override;
private:
+ struct PendingFrame {
+ PendingFrame(int frame_id, const base::Closure& done);
+
+ int32_t frame_id;
+ base::Closure done;
+ };
+
+ void OnVideoAck(scoped_ptr<VideoAck> ack, const base::Closure& done);
+
+ int32_t frame_id_;
+ ProtobufMessageParser<VideoAck> parser_;
+
+ std::deque<PendingFrame> pending_frames_;
+
DISALLOW_COPY_AND_ASSIGN(HostVideoDispatcher);
};

Powered by Google App Engine
This is Rietveld 408576698