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

Side by Side Diff: remoting/test/protocol_perftest.cc

Issue 910343002: Decompose VideoRenderer from VideoStub. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix perf test Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « remoting/client/video_renderer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/base64.h" 5 #include "base/base64.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 // protocol::CursorShapeStub interface. 69 // protocol::CursorShapeStub interface.
70 void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override{}; 70 void SetCursorShape(const protocol::CursorShapeInfo& cursor_shape) override{};
71 }; 71 };
72 72
73 class ProtocolPerfTest 73 class ProtocolPerfTest
74 : public testing::Test, 74 : public testing::Test,
75 public testing::WithParamInterface<NetworkPerformanceParams>, 75 public testing::WithParamInterface<NetworkPerformanceParams>,
76 public ClientUserInterface, 76 public ClientUserInterface,
77 public VideoRenderer, 77 public VideoRenderer,
78 public protocol::VideoStub,
78 public HostStatusObserver { 79 public HostStatusObserver {
79 public: 80 public:
80 ProtocolPerfTest() 81 ProtocolPerfTest()
81 : host_thread_("host"), 82 : host_thread_("host"),
82 capture_thread_("capture"), 83 capture_thread_("capture"),
83 encode_thread_("encode") { 84 encode_thread_("encode") {
84 VideoFramePump::EnableTimestampsForTests(); 85 VideoFramePump::EnableTimestampsForTests();
85 host_thread_.StartWithOptions( 86 host_thread_.StartWithOptions(
86 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); 87 base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
87 capture_thread_.Start(); 88 capture_thread_.Start();
(...skipping 24 matching lines...) Expand all
112 const protocol::PairingResponse& pairing_response) override {} 113 const protocol::PairingResponse& pairing_response) override {}
113 void DeliverHostMessage(const protocol::ExtensionMessage& message) override {} 114 void DeliverHostMessage(const protocol::ExtensionMessage& message) override {}
114 protocol::ClipboardStub* GetClipboardStub() override { return nullptr; } 115 protocol::ClipboardStub* GetClipboardStub() override { return nullptr; }
115 protocol::CursorShapeStub* GetCursorShapeStub() override { 116 protocol::CursorShapeStub* GetCursorShapeStub() override {
116 return &cursor_shape_stub_; 117 return &cursor_shape_stub_;
117 } 118 }
118 119
119 // VideoRenderer interface. 120 // VideoRenderer interface.
120 void OnSessionConfig(const protocol::SessionConfig& config) override {} 121 void OnSessionConfig(const protocol::SessionConfig& config) override {}
121 ChromotingStats* GetStats() override { return nullptr; } 122 ChromotingStats* GetStats() override { return nullptr; }
123 protocol::VideoStub* GetVideoStub() override { return this; }
124
125 // protocol::VideoStub interface.
122 void ProcessVideoPacket(scoped_ptr<VideoPacket> video_packet, 126 void ProcessVideoPacket(scoped_ptr<VideoPacket> video_packet,
123 const base::Closure& done) override { 127 const base::Closure& done) override {
124 if (video_packet->data().empty()) { 128 if (video_packet->data().empty()) {
125 // Ignore keep-alive packets 129 // Ignore keep-alive packets
126 done.Run(); 130 done.Run();
127 return; 131 return;
128 } 132 }
129 133
130 last_video_packet_ = video_packet.Pass(); 134 last_video_packet_ = video_packet.Pass();
131 135
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 << "ms Encode: " << last_video_packet_->encode_time_ms() 488 << "ms Encode: " << last_video_packet_->encode_time_ms()
485 << "ms Capture: " << last_video_packet_->capture_time_ms() 489 << "ms Capture: " << last_video_packet_->capture_time_ms()
486 << "ms"; 490 << "ms";
487 sum += latency; 491 sum += latency;
488 } 492 }
489 493
490 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF(); 494 LOG(INFO) << "Average: " << (sum / kFrames).InMillisecondsF();
491 } 495 }
492 496
493 } // namespace remoting 497 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/video_renderer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698