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 <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 void PepperVideoRenderer3D::ProcessVideoPacket( | 212 void PepperVideoRenderer3D::ProcessVideoPacket( |
213 std::unique_ptr<VideoPacket> packet, | 213 std::unique_ptr<VideoPacket> packet, |
214 const base::Closure& done) { | 214 const base::Closure& done) { |
215 VideoPacket* packet_ptr = packet.get(); | 215 VideoPacket* packet_ptr = packet.get(); |
216 std::unique_ptr<FrameTracker> frame_tracker( | 216 std::unique_ptr<FrameTracker> frame_tracker( |
217 new FrameTracker(std::move(packet), stats_consumer_, done)); | 217 new FrameTracker(std::move(packet), stats_consumer_, done)); |
218 | 218 |
219 // Don't need to do anything if the packet is empty. Host sends empty video | 219 // Don't need to do anything if the packet is empty. Host sends empty video |
220 // packets when the screen is not changing. | 220 // packets when the screen is not changing. |
221 if (!packet_ptr->data().size()) | 221 if (packet_ptr->data().empty()) |
222 return; | 222 return; |
223 | 223 |
224 if (!frame_received_) { | 224 if (!frame_received_) { |
225 event_handler_->OnVideoFirstFrameReceived(); | 225 event_handler_->OnVideoFirstFrameReceived(); |
226 frame_received_ = true; | 226 frame_received_ = true; |
227 } | 227 } |
228 | 228 |
229 if (packet_ptr->format().has_screen_width() && | 229 if (packet_ptr->format().has_screen_width() && |
230 packet_ptr->format().has_screen_height()) { | 230 packet_ptr->format().has_screen_height()) { |
231 frame_size_.set(packet_ptr->format().screen_width(), | 231 frame_size_.set(packet_ptr->format().screen_width(), |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 gles2_if_->AttachShader(graphics_.pp_resource(), shader_program_, shader); | 530 gles2_if_->AttachShader(graphics_.pp_resource(), shader_program_, shader); |
531 gles2_if_->DeleteShader(graphics_.pp_resource(), shader); | 531 gles2_if_->DeleteShader(graphics_.pp_resource(), shader); |
532 } | 532 } |
533 | 533 |
534 void PepperVideoRenderer3D::CheckGLError() { | 534 void PepperVideoRenderer3D::CheckGLError() { |
535 GLenum error = gles2_if_->GetError(graphics_.pp_resource()); | 535 GLenum error = gles2_if_->GetError(graphics_.pp_resource()); |
536 CHECK_EQ(error, static_cast<GLenum>(GL_NO_ERROR)) << "GL error: " << error; | 536 CHECK_EQ(error, static_cast<GLenum>(GL_NO_ERROR)) << "GL error: " << error; |
537 } | 537 } |
538 | 538 |
539 } // namespace remoting | 539 } // namespace remoting |
OLD | NEW |