OLD | NEW |
---|---|
1 // Copyright (c) 2011 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_CPP_DEV_VIDEO_CAPTURE_DEV_H_ | 5 #ifndef PPAPI_CPP_DEV_VIDEO_CAPTURE_DEV_H_ |
6 #define PPAPI_CPP_DEV_VIDEO_CAPTURE_DEV_H_ | 6 #define PPAPI_CPP_DEV_VIDEO_CAPTURE_DEV_H_ |
7 | 7 |
8 #include <vector> | |
9 | |
8 #include "ppapi/c/dev/pp_video_capture_dev.h" | 10 #include "ppapi/c/dev/pp_video_capture_dev.h" |
9 #include "ppapi/cpp/resource.h" | 11 #include "ppapi/cpp/resource.h" |
10 | 12 |
11 namespace pp { | 13 namespace pp { |
12 | 14 |
15 class CompletionCallback; | |
16 class DeviceRef_Dev; | |
13 class Instance; | 17 class Instance; |
14 | 18 |
15 class VideoCapture_Dev : public Resource { | 19 class VideoCapture_Dev : public Resource { |
16 public: | 20 public: |
17 explicit VideoCapture_Dev(const Instance& instance); | 21 explicit VideoCapture_Dev(const Instance& instance); |
18 VideoCapture_Dev(PP_Resource resource); | 22 VideoCapture_Dev(PP_Resource resource); |
19 VideoCapture_Dev(const VideoCapture_Dev& other); | 23 VideoCapture_Dev(const VideoCapture_Dev& other); |
20 | 24 |
21 // Returns true if the required interface is available. | 25 // Returns true if the required interface is available. |
22 static bool IsAvailable(); | 26 static bool IsAvailable(); |
23 | 27 |
24 int32_t StartCapture(const PP_VideoCaptureDeviceInfo_Dev& requested_info, | 28 int32_t EnumerateDevices(const CompletionCallback& callback); |
29 void GetDevices(std::vector<DeviceRef_Dev>* devices); | |
brettw
2012/02/06 21:51:52
My previous suggestion about combining these two f
yzshen1
2012/02/06 22:42:56
Do you mean you was trying to write a completion c
yzshen1
2012/02/10 07:10:44
I finally decided to write into a std::vector<> ou
| |
30 // If |device_ref| is null (i.e., is_null() returns true), the default device | |
31 // will be used. | |
32 int32_t StartCapture(const DeviceRef_Dev& device_ref, | |
33 const PP_VideoCaptureDeviceInfo_Dev& requested_info, | |
25 uint32_t buffer_count); | 34 uint32_t buffer_count); |
26 int32_t ReuseBuffer(uint32_t buffer); | 35 int32_t ReuseBuffer(uint32_t buffer); |
27 int32_t StopCapture(); | 36 int32_t StopCapture(); |
28 }; | 37 }; |
29 | 38 |
30 } // namespace pp | 39 } // namespace pp |
31 | 40 |
32 #endif // PPAPI_CPP_DEV_VIDEO_CAPTURE_DEV_H_ | 41 #endif // PPAPI_CPP_DEV_VIDEO_CAPTURE_DEV_H_ |
OLD | NEW |