| 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 WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_INPUT_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_INPUT_IMPL_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_INPUT_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_INPUT_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // and will return 0 on failure. | 32 // and will return 0 on failure. |
| 33 static PP_Resource Create0_1(PP_Instance instance, | 33 static PP_Resource Create0_1(PP_Instance instance, |
| 34 PP_Resource config, | 34 PP_Resource config, |
| 35 PPB_AudioInput_Callback audio_input_callback, | 35 PPB_AudioInput_Callback audio_input_callback, |
| 36 void* user_data); | 36 void* user_data); |
| 37 | 37 |
| 38 // Implementation of PPB_AudioInput_API trusted methods. | 38 // Implementation of PPB_AudioInput_API trusted methods. |
| 39 virtual int32_t OpenTrusted( | 39 virtual int32_t OpenTrusted( |
| 40 const std::string& device_id, | 40 const std::string& device_id, |
| 41 PP_Resource config, | 41 PP_Resource config, |
| 42 const PP_CompletionCallback& create_callback) OVERRIDE; | 42 scoped_refptr< ::ppapi::TrackedCallback> create_callback) OVERRIDE; |
| 43 virtual int32_t GetSyncSocket(int* sync_socket) OVERRIDE; | 43 virtual int32_t GetSyncSocket(int* sync_socket) OVERRIDE; |
| 44 virtual int32_t GetSharedMemory(int* shm_handle, uint32_t* shm_size) OVERRIDE; | 44 virtual int32_t GetSharedMemory(int* shm_handle, uint32_t* shm_size) OVERRIDE; |
| 45 virtual const DeviceRefDataVector& GetDeviceRefData() const OVERRIDE; | 45 virtual const DeviceRefDataVector& GetDeviceRefData() const OVERRIDE; |
| 46 | 46 |
| 47 // PluginDelegate::PlatformAudioInputClient implementation. | 47 // PluginDelegate::PlatformAudioInputClient implementation. |
| 48 virtual void StreamCreated(base::SharedMemoryHandle shared_memory_handle, | 48 virtual void StreamCreated(base::SharedMemoryHandle shared_memory_handle, |
| 49 size_t shared_memory_size, | 49 size_t shared_memory_size, |
| 50 base::SyncSocket::Handle socket) OVERRIDE; | 50 base::SyncSocket::Handle socket) OVERRIDE; |
| 51 virtual void StreamCreationFailed() OVERRIDE; | 51 virtual void StreamCreationFailed() OVERRIDE; |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 // PPB_AudioInput_Shared implementation. | 54 // PPB_AudioInput_Shared implementation. |
| 55 virtual int32_t InternalEnumerateDevices( | 55 virtual int32_t InternalEnumerateDevices( |
| 56 PP_Resource* devices, | 56 PP_Resource* devices, |
| 57 PP_CompletionCallback callback) OVERRIDE; | 57 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE; |
| 58 virtual int32_t InternalOpen(const std::string& device_id, | 58 virtual int32_t InternalOpen( |
| 59 PP_AudioSampleRate sample_rate, | 59 const std::string& device_id, |
| 60 uint32_t sample_frame_count, | 60 PP_AudioSampleRate sample_rate, |
| 61 PP_CompletionCallback callback) OVERRIDE; | 61 uint32_t sample_frame_count, |
| 62 scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE; |
| 62 virtual PP_Bool InternalStartCapture() OVERRIDE; | 63 virtual PP_Bool InternalStartCapture() OVERRIDE; |
| 63 virtual PP_Bool InternalStopCapture() OVERRIDE; | 64 virtual PP_Bool InternalStopCapture() OVERRIDE; |
| 64 virtual void InternalClose() OVERRIDE; | 65 virtual void InternalClose() OVERRIDE; |
| 65 | 66 |
| 66 void EnumerateDevicesCallbackFunc(int request_id, | 67 void EnumerateDevicesCallbackFunc(int request_id, |
| 67 bool succeeded, | 68 bool succeeded, |
| 68 const DeviceRefDataVector& devices); | 69 const DeviceRefDataVector& devices); |
| 69 | 70 |
| 70 // PluginDelegate audio input object that we delegate audio IPC through. | 71 // PluginDelegate audio input object that we delegate audio IPC through. |
| 71 // We don't own this pointer but are responsible for calling Shutdown on it. | 72 // We don't own this pointer but are responsible for calling Shutdown on it. |
| 72 PluginDelegate::PlatformAudioInput* audio_input_; | 73 PluginDelegate::PlatformAudioInput* audio_input_; |
| 73 | 74 |
| 74 DeviceRefDataVector devices_data_; | 75 DeviceRefDataVector devices_data_; |
| 75 | 76 |
| 76 DISALLOW_COPY_AND_ASSIGN(PPB_AudioInput_Impl); | 77 DISALLOW_COPY_AND_ASSIGN(PPB_AudioInput_Impl); |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 } // namespace ppapi | 80 } // namespace ppapi |
| 80 } // namespace webkit | 81 } // namespace webkit |
| 81 | 82 |
| 82 #endif // WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_INPUT_IMPL_H_ | 83 #endif // WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_INPUT_IMPL_H_ |
| OLD | NEW |