| 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 #ifndef PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_ |
| 6 #define PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
| 9 #include "ppapi/cpp/completion_callback.h" | 9 #include "ppapi/cpp/completion_callback.h" |
| 10 #include "ppapi/proxy/interface_proxy.h" | 10 #include "ppapi/proxy/interface_proxy.h" |
| 11 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" | 11 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" |
| 12 #include "ppapi/shared_impl/video_decoder_impl.h" | 12 #include "ppapi/shared_impl/video_decoder_impl.h" |
| 13 #include "ppapi/thunk/ppb_video_decoder_api.h" | 13 #include "ppapi/thunk/ppb_video_decoder_api.h" |
| 14 | 14 |
| 15 namespace ppapi { | 15 namespace ppapi { |
| 16 namespace proxy { | 16 namespace proxy { |
| 17 | 17 |
| 18 class PPB_VideoDecoder_Proxy : public InterfaceProxy { | 18 class PPB_VideoDecoder_Proxy : public InterfaceProxy { |
| 19 public: | 19 public: |
| 20 PPB_VideoDecoder_Proxy(Dispatcher* dispatcher, const void* target_interface); | 20 PPB_VideoDecoder_Proxy(Dispatcher* dispatcher, const void* target_interface); |
| 21 virtual ~PPB_VideoDecoder_Proxy(); | 21 virtual ~PPB_VideoDecoder_Proxy(); |
| 22 | 22 |
| 23 static const Info* GetInfo(); | 23 static const Info* GetInfo(); |
| 24 | 24 |
| 25 // Creates a VideoDecoder object in the plugin process. | 25 // Creates a VideoDecoder object in the plugin process. |
| 26 static PP_Resource CreateProxyResource(PP_Instance instance, | 26 static PP_Resource CreateProxyResource(PP_Instance instance, |
| 27 PP_Resource context3d_id, const PP_VideoConfigElement* config); | 27 PP_Resource graphics_context, |
| 28 const PP_VideoConfigElement* config); |
| 28 | 29 |
| 29 // InterfaceProxy implementation. | 30 // InterfaceProxy implementation. |
| 30 virtual bool OnMessageReceived(const IPC::Message& msg); | 31 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 31 | 32 |
| 32 const PPB_VideoDecoder_Dev* ppb_video_decoder_target() const { | 33 const PPB_VideoDecoder_Dev* ppb_video_decoder_target() const { |
| 33 return static_cast<const PPB_VideoDecoder_Dev*>(target_interface()); | 34 return static_cast<const PPB_VideoDecoder_Dev*>(target_interface()); |
| 34 } | 35 } |
| 35 | 36 |
| 36 private: | 37 private: |
| 37 // Message handlers in the renderer process to receive messages from the | 38 // Message handlers in the renderer process to receive messages from the |
| 38 // plugin process. | 39 // plugin process. |
| 39 void OnMsgCreate(PP_Instance instance, | 40 void OnMsgCreate(PP_Instance instance, |
| 40 const ppapi::HostResource& context3d_id, | 41 const ppapi::HostResource& graphics_context, |
| 41 const std::vector<PP_VideoConfigElement>& config, | 42 const std::vector<PP_VideoConfigElement>& config, |
| 42 ppapi::HostResource* result); | 43 ppapi::HostResource* result); |
| 43 void OnMsgDecode( | 44 void OnMsgDecode( |
| 44 const ppapi::HostResource& decoder, | 45 const ppapi::HostResource& decoder, |
| 45 const ppapi::HostResource& buffer, int32 id, int32 size); | 46 const ppapi::HostResource& buffer, int32 id, int32 size); |
| 46 void OnMsgAssignPictureBuffers( | 47 void OnMsgAssignPictureBuffers( |
| 47 const ppapi::HostResource& decoder, | 48 const ppapi::HostResource& decoder, |
| 48 const std::vector<PP_PictureBuffer_Dev>& buffers); | 49 const std::vector<PP_PictureBuffer_Dev>& buffers); |
| 49 void OnMsgReusePictureBuffer( | 50 void OnMsgReusePictureBuffer( |
| 50 const ppapi::HostResource& decoder, | 51 const ppapi::HostResource& decoder, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 72 pp::CompletionCallbackFactory<PPB_VideoDecoder_Proxy, | 73 pp::CompletionCallbackFactory<PPB_VideoDecoder_Proxy, |
| 73 ProxyNonThreadSafeRefCount> callback_factory_; | 74 ProxyNonThreadSafeRefCount> callback_factory_; |
| 74 | 75 |
| 75 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Proxy); | 76 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Proxy); |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 } // namespace proxy | 79 } // namespace proxy |
| 79 } // namespace ppapi | 80 } // namespace ppapi |
| 80 | 81 |
| 81 #endif // PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_ | 82 #endif // PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_ |
| OLD | NEW |