| 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" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // InterfaceProxy implementation. | 30 // InterfaceProxy implementation. |
| 31 virtual bool OnMessageReceived(const IPC::Message& msg); | 31 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 32 | 32 |
| 33 const PPB_VideoDecoder_Dev* ppb_video_decoder_target() const { | 33 const PPB_VideoDecoder_Dev* ppb_video_decoder_target() const { |
| 34 return static_cast<const PPB_VideoDecoder_Dev*>(target_interface()); | 34 return static_cast<const PPB_VideoDecoder_Dev*>(target_interface()); |
| 35 } | 35 } |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 // Message handlers in the renderer process to receive messages from the | 38 // Message handlers in the renderer process to receive messages from the |
| 39 // plugin process. | 39 // plugin process. |
| 40 void OnMsgCreate(PP_Instance instance, const HostResource& context3d_id, | 40 void OnMsgCreate(PP_Instance instance, |
| 41 const ppapi::HostResource& context3d_id, |
| 41 const std::vector<PP_VideoConfigElement>& config, | 42 const std::vector<PP_VideoConfigElement>& config, |
| 42 HostResource* result); | 43 ppapi::HostResource* result); |
| 43 void OnMsgDecode( | 44 void OnMsgDecode( |
| 44 const HostResource& decoder, | 45 const ppapi::HostResource& decoder, |
| 45 const HostResource& buffer, int32 id, int32 size); | 46 const ppapi::HostResource& buffer, int32 id, int32 size); |
| 46 void OnMsgAssignPictureBuffers( | 47 void OnMsgAssignPictureBuffers( |
| 47 const 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 HostResource& decoder, | 51 const ppapi::HostResource& decoder, |
| 51 int32 picture_buffer_id); | 52 int32 picture_buffer_id); |
| 52 void OnMsgFlush(const HostResource& decoder); | 53 void OnMsgFlush(const ppapi::HostResource& decoder); |
| 53 void OnMsgReset(const HostResource& decoder); | 54 void OnMsgReset(const ppapi::HostResource& decoder); |
| 54 void OnMsgDestroy(const HostResource& decoder); | 55 void OnMsgDestroy(const ppapi::HostResource& decoder); |
| 55 | 56 |
| 56 // Send a message from the renderer process to the plugin process to tell it | 57 // Send a message from the renderer process to the plugin process to tell it |
| 57 // to run its callback. | 58 // to run its callback. |
| 58 void SendMsgEndOfBitstreamACKToPlugin( | 59 void SendMsgEndOfBitstreamACKToPlugin( |
| 59 int32_t result, const HostResource& decoder, int32 id); | 60 int32_t result, const ppapi::HostResource& decoder, int32 id); |
| 60 void SendMsgFlushACKToPlugin( | 61 void SendMsgFlushACKToPlugin( |
| 61 int32_t result, const HostResource& decoder); | 62 int32_t result, const ppapi::HostResource& decoder); |
| 62 void SendMsgResetACKToPlugin( | 63 void SendMsgResetACKToPlugin( |
| 63 int32_t result, const HostResource& decoder); | 64 int32_t result, const ppapi::HostResource& decoder); |
| 64 | 65 |
| 65 // Message handlers in the plugin process to receive messages from the | 66 // Message handlers in the plugin process to receive messages from the |
| 66 // renderer process. | 67 // renderer process. |
| 67 void OnMsgEndOfBitstreamACK(const HostResource& decoder, | 68 void OnMsgEndOfBitstreamACK(const ppapi::HostResource& decoder, |
| 68 int32_t id, int32_t result); | 69 int32_t id, int32_t result); |
| 69 void OnMsgFlushACK(const HostResource& decoder, int32_t result); | 70 void OnMsgFlushACK(const ppapi::HostResource& decoder, int32_t result); |
| 70 void OnMsgResetACK(const HostResource& decoder, int32_t result); | 71 void OnMsgResetACK(const ppapi::HostResource& decoder, int32_t result); |
| 71 | 72 |
| 72 CompletionCallbackFactory<PPB_VideoDecoder_Proxy, | 73 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 pp | 80 } // namespace pp |
| 80 | 81 |
| 81 #endif // PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_ | 82 #endif // PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_ |
| OLD | NEW |