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