OLD | NEW |
---|---|
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 "remoting/client/plugin/pepper_video_renderer_3d.h" | 5 #include "remoting/client/plugin/pepper_video_renderer_3d.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
182 } | 182 } |
183 | 183 |
184 protocol::VideoStub* PepperVideoRenderer3D::GetVideoStub() { | 184 protocol::VideoStub* PepperVideoRenderer3D::GetVideoStub() { |
185 return this; | 185 return this; |
186 } | 186 } |
187 | 187 |
188 void PepperVideoRenderer3D::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, | 188 void PepperVideoRenderer3D::ProcessVideoPacket(scoped_ptr<VideoPacket> packet, |
189 const base::Closure& done) { | 189 const base::Closure& done) { |
190 base::ScopedClosureRunner done_runner(done); | 190 base::ScopedClosureRunner done_runner(done); |
191 | 191 |
192 stats_.video_fps_with_empty_frames()->Record(1); | |
192 // Don't need to do anything if the packet is empty. Host sends empty video | 193 // Don't need to do anything if the packet is empty. Host sends empty video |
193 // packets when the screen is not changing. | 194 // packets when the screen is not changing. |
194 if (!packet->data().size()) | 195 if (!packet->data().size()) { |
195 return; | 196 return; |
197 } | |
196 | 198 |
197 // Update statistics. | 199 // Update statistics. |
198 stats_.video_frame_rate()->Record(1); | 200 stats_.video_frame_rate()->Record(1); |
201 stats_.video_fps()->Record(1); | |
199 stats_.video_bandwidth()->Record(packet->data().size()); | 202 stats_.video_bandwidth()->Record(packet->data().size()); |
203 stats_.video_bytes_per_s()->Record(packet->data().size()); | |
Wez
2015/06/29 14:56:13
This ends up being pretty ugly.
Could we instead
anandc
2015/06/30 20:17:39
Agreed.
If we use only the per-second sampling, t
| |
200 if (packet->has_capture_time_ms()) | 204 if (packet->has_capture_time_ms()) |
201 stats_.video_capture_ms()->Record(packet->capture_time_ms()); | 205 stats_.video_capture_ms()->Record(packet->capture_time_ms()); |
202 if (packet->has_encode_time_ms()) | 206 if (packet->has_encode_time_ms()) |
203 stats_.video_encode_ms()->Record(packet->encode_time_ms()); | 207 stats_.video_encode_ms()->Record(packet->encode_time_ms()); |
204 if (packet->has_latest_event_timestamp() && | 208 if (packet->has_latest_event_timestamp() && |
205 packet->latest_event_timestamp() > latest_input_event_timestamp_) { | 209 packet->latest_event_timestamp() > latest_input_event_timestamp_) { |
206 latest_input_event_timestamp_ = packet->latest_event_timestamp(); | 210 latest_input_event_timestamp_ = packet->latest_event_timestamp(); |
207 base::TimeDelta round_trip_latency = | 211 base::TimeDelta round_trip_latency = |
208 base::Time::Now() - | 212 base::Time::Now() - |
209 base::Time::FromInternalValue(packet->latest_event_timestamp()); | 213 base::Time::FromInternalValue(packet->latest_event_timestamp()); |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
530 gles2_if_->AttachShader(graphics_.pp_resource(), shader_program_, shader); | 534 gles2_if_->AttachShader(graphics_.pp_resource(), shader_program_, shader); |
531 gles2_if_->DeleteShader(graphics_.pp_resource(), shader); | 535 gles2_if_->DeleteShader(graphics_.pp_resource(), shader); |
532 } | 536 } |
533 | 537 |
534 void PepperVideoRenderer3D::CheckGLError() { | 538 void PepperVideoRenderer3D::CheckGLError() { |
535 GLenum error = gles2_if_->GetError(graphics_.pp_resource()); | 539 GLenum error = gles2_if_->GetError(graphics_.pp_resource()); |
536 CHECK_EQ(error, static_cast<GLenum>(GL_NO_ERROR)) << "GL error: " << error; | 540 CHECK_EQ(error, static_cast<GLenum>(GL_NO_ERROR)) << "GL error: " << error; |
537 } | 541 } |
538 | 542 |
539 } // namespace remoting | 543 } // namespace remoting |
OLD | NEW |