| 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_packet_rate()->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; |
| 196 | 197 |
| 197 // Update statistics. | 198 // Update statistics. |
| 199 // TODO(anandc): The following tasks are duplicated in |
| 200 // software_video_renderer.cc. Move to ChromotingStats: http://crbug/508602 |
| 198 stats_.video_frame_rate()->Record(1); | 201 stats_.video_frame_rate()->Record(1); |
| 199 stats_.video_bandwidth()->Record(packet->data().size()); | 202 stats_.video_bandwidth()->Record(packet->data().size()); |
| 200 if (packet->has_capture_time_ms()) | 203 if (packet->has_capture_time_ms()) |
| 201 stats_.video_capture_ms()->Record(packet->capture_time_ms()); | 204 stats_.video_capture_ms()->Record(packet->capture_time_ms()); |
| 202 if (packet->has_encode_time_ms()) | 205 if (packet->has_encode_time_ms()) |
| 203 stats_.video_encode_ms()->Record(packet->encode_time_ms()); | 206 stats_.video_encode_ms()->Record(packet->encode_time_ms()); |
| 204 if (packet->has_latest_event_timestamp() && | 207 if (packet->has_latest_event_timestamp() && |
| 205 packet->latest_event_timestamp() > latest_input_event_timestamp_) { | 208 packet->latest_event_timestamp() > latest_input_event_timestamp_) { |
| 206 latest_input_event_timestamp_ = packet->latest_event_timestamp(); | 209 latest_input_event_timestamp_ = packet->latest_event_timestamp(); |
| 207 base::TimeDelta round_trip_latency = | 210 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); | 533 gles2_if_->AttachShader(graphics_.pp_resource(), shader_program_, shader); |
| 531 gles2_if_->DeleteShader(graphics_.pp_resource(), shader); | 534 gles2_if_->DeleteShader(graphics_.pp_resource(), shader); |
| 532 } | 535 } |
| 533 | 536 |
| 534 void PepperVideoRenderer3D::CheckGLError() { | 537 void PepperVideoRenderer3D::CheckGLError() { |
| 535 GLenum error = gles2_if_->GetError(graphics_.pp_resource()); | 538 GLenum error = gles2_if_->GetError(graphics_.pp_resource()); |
| 536 CHECK_EQ(error, static_cast<GLenum>(GL_NO_ERROR)) << "GL error: " << error; | 539 CHECK_EQ(error, static_cast<GLenum>(GL_NO_ERROR)) << "GL error: " << error; |
| 537 } | 540 } |
| 538 | 541 |
| 539 } // namespace remoting | 542 } // namespace remoting |
| OLD | NEW |