| 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 <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "ppapi/cpp/graphics_3d.h" | 14 #include "ppapi/cpp/graphics_3d.h" |
| 15 #include "ppapi/cpp/instance_handle.h" | 15 #include "ppapi/cpp/instance_handle.h" |
| 16 #include "ppapi/cpp/video_decoder.h" | 16 #include "ppapi/cpp/video_decoder.h" |
| 17 #include "ppapi/utility/completion_callback_factory.h" | 17 #include "ppapi/utility/completion_callback_factory.h" |
| 18 #include "remoting/client/chromoting_stats.h" | 18 #include "remoting/client/chromoting_stats.h" |
| 19 #include "remoting/client/plugin/pepper_video_renderer.h" | 19 #include "remoting/client/plugin/pepper_video_renderer.h" |
| 20 #include "remoting/protocol/video_stub.h" |
| 20 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 21 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| 21 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" | 22 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" |
| 22 | 23 |
| 23 struct PPB_OpenGLES2; | 24 struct PPB_OpenGLES2; |
| 24 | 25 |
| 25 namespace remoting { | 26 namespace remoting { |
| 26 | 27 |
| 27 // PepperVideoRenderer that uses the PPB_VideoDecoder interface for video | 28 // PepperVideoRenderer that uses the PPB_VideoDecoder interface for video |
| 28 // decoding and Graphics3D for rendering. | 29 // decoding and Graphics3D for rendering. |
| 29 class PepperVideoRenderer3D : public PepperVideoRenderer { | 30 class PepperVideoRenderer3D : public PepperVideoRenderer, |
| 31 public protocol::VideoStub { |
| 30 public: | 32 public: |
| 31 PepperVideoRenderer3D(); | 33 PepperVideoRenderer3D(); |
| 32 ~PepperVideoRenderer3D() override; | 34 ~PepperVideoRenderer3D() override; |
| 33 | 35 |
| 34 // PepperVideoRenderer interface. | 36 // PepperVideoRenderer interface. |
| 35 bool Initialize(pp::Instance* instance, | 37 bool Initialize(pp::Instance* instance, |
| 36 const ClientContext& context, | 38 const ClientContext& context, |
| 37 EventHandler* event_handler) override; | 39 EventHandler* event_handler) override; |
| 38 void OnViewChanged(const pp::View& view) override; | 40 void OnViewChanged(const pp::View& view) override; |
| 41 |
| 42 // VideoRenderer interface. |
| 39 void OnSessionConfig(const protocol::SessionConfig& config) override; | 43 void OnSessionConfig(const protocol::SessionConfig& config) override; |
| 40 ChromotingStats* GetStats() override; | 44 ChromotingStats* GetStats() override; |
| 45 protocol::VideoStub* GetVideoStub() override; |
| 46 |
| 47 // protocol::VideoStub interface. |
| 41 void ProcessVideoPacket(scoped_ptr<VideoPacket> packet, | 48 void ProcessVideoPacket(scoped_ptr<VideoPacket> packet, |
| 42 const base::Closure& done) override; | 49 const base::Closure& done) override; |
| 43 | 50 |
| 44 private: | 51 private: |
| 45 class PendingPacket; | 52 class PendingPacket; |
| 46 class Picture; | 53 class Picture; |
| 47 | 54 |
| 48 struct FrameDecodeTimestamp { | 55 struct FrameDecodeTimestamp { |
| 49 FrameDecodeTimestamp(uint32_t frame_id, | 56 FrameDecodeTimestamp(uint32_t frame_id, |
| 50 base::TimeTicks decode_started_time); | 57 base::TimeTicks decode_started_time); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 int shader_texcoord_scale_location_; | 150 int shader_texcoord_scale_location_; |
| 144 | 151 |
| 145 pp::CompletionCallbackFactory<PepperVideoRenderer3D> callback_factory_; | 152 pp::CompletionCallbackFactory<PepperVideoRenderer3D> callback_factory_; |
| 146 | 153 |
| 147 DISALLOW_COPY_AND_ASSIGN(PepperVideoRenderer3D); | 154 DISALLOW_COPY_AND_ASSIGN(PepperVideoRenderer3D); |
| 148 }; | 155 }; |
| 149 | 156 |
| 150 } // namespace remoting | 157 } // namespace remoting |
| 151 | 158 |
| 152 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_3D_H_ | 159 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_VIDEO_RENDERER_3D_H_ |
| OLD | NEW |