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