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