| 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 // Record this received packet, even if it is empty. |
| 193 stats_.video_packet_rate()->Record(1); |
| 194 |
| 192 // Don't need to do anything if the packet is empty. Host sends empty video | 195 // Don't need to do anything if the packet is empty. Host sends empty video |
| 193 // packets when the screen is not changing. | 196 // packets when the screen is not changing. |
| 194 if (!packet->data().size()) | 197 if (!packet->data().size()) |
| 195 return; | 198 return; |
| 196 | 199 |
| 197 // Update statistics. | 200 // Update statistics. |
| 201 // TODO(anandc): Move to ChromotingStats - see http://crbug/508602 |
| 198 stats_.video_frame_rate()->Record(1); | 202 stats_.video_frame_rate()->Record(1); |
| 199 stats_.video_bandwidth()->Record(packet->data().size()); | 203 stats_.video_bandwidth()->Record(packet->data().size()); |
| 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 = |
| (...skipping 322 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 |