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_PPB_VIDEO_CAPTURE_PROXY_H_ |
6 #define PPAPI_PPB_VIDEO_CAPTURE_PROXY_H_ | 6 #define PPAPI_PPB_VIDEO_CAPTURE_PROXY_H_ |
7 | 7 |
8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
9 #include "ppapi/proxy/interface_proxy.h" | 9 #include "ppapi/proxy/interface_proxy.h" |
10 #include "ppapi/proxy/serialized_structs.h" | 10 #include "ppapi/proxy/serialized_structs.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class PPB_VideoCapture_Proxy : public InterfaceProxy { | 22 class PPB_VideoCapture_Proxy : public InterfaceProxy { |
23 public: | 23 public: |
24 PPB_VideoCapture_Proxy(Dispatcher* dispatcher); | 24 PPB_VideoCapture_Proxy(Dispatcher* dispatcher); |
25 virtual ~PPB_VideoCapture_Proxy(); | 25 virtual ~PPB_VideoCapture_Proxy(); |
26 | 26 |
27 static PP_Resource CreateProxyResource(PP_Instance instance); | 27 static PP_Resource CreateProxyResource(PP_Instance instance); |
28 | 28 |
29 // InterfaceProxy implementation. | 29 // InterfaceProxy implementation. |
30 virtual bool OnMessageReceived(const IPC::Message& msg); | 30 virtual bool OnMessageReceived(const IPC::Message& msg); |
31 | 31 |
32 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_VIDEO_CAPTURE_DEV; | 32 static const ApiID kApiID = API_ID_PPB_VIDEO_CAPTURE_DEV; |
33 | 33 |
34 private: | 34 private: |
35 // Message handlers. | 35 // Message handlers. |
36 void OnMsgCreate(PP_Instance instance, ppapi::HostResource* result_resource); | 36 void OnMsgCreate(PP_Instance instance, ppapi::HostResource* result_resource); |
37 void OnMsgStartCapture(const ppapi::HostResource& resource, | 37 void OnMsgStartCapture(const ppapi::HostResource& resource, |
38 const PP_VideoCaptureDeviceInfo_Dev& info, | 38 const PP_VideoCaptureDeviceInfo_Dev& info, |
39 uint32_t buffers); | 39 uint32_t buffers); |
40 void OnMsgReuseBuffer(const ppapi::HostResource& resource, | 40 void OnMsgReuseBuffer(const ppapi::HostResource& resource, |
41 uint32_t buffer); | 41 uint32_t buffer); |
42 void OnMsgStopCapture(const ppapi::HostResource& resource); | 42 void OnMsgStopCapture(const ppapi::HostResource& resource); |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(PPB_VideoCapture_Proxy); | 44 DISALLOW_COPY_AND_ASSIGN(PPB_VideoCapture_Proxy); |
45 }; | 45 }; |
46 | 46 |
47 class PPP_VideoCapture_Proxy : public InterfaceProxy { | 47 class PPP_VideoCapture_Proxy : public InterfaceProxy { |
48 public: | 48 public: |
49 PPP_VideoCapture_Proxy(Dispatcher* dispatcher); | 49 PPP_VideoCapture_Proxy(Dispatcher* dispatcher); |
50 virtual ~PPP_VideoCapture_Proxy(); | 50 virtual ~PPP_VideoCapture_Proxy(); |
51 | 51 |
52 static const Info* GetInfo(); | 52 static const Info* GetInfo(); |
53 | 53 |
54 // InterfaceProxy implementation. | 54 // InterfaceProxy implementation. |
55 virtual bool OnMessageReceived(const IPC::Message& msg); | 55 virtual bool OnMessageReceived(const IPC::Message& msg); |
56 | 56 |
57 static const InterfaceID kInterfaceID = INTERFACE_ID_PPP_VIDEO_CAPTURE_DEV; | 57 static const ApiID kApiID = API_ID_PPP_VIDEO_CAPTURE_DEV; |
58 | 58 |
59 private: | 59 private: |
60 // Message handlers. | 60 // Message handlers. |
61 void OnMsgOnDeviceInfo(const ppapi::HostResource& video_capture, | 61 void OnMsgOnDeviceInfo(const ppapi::HostResource& video_capture, |
62 const PP_VideoCaptureDeviceInfo_Dev& info, | 62 const PP_VideoCaptureDeviceInfo_Dev& info, |
63 const std::vector<PPPVideoCapture_Buffer>& buffers); | 63 const std::vector<PPPVideoCapture_Buffer>& buffers); |
64 void OnMsgOnStatus(const ppapi::HostResource& video_capture, | 64 void OnMsgOnStatus(const ppapi::HostResource& video_capture, |
65 uint32_t status); | 65 uint32_t status); |
66 void OnMsgOnError(const ppapi::HostResource& video_capture, | 66 void OnMsgOnError(const ppapi::HostResource& video_capture, |
67 uint32_t error_code); | 67 uint32_t error_code); |
68 void OnMsgOnBufferReady(const ppapi::HostResource& video_capture, | 68 void OnMsgOnBufferReady(const ppapi::HostResource& video_capture, |
69 uint32_t buffer); | 69 uint32_t buffer); |
70 | 70 |
71 // When this proxy is in the plugin side, this value caches the interface | 71 // When this proxy is in the plugin side, this value caches the interface |
72 // pointer so we don't have to retrieve it from the dispatcher each time. | 72 // pointer so we don't have to retrieve it from the dispatcher each time. |
73 // In the host, this value is always NULL. | 73 // In the host, this value is always NULL. |
74 const PPP_VideoCapture_Dev* ppp_video_capture_impl_; | 74 const PPP_VideoCapture_Dev* ppp_video_capture_impl_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(PPP_VideoCapture_Proxy); | 76 DISALLOW_COPY_AND_ASSIGN(PPP_VideoCapture_Proxy); |
77 }; | 77 }; |
78 | 78 |
79 } // namespace proxy | 79 } // namespace proxy |
80 } // namespace ppapi | 80 } // namespace ppapi |
81 | 81 |
82 #endif // PPAPI_PPB_VIDEO_CAPTURE_PROXY_H_ | 82 #endif // PPAPI_PPB_VIDEO_CAPTURE_PROXY_H_ |
OLD | NEW |