summaryrefslogtreecommitdiffstats
path: root/remoting/protocol/host_video_dispatcher.h
diff options
context:
space:
mode:
authorsergeyu <sergeyu@chromium.org>2014-09-19 12:23:41 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-19 19:23:52 +0000
commit2385cffed5c8a258b29d76160434635b66ea9968 (patch)
treebf9cf2c8620a8aad8f566cef1c37042d41cc3217 /remoting/protocol/host_video_dispatcher.h
parent2405b3063aa466a5133cac621962068088381087 (diff)
downloadchromium_src-2385cffed5c8a258b29d76160434635b66ea9968.zip
chromium_src-2385cffed5c8a258b29d76160434635b66ea9968.tar.gz
chromium_src-2385cffed5c8a258b29d76160434635b66ea9968.tar.bz2
Simplify VideoReader and VideoWriter
Previously VideoReader/Writer were abstract interfaces with single implementation. Now both the reader and writer are concrete implementations reusing ChannelDispatcherBase, which significantly simplified both. BUG=402993 Review URL: https://codereview.chromium.org/577473002 Cr-Commit-Position: refs/heads/master@{#295760}
Diffstat (limited to 'remoting/protocol/host_video_dispatcher.h')
-rw-r--r--remoting/protocol/host_video_dispatcher.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/remoting/protocol/host_video_dispatcher.h b/remoting/protocol/host_video_dispatcher.h
new file mode 100644
index 0000000..3c80166
--- /dev/null
+++ b/remoting/protocol/host_video_dispatcher.h
@@ -0,0 +1,40 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_PROTOCOL_HOST_VIDEO_DISPATCHER_H_
+#define REMOTING_PROTOCOL_HOST_VIDEO_DISPATCHER_H_
+
+#include <string>
+
+#include "base/compiler_specific.h"
+#include "remoting/protocol/buffered_socket_writer.h"
+#include "remoting/protocol/channel_dispatcher_base.h"
+#include "remoting/protocol/video_stub.h"
+
+namespace remoting {
+namespace protocol {
+
+class HostVideoDispatcher : public ChannelDispatcherBase, public VideoStub {
+ public:
+ HostVideoDispatcher();
+ virtual ~HostVideoDispatcher();
+
+ // VideoStub interface.
+ virtual void ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
+ const base::Closure& done) OVERRIDE;
+
+ protected:
+ // ChannelDispatcherBase overrides.
+ virtual void OnInitialized() OVERRIDE;
+
+ private:
+ BufferedSocketWriter writer_;
+
+ DISALLOW_COPY_AND_ASSIGN(HostVideoDispatcher);
+};
+
+} // namespace protocol
+} // namespace remoting
+
+#endif // REMOTING_PROTOCOL_HOST_VIDEO_DISPATCHER_H_