OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/proxy/ppb_video_decoder_proxy.h" | 5 #include "ppapi/proxy/ppb_video_decoder_proxy.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "gpu/command_buffer/client/gles2_implementation.h" | 8 #include "gpu/command_buffer/client/gles2_implementation.h" |
9 #include "ppapi/proxy/enter_proxy.h" | 9 #include "ppapi/proxy/enter_proxy.h" |
10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
11 #include "ppapi/proxy/ppapi_messages.h" | 11 #include "ppapi/proxy/ppapi_messages.h" |
12 #include "ppapi/proxy/ppb_buffer_proxy.h" | 12 #include "ppapi/proxy/ppb_buffer_proxy.h" |
13 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" | 13 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" |
14 #include "ppapi/thunk/enter.h" | 14 #include "ppapi/thunk/enter.h" |
15 #include "ppapi/thunk/resource_creation_api.h" | 15 #include "ppapi/thunk/resource_creation_api.h" |
16 #include "ppapi/thunk/thunk.h" | 16 #include "ppapi/thunk/thunk.h" |
17 | 17 |
18 using ppapi::thunk::EnterResourceNoLock; | 18 using ppapi::thunk::EnterResourceNoLock; |
19 using ppapi::thunk::PPB_Buffer_API; | 19 using ppapi::thunk::PPB_Buffer_API; |
20 using ppapi::thunk::PPB_Graphics3D_API; | 20 using ppapi::thunk::PPB_Graphics3D_API; |
21 using ppapi::thunk::PPB_VideoDecoder_API; | 21 using ppapi::thunk::PPB_VideoDecoder_API; |
22 | 22 |
23 namespace ppapi { | 23 namespace ppapi { |
24 namespace proxy { | 24 namespace proxy { |
25 | 25 |
26 class VideoDecoder : public Resource, public PPB_VideoDecoder_Shared { | 26 class VideoDecoder : public Resource, public VideoDecoderImpl { |
27 public: | 27 public: |
28 // You must call Init() before using this class. | 28 // You must call Init() before using this class. |
29 explicit VideoDecoder(const HostResource& resource); | 29 explicit VideoDecoder(const HostResource& resource); |
30 virtual ~VideoDecoder(); | 30 virtual ~VideoDecoder(); |
31 | 31 |
32 static VideoDecoder* Create(const HostResource& resource, | 32 static VideoDecoder* Create(const HostResource& resource, |
33 PP_Resource graphics_context, | 33 PP_Resource graphics_context, |
34 PP_VideoDecoder_Profile profile); | 34 PP_VideoDecoder_Profile profile); |
35 | 35 |
36 // Resource overrides. | 36 // Resource overrides. |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 FlushCommandBuffer(); | 125 FlushCommandBuffer(); |
126 GetDispatcher()->Send(new PpapiHostMsg_PPBVideoDecoder_Reset( | 126 GetDispatcher()->Send(new PpapiHostMsg_PPBVideoDecoder_Reset( |
127 API_ID_PPB_VIDEO_DECODER_DEV, host_resource())); | 127 API_ID_PPB_VIDEO_DECODER_DEV, host_resource())); |
128 return PP_OK_COMPLETIONPENDING; | 128 return PP_OK_COMPLETIONPENDING; |
129 } | 129 } |
130 | 130 |
131 void VideoDecoder::Destroy() { | 131 void VideoDecoder::Destroy() { |
132 FlushCommandBuffer(); | 132 FlushCommandBuffer(); |
133 GetDispatcher()->Send(new PpapiHostMsg_PPBVideoDecoder_Destroy( | 133 GetDispatcher()->Send(new PpapiHostMsg_PPBVideoDecoder_Destroy( |
134 API_ID_PPB_VIDEO_DECODER_DEV, host_resource())); | 134 API_ID_PPB_VIDEO_DECODER_DEV, host_resource())); |
135 PPB_VideoDecoder_Shared::Destroy(); | 135 VideoDecoderImpl::Destroy(); |
136 } | 136 } |
137 | 137 |
138 PluginDispatcher* VideoDecoder::GetDispatcher() const { | 138 PluginDispatcher* VideoDecoder::GetDispatcher() const { |
139 return PluginDispatcher::GetForResource(this); | 139 return PluginDispatcher::GetForResource(this); |
140 } | 140 } |
141 | 141 |
142 void VideoDecoder::ResetACK(int32_t result) { | 142 void VideoDecoder::ResetACK(int32_t result) { |
143 RunResetCallback(result); | 143 RunResetCallback(result); |
144 } | 144 } |
145 | 145 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 | 312 |
313 void PPB_VideoDecoder_Proxy::OnMsgResetACK( | 313 void PPB_VideoDecoder_Proxy::OnMsgResetACK( |
314 const HostResource& decoder, int32_t result) { | 314 const HostResource& decoder, int32_t result) { |
315 EnterPluginFromHostResource<PPB_VideoDecoder_API> enter(decoder); | 315 EnterPluginFromHostResource<PPB_VideoDecoder_API> enter(decoder); |
316 if (enter.succeeded()) | 316 if (enter.succeeded()) |
317 static_cast<VideoDecoder*>(enter.object())->ResetACK(result); | 317 static_cast<VideoDecoder*>(enter.object())->ResetACK(result); |
318 } | 318 } |
319 | 319 |
320 } // namespace proxy | 320 } // namespace proxy |
321 } // namespace ppapi | 321 } // namespace ppapi |
OLD | NEW |