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
3 // found in the LICENSE file.
4 
5 #ifndef PPAPI_THUNK_VIDEO_CAPTURE_API_H_
6 #define PPAPI_THUNK_VIDEO_CAPTURE_API_H_
7 
8 #include <stdint.h>
9 
10 #include <string>
11 #include <vector>
12 
13 #include "base/memory/ref_counted.h"
14 #include "ppapi/c/dev/ppb_video_capture_dev.h"
15 #include "ppapi/c/pp_array_output.h"
16 #include "ppapi/c/pp_resource.h"
17 
18 namespace ppapi {
19 
20 class TrackedCallback;
21 
22 namespace thunk {
23 
24 class PPB_VideoCapture_API {
25  public:
~PPB_VideoCapture_API()26   virtual ~PPB_VideoCapture_API() {}
27 
28   virtual int32_t EnumerateDevices(const PP_ArrayOutput& output,
29                                    scoped_refptr<TrackedCallback> callback) = 0;
30   virtual int32_t MonitorDeviceChange(PP_MonitorDeviceChangeCallback callback,
31                                       void* user_data) = 0;
32   virtual int32_t Open(const std::string& device_id,
33                        const PP_VideoCaptureDeviceInfo_Dev& requested_info,
34                        uint32_t buffer_count,
35                        scoped_refptr<TrackedCallback> callback) = 0;
36   virtual int32_t StartCapture() = 0;
37   virtual int32_t ReuseBuffer(uint32_t buffer) = 0;
38   virtual int32_t StopCapture() = 0;
39   virtual void Close() = 0;
40 
41   // This function is not exposed through the C API.  It is only used by flash
42   // to make synchronous device enumeration.
43   virtual int32_t EnumerateDevicesSync(const PP_ArrayOutput& devices) = 0;
44 };
45 
46 }  // namespace thunk
47 }  // namespace ppapi
48 
49 #endif  // PPAPI_THUNK_VIDEO_CAPTURE_API_H_
50