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_AUDIO_INPUT_API_H_ | 5 #ifndef PPAPI_THUNK_AUDIO_INPUT_API_H_ |
6 #define PPAPI_THUNK_AUDIO_INPUT_API_H_ | 6 #define PPAPI_THUNK_AUDIO_INPUT_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_audio_input_dev.h" | 12 #include "ppapi/c/dev/ppb_audio_input_dev.h" |
13 #include "ppapi/c/pp_completion_callback.h" | 13 #include "ppapi/c/pp_completion_callback.h" |
14 #include "ppapi/thunk/ppapi_thunk_export.h" | 14 #include "ppapi/thunk/ppapi_thunk_export.h" |
15 | 15 |
16 namespace ppapi { | 16 namespace ppapi { |
17 | 17 |
18 struct DeviceRefData; | 18 struct DeviceRefData; |
19 class TrackedCallback; | 19 class TrackedCallback; |
20 | 20 |
21 namespace thunk { | 21 namespace thunk { |
22 | 22 |
23 class PPAPI_THUNK_EXPORT PPB_AudioInput_API { | 23 class PPAPI_THUNK_EXPORT PPB_AudioInput_API { |
24 public: | 24 public: |
25 virtual ~PPB_AudioInput_API() {} | 25 virtual ~PPB_AudioInput_API() {} |
26 | 26 |
27 virtual int32_t EnumerateDevices(PP_Resource* devices, | 27 virtual int32_t EnumerateDevices(PP_Resource* devices, |
28 scoped_refptr<TrackedCallback> callback) = 0; | 28 scoped_refptr<TrackedCallback> callback) = 0; |
| 29 virtual int32_t StopEnumerateDevices(PP_Resource* devices) = 0; |
29 virtual int32_t Open(const std::string& device_id, | 30 virtual int32_t Open(const std::string& device_id, |
30 PP_Resource config, | 31 PP_Resource config, |
31 PPB_AudioInput_Callback audio_input_callback, | 32 PPB_AudioInput_Callback audio_input_callback, |
32 void* user_data, | 33 void* user_data, |
33 scoped_refptr<TrackedCallback> callback) = 0; | 34 scoped_refptr<TrackedCallback> callback) = 0; |
34 virtual PP_Resource GetCurrentConfig() = 0; | 35 virtual PP_Resource GetCurrentConfig() = 0; |
35 virtual PP_Bool StartCapture() = 0; | 36 virtual PP_Bool StartCapture() = 0; |
36 virtual PP_Bool StopCapture() = 0; | 37 virtual PP_Bool StopCapture() = 0; |
37 virtual void Close() = 0; | 38 virtual void Close() = 0; |
38 | 39 |
39 // Trusted API. | 40 // Trusted API. |
40 virtual int32_t OpenTrusted( | 41 virtual int32_t OpenTrusted( |
41 const std::string& device_id, | 42 const std::string& device_id, |
42 PP_Resource config, | 43 PP_Resource config, |
43 scoped_refptr<TrackedCallback> create_callback) = 0; | 44 scoped_refptr<TrackedCallback> create_callback) = 0; |
44 virtual int32_t GetSyncSocket(int* sync_socket) = 0; | 45 virtual int32_t GetSyncSocket(int* sync_socket) = 0; |
45 virtual int32_t GetSharedMemory(int* shm_handle, uint32_t* shm_size) = 0; | 46 virtual int32_t GetSharedMemory(int* shm_handle, uint32_t* shm_size) = 0; |
46 virtual const std::vector<DeviceRefData>& GetDeviceRefData() const = 0; | 47 virtual const std::vector<DeviceRefData>& GetDeviceRefData() const = 0; |
47 }; | 48 }; |
48 | 49 |
49 } // namespace thunk | 50 } // namespace thunk |
50 } // namespace ppapi | 51 } // namespace ppapi |
51 | 52 |
52 #endif // PPAPI_THUNK_AUDIO_INPUT_API_H_ | 53 #endif // PPAPI_THUNK_AUDIO_INPUT_API_H_ |
OLD | NEW |