Chromium Code Reviews| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 pending_frames_.front()->OnDecoded(); | 326 pending_frames_.front()->OnDecoded(); |
| 327 // Move the frame from |pending_frames_| to |decoded_frames_|. | 327 // Move the frame from |pending_frames_| to |decoded_frames_|. |
| 328 decoded_frames_.splice(decoded_frames_.end(), pending_frames_, | 328 decoded_frames_.splice(decoded_frames_.end(), pending_frames_, |
| 329 pending_frames_.begin()); | 329 pending_frames_.begin()); |
| 330 | 330 |
| 331 DecodeNextPacket(); | 331 DecodeNextPacket(); |
| 332 GetNextPicture(); | 332 GetNextPicture(); |
| 333 } | 333 } |
| 334 | 334 |
| 335 void PepperVideoRenderer3D::GetNextPicture() { | 335 void PepperVideoRenderer3D::GetNextPicture() { |
| 336 if (get_picture_pending_) | 336 if (get_picture_pending_ || decoded_frames_.empty()) { |
|
Sergey Ulanov
2017/02/13 20:46:57
Add a comment to explain why we need to check deco
| |
| 337 return; | 337 return; |
| 338 } | |
| 338 | 339 |
| 339 int32_t result = | 340 int32_t result = |
| 340 video_decoder_.GetPicture(callback_factory_.NewCallbackWithOutput( | 341 video_decoder_.GetPicture(callback_factory_.NewCallbackWithOutput( |
| 341 &PepperVideoRenderer3D::OnPictureReady)); | 342 &PepperVideoRenderer3D::OnPictureReady)); |
| 342 CHECK_EQ(result, PP_OK_COMPLETIONPENDING); | 343 CHECK_EQ(result, PP_OK_COMPLETIONPENDING); |
| 343 get_picture_pending_ = true; | 344 get_picture_pending_ = true; |
| 344 } | 345 } |
| 345 | 346 |
| 346 void PepperVideoRenderer3D::OnPictureReady(int32_t result, | 347 void PepperVideoRenderer3D::OnPictureReady(int32_t result, |
| 347 PP_VideoPicture picture) { | 348 PP_VideoPicture picture) { |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 573 gles2_if_->AttachShader(graphics_.pp_resource(), shader_program_, shader); | 574 gles2_if_->AttachShader(graphics_.pp_resource(), shader_program_, shader); |
| 574 gles2_if_->DeleteShader(graphics_.pp_resource(), shader); | 575 gles2_if_->DeleteShader(graphics_.pp_resource(), shader); |
| 575 } | 576 } |
| 576 | 577 |
| 577 void PepperVideoRenderer3D::CheckGLError() { | 578 void PepperVideoRenderer3D::CheckGLError() { |
| 578 GLenum error = gles2_if_->GetError(graphics_.pp_resource()); | 579 GLenum error = gles2_if_->GetError(graphics_.pp_resource()); |
| 579 CHECK_EQ(error, static_cast<GLenum>(GL_NO_ERROR)) << "GL error: " << error; | 580 CHECK_EQ(error, static_cast<GLenum>(GL_NO_ERROR)) << "GL error: " << error; |
| 580 } | 581 } |
| 581 | 582 |
| 582 } // namespace remoting | 583 } // namespace remoting |
| OLD | NEW |