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