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

Unified Diff: remoting/test/test_video_renderer.cc

Issue 976233003: Adding the base ChromotingInstance implementation and unittests. This class will be used by the ap… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing Sergey's feedback Created 5 years, 9 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/test/test_video_renderer.cc
diff --git a/remoting/test/test_video_renderer.cc b/remoting/test/test_video_renderer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..864356a112cb3ac37cd152516ec8cab26ad36ea5
--- /dev/null
+++ b/remoting/test/test_video_renderer.cc
@@ -0,0 +1,49 @@
+// Copyright 2015 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/test/test_video_renderer.h"
+
+#include "base/logging.h"
+#include "remoting/proto/video.pb.h"
+
+namespace remoting {
+namespace test {
+
+TestVideoRenderer::TestVideoRenderer() : video_frames_processed_(0) {
+}
+
+TestVideoRenderer::~TestVideoRenderer() {
+}
+
+void TestVideoRenderer::OnSessionConfig(const protocol::SessionConfig& config) {
+ DVLOG(2) << "TestVideoRenderer::OnSessionConfig() Called";
+}
+
+ChromotingStats* TestVideoRenderer::GetStats() {
+ DVLOG(2) << "TestVideoRenderer::GetStats() Called";
+ return nullptr;
+}
+
+protocol::VideoStub* TestVideoRenderer::GetVideoStub() {
+ DVLOG(2) << "TestVideoRenderer::GetVideoStub() Called";
+ return this;
+}
+
+void TestVideoRenderer::ProcessVideoPacket(scoped_ptr<VideoPacket> video_packet,
+ const base::Closure& done) {
+ if (!video_packet->data().empty()) {
+ // If the video frame was not a keep alive frame (i.e. not empty) then
+ // count it.
+ DVLOG(2) << "Video Packet Processed, Total: " << ++video_frames_processed_;
+ } else {
+ // Log at a high verbosity level as we receive empty packets frequently and
+ // they can clutter up the debug output if the level is set too low.
+ DVLOG(3) << "Empty Video Packet received.";
+ }
+
+ done.Run();
+}
+
+} // namespace test
+} // namespace remoting
« remoting/test/test_chromoting_client_unittest.cc ('K') | « remoting/test/test_video_renderer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698