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