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 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_3D_H_ | 5 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_3D_H_ |
| 6 #define REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_3D_H_ | 6 #define REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_3D_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "ppapi/c/ppb_opengles2.h" | |
|
Sergey Ulanov
2016/07/14 17:45:28
Don't need this. Use int instead of GLint below.
Hzj_jie
2016/07/15 02:30:50
Done.
| |
| 16 #include "ppapi/cpp/graphics_3d.h" | 17 #include "ppapi/cpp/graphics_3d.h" |
| 17 #include "ppapi/cpp/instance_handle.h" | 18 #include "ppapi/cpp/instance_handle.h" |
| 18 #include "ppapi/cpp/video_decoder.h" | 19 #include "ppapi/cpp/video_decoder.h" |
| 19 #include "ppapi/utility/completion_callback_factory.h" | 20 #include "ppapi/utility/completion_callback_factory.h" |
| 20 #include "remoting/client/plugin/pepper_video_renderer.h" | 21 #include "remoting/client/plugin/pepper_video_renderer.h" |
| 22 #include "remoting/client/plugin/pepper_video_renderer_2d.h" | |
| 21 #include "remoting/protocol/video_stub.h" | 23 #include "remoting/protocol/video_stub.h" |
| 22 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 24 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| 23 | 25 |
| 24 struct PPB_OpenGLES2; | 26 struct PPB_OpenGLES2; |
| 25 | 27 |
| 26 namespace remoting { | 28 namespace remoting { |
| 27 | 29 |
| 28 namespace protocol { | 30 namespace protocol { |
| 29 class FrameStatsConsumer; | 31 class FrameStatsConsumer; |
| 30 } // namespace protocol | 32 } // namespace protocol |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 std::list<std::unique_ptr<FrameTracker>> next_picture_frames_; | 131 std::list<std::unique_ptr<FrameTracker>> next_picture_frames_; |
| 130 | 132 |
| 131 // The current picture shown on the screen or being rendered. Must be deleted | 133 // The current picture shown on the screen or being rendered. Must be deleted |
| 132 // before |video_decoder_|. | 134 // before |video_decoder_|. |
| 133 std::unique_ptr<Picture> current_picture_; | 135 std::unique_ptr<Picture> current_picture_; |
| 134 | 136 |
| 135 // FrameTrackers for frames in |current_picture_|. The queue is emptied once | 137 // FrameTrackers for frames in |current_picture_|. The queue is emptied once |
| 136 // the |current_picture_| is rendered. | 138 // the |current_picture_| is rendered. |
| 137 std::list<std::unique_ptr<FrameTracker>> current_picture_frames_; | 139 std::list<std::unique_ptr<FrameTracker>> current_picture_frames_; |
| 138 | 140 |
| 141 // The fallback software renderer, if input video packet size is larger than | |
| 142 // hardware limitation. | |
| 143 PepperVideoRenderer2D fallback_renderer_; | |
|
Sergey Ulanov
2016/07/14 17:45:28
I don't think we want to allocate fallback rendere
Hzj_jie
2016/07/15 02:30:50
I believe SetPepperContext / OnViewChanged / Enabl
Sergey Ulanov
2016/07/15 23:33:18
You do need to call these methods, but they can be
Hzj_jie
2016/07/16 01:19:21
Oh, that seems unachievable. We do not store most
| |
| 144 bool fallback_renderer_usable_; | |
|
Sergey Ulanov
2016/07/14 17:45:28
The 2D renderer is not expected to fail. Just add
Hzj_jie
2016/07/15 02:30:50
Done.
| |
| 145 bool use_fallback_renderer_; | |
| 146 | |
| 139 // Set to true if the screen has been resized and needs to be repainted. | 147 // Set to true if the screen has been resized and needs to be repainted. |
| 140 bool force_repaint_ = false; | 148 bool force_repaint_ = false; |
| 141 | 149 |
| 142 // The texture type for which |shader_program| was initialized. Can be either | 150 // The texture type for which |shader_program| was initialized. Can be either |
| 143 // 0, GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB or GL_TEXTURE_EXTERNAL_OES. 0 | 151 // 0, GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB or GL_TEXTURE_EXTERNAL_OES. 0 |
| 144 // indicates that |shader_program_| hasn't been intialized. | 152 // indicates that |shader_program_| hasn't been intialized. |
| 145 uint32_t current_shader_program_texture_target_ = 0; | 153 uint32_t current_shader_program_texture_target_ = 0; |
| 146 | 154 |
| 147 // Shader program ID. | 155 // Shader program ID. |
| 148 unsigned int shader_program_ = 0; | 156 unsigned int shader_program_ = 0; |
| 149 | 157 |
| 150 // Location of the scale value to be passed to the |shader_program_|. | 158 // Location of the scale value to be passed to the |shader_program_|. |
| 151 int shader_texcoord_scale_location_ = 0; | 159 int shader_texcoord_scale_location_ = 0; |
| 152 | 160 |
| 153 // True if the renderer has received frame from the host. | 161 // True if the renderer has received frame from the host. |
| 154 bool frame_received_ = false; | 162 bool frame_received_ = false; |
| 155 | 163 |
| 156 // True if dirty regions are to be sent to |event_handler_| for debugging. | 164 // True if dirty regions are to be sent to |event_handler_| for debugging. |
| 157 bool debug_dirty_region_ = false; | 165 bool debug_dirty_region_ = false; |
| 158 | 166 |
| 167 GLint gl_max_texture_size_; | |
|
Sergey Ulanov
2016/07/14 17:45:28
int
Hzj_jie
2016/07/15 02:30:50
Done.
| |
| 168 | |
| 159 pp::CompletionCallbackFactory<PepperVideoRenderer3D> callback_factory_; | 169 pp::CompletionCallbackFactory<PepperVideoRenderer3D> callback_factory_; |
| 160 | 170 |
| 161 DISALLOW_COPY_AND_ASSIGN(PepperVideoRenderer3D); | 171 DISALLOW_COPY_AND_ASSIGN(PepperVideoRenderer3D); |
| 162 }; | 172 }; |
| 163 | 173 |
| 164 } // namespace remoting | 174 } // namespace remoting |
| 165 | 175 |
| 166 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_3D_H_ | 176 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_3D_H_ |
| OLD | NEW |