| 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_PPB_VIDEO_CAPTURE_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_VIDEO_CAPTURE_PROXY_H_ |
| 6 #define PPAPI_PPB_VIDEO_CAPTURE_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_VIDEO_CAPTURE_PROXY_H_ |
| 7 |
| 8 #include <vector> |
| 7 | 9 |
| 8 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
| 9 #include "ppapi/proxy/interface_proxy.h" | 11 #include "ppapi/proxy/interface_proxy.h" |
| 10 #include "ppapi/proxy/serialized_structs.h" | 12 #include "ppapi/proxy/serialized_structs.h" |
| 11 | 13 |
| 12 struct PPB_VideoCapture_Dev; | |
| 13 struct PPP_VideoCapture_Dev; | 14 struct PPP_VideoCapture_Dev; |
| 14 struct PP_VideoCaptureDeviceInfo_Dev; | 15 struct PP_VideoCaptureDeviceInfo_Dev; |
| 15 | 16 |
| 16 namespace ppapi { | 17 namespace ppapi { |
| 17 | 18 |
| 18 class HostResource; | 19 class HostResource; |
| 19 | 20 |
| 20 namespace proxy { | 21 namespace proxy { |
| 21 | 22 |
| 22 class PPB_VideoCapture_Proxy : public InterfaceProxy { | 23 class PPB_VideoCapture_Proxy : public InterfaceProxy { |
| 23 public: | 24 public: |
| 24 PPB_VideoCapture_Proxy(Dispatcher* dispatcher); | 25 explicit PPB_VideoCapture_Proxy(Dispatcher* dispatcher); |
| 25 virtual ~PPB_VideoCapture_Proxy(); | 26 virtual ~PPB_VideoCapture_Proxy(); |
| 26 | 27 |
| 27 static PP_Resource CreateProxyResource(PP_Instance instance); | 28 static PP_Resource CreateProxyResource(PP_Instance instance); |
| 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 static const ApiID kApiID = API_ID_PPB_VIDEO_CAPTURE_DEV; | 33 static const ApiID kApiID = API_ID_PPB_VIDEO_CAPTURE_DEV; |
| 33 | 34 |
| 34 private: | 35 private: |
| 35 // Message handlers. | 36 // Message handlers. |
| 36 void OnMsgCreate(PP_Instance instance, ppapi::HostResource* result_resource); | 37 void OnMsgCreate(PP_Instance instance, ppapi::HostResource* result_resource); |
| 37 void OnMsgStartCapture(const ppapi::HostResource& resource, | 38 void OnMsgStartCapture(const ppapi::HostResource& resource, |
| 38 const PP_VideoCaptureDeviceInfo_Dev& info, | 39 const PP_VideoCaptureDeviceInfo_Dev& info, |
| 39 uint32_t buffers); | 40 uint32_t buffers); |
| 40 void OnMsgReuseBuffer(const ppapi::HostResource& resource, | 41 void OnMsgReuseBuffer(const ppapi::HostResource& resource, |
| 41 uint32_t buffer); | 42 uint32_t buffer); |
| 42 void OnMsgStopCapture(const ppapi::HostResource& resource); | 43 void OnMsgStopCapture(const ppapi::HostResource& resource); |
| 43 | 44 |
| 44 DISALLOW_COPY_AND_ASSIGN(PPB_VideoCapture_Proxy); | 45 DISALLOW_COPY_AND_ASSIGN(PPB_VideoCapture_Proxy); |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 class PPP_VideoCapture_Proxy : public InterfaceProxy { | 48 class PPP_VideoCapture_Proxy : public InterfaceProxy { |
| 48 public: | 49 public: |
| 49 PPP_VideoCapture_Proxy(Dispatcher* dispatcher); | 50 explicit PPP_VideoCapture_Proxy(Dispatcher* dispatcher); |
| 50 virtual ~PPP_VideoCapture_Proxy(); | 51 virtual ~PPP_VideoCapture_Proxy(); |
| 51 | 52 |
| 52 static const Info* GetInfo(); | 53 static const Info* GetInfo(); |
| 53 | 54 |
| 54 // InterfaceProxy implementation. | 55 // InterfaceProxy implementation. |
| 55 virtual bool OnMessageReceived(const IPC::Message& msg); | 56 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 56 | 57 |
| 57 static const ApiID kApiID = API_ID_PPP_VIDEO_CAPTURE_DEV; | 58 static const ApiID kApiID = API_ID_PPP_VIDEO_CAPTURE_DEV; |
| 58 | 59 |
| 59 private: | 60 private: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 72 // pointer so we don't have to retrieve it from the dispatcher each time. | 73 // pointer so we don't have to retrieve it from the dispatcher each time. |
| 73 // In the host, this value is always NULL. | 74 // In the host, this value is always NULL. |
| 74 const PPP_VideoCapture_Dev* ppp_video_capture_impl_; | 75 const PPP_VideoCapture_Dev* ppp_video_capture_impl_; |
| 75 | 76 |
| 76 DISALLOW_COPY_AND_ASSIGN(PPP_VideoCapture_Proxy); | 77 DISALLOW_COPY_AND_ASSIGN(PPP_VideoCapture_Proxy); |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 } // namespace proxy | 80 } // namespace proxy |
| 80 } // namespace ppapi | 81 } // namespace ppapi |
| 81 | 82 |
| 82 #endif // PPAPI_PPB_VIDEO_CAPTURE_PROXY_H_ | 83 #endif // PPAPI_PROXY_PPB_VIDEO_CAPTURE_PROXY_H_ |
| OLD | NEW |