OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_THUNK_VIDEO_CAPTURE_API_H_ | 5 #ifndef PPAPI_THUNK_VIDEO_CAPTURE_API_H_ |
6 #define PPAPI_THUNK_VIDEO_CAPTURE_API_H_ | 6 #define PPAPI_THUNK_VIDEO_CAPTURE_API_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ppapi/c/dev/ppb_video_capture_dev.h" | 11 #include "ppapi/c/dev/ppb_video_capture_dev.h" |
| 12 #include "ppapi/shared_impl/api_callback_type.h" |
12 | 13 |
13 namespace ppapi { | 14 namespace ppapi { |
14 | 15 |
15 struct DeviceRefData; | 16 struct DeviceRefData; |
16 | 17 |
17 namespace thunk { | 18 namespace thunk { |
18 | 19 |
19 class PPB_VideoCapture_API { | 20 class PPB_VideoCapture_API { |
20 public: | 21 public: |
21 virtual ~PPB_VideoCapture_API() {} | 22 virtual ~PPB_VideoCapture_API() {} |
22 | 23 |
23 virtual int32_t EnumerateDevices(PP_Resource* devices, | 24 virtual int32_t EnumerateDevices(PP_Resource* devices, |
24 const PP_CompletionCallback& callback) = 0; | 25 ApiCallbackType callback) = 0; |
25 virtual int32_t Open(const std::string& device_id, | 26 virtual int32_t Open(const std::string& device_id, |
26 const PP_VideoCaptureDeviceInfo_Dev& requested_info, | 27 const PP_VideoCaptureDeviceInfo_Dev& requested_info, |
27 uint32_t buffer_count, | 28 uint32_t buffer_count, |
28 const PP_CompletionCallback& callback) = 0; | 29 ApiCallbackType callback) = 0; |
29 virtual int32_t StartCapture() = 0; | 30 virtual int32_t StartCapture() = 0; |
30 virtual int32_t ReuseBuffer(uint32_t buffer) = 0; | 31 virtual int32_t ReuseBuffer(uint32_t buffer) = 0; |
31 virtual int32_t StopCapture() = 0; | 32 virtual int32_t StopCapture() = 0; |
32 virtual void Close() = 0; | 33 virtual void Close() = 0; |
33 | 34 |
34 // For backward compatibility. | 35 // For backward compatibility. |
35 virtual int32_t StartCapture0_1( | 36 virtual int32_t StartCapture0_1( |
36 const PP_VideoCaptureDeviceInfo_Dev& requested_info, | 37 const PP_VideoCaptureDeviceInfo_Dev& requested_info, |
37 uint32_t buffer_count) = 0; | 38 uint32_t buffer_count) = 0; |
38 | 39 |
39 // This function is not exposed through the C API, but returns the internal | 40 // This function is not exposed through the C API, but returns the internal |
40 // data for easy proxying. | 41 // data for easy proxying. |
41 virtual const std::vector<DeviceRefData>& GetDeviceRefData() const = 0; | 42 virtual const std::vector<DeviceRefData>& GetDeviceRefData() const = 0; |
42 }; | 43 }; |
43 | 44 |
44 } // namespace thunk | 45 } // namespace thunk |
45 } // namespace ppapi | 46 } // namespace ppapi |
46 | 47 |
47 #endif // PPAPI_THUNK_VIDEO_CAPTURE_API_H_ | 48 #endif // PPAPI_THUNK_VIDEO_CAPTURE_API_H_ |
OLD | NEW |