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

Unified Diff: remoting/protocol/host_video_stats_dispatcher.cc

Issue 2176443002: Add client and host dispatchers for video_stats channel to send video stats from host to client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simple_channel
Patch Set: . Created 4 years, 5 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_stats_dispatcher.cc
diff --git a/remoting/protocol/host_video_stats_dispatcher.cc b/remoting/protocol/host_video_stats_dispatcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2185fb3be82f54b1f402f5b2972466420e56090f
--- /dev/null
+++ b/remoting/protocol/host_video_stats_dispatcher.cc
@@ -0,0 +1,40 @@
+// Copyright 2016 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.
+
+#include "remoting/protocol/host_video_stats_dispatcher.h"
+
+#include <utility>
+
+#include "base/bind.h"
+#include "net/socket/stream_socket.h"
+#include "remoting/base/compound_buffer.h"
+#include "remoting/base/constants.h"
+#include "remoting/proto/video_stats.pb.h"
+#include "remoting/protocol/frame_stats.h"
+#include "remoting/protocol/message_pipe.h"
+#include "remoting/protocol/message_serialization.h"
+#include "remoting/protocol/video_stats_stub.h"
+
+namespace remoting {
+namespace protocol {
+
+HostVideoStatsDispatcher::HostVideoStatsDispatcher(
+ const std::string& stream_name)
+ : ChannelDispatcherBase(kVideoStatsChannelNamePrefix + stream_name) {}
+
+HostVideoStatsDispatcher::~HostVideoStatsDispatcher() {}
+
+void HostVideoStatsDispatcher::OnVideoFrameStats(uint32_t frame_id,
+ const HostFrameStats& stats) {
+ FrameStatsMessage message;
+ message.set_frame_id(frame_id);
+ stats.ToFrameStatsMessage(&message);
+ message_pipe()->Send(&message, base::Closure());
+}
+
+void HostVideoStatsDispatcher::OnIncomingMessage(
+ std::unique_ptr<CompoundBuffer> message) {}
+
+} // namespace protocol
+} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698