Pepper_47_C_interfaces
Public Attributes | List of all members
PPB_AudioInput_Dev_0_4 Struct Reference

#include <ppb_audio_input_dev.h>

Collaboration diagram for PPB_AudioInput_Dev_0_4:
Collaboration graph

Public Attributes

PP_Resource(* Create )(PP_Instance instance)
 
PP_Bool(* IsAudioInput )(PP_Resource resource)
 
int32_t(* EnumerateDevices )(PP_Resource audio_input, struct PP_ArrayOutput output, struct PP_CompletionCallback callback)
 
int32_t(* MonitorDeviceChange )(PP_Resource audio_input, PP_MonitorDeviceChangeCallback callback, void *user_data)
 
int32_t(* Open )(PP_Resource audio_input, PP_Resource device_ref, PP_Resource config, PPB_AudioInput_Callback audio_input_callback, void *user_data, struct PP_CompletionCallback callback)
 
PP_Resource(* GetCurrentConfig )(PP_Resource audio_input)
 
PP_Bool(* StartCapture )(PP_Resource audio_input)
 
PP_Bool(* StopCapture )(PP_Resource audio_input)
 
void(* Close )(PP_Resource audio_input)
 

Detailed Description

The PPB_AudioInput_Dev interface contains pointers to several functions for handling audio input resources.

TODO(brettw) before moving out of dev, we need to resolve the issue of the mismatch between the current audio config interface and this one.

In particular, the params for input assume stereo, but this class takes everything as mono. We either need to not use an audio config resource, or add mono support.

In addition, RecommendSampleFrameCount is completely wrong for audio input. RecommendSampleFrameCount returns the frame count for the current low-latency output device, which is likely inappropriate for a random input device. We may want to move the "recommend" functions to the input or output classes rather than the config.

Definition at line 80 of file ppb_audio_input_dev.h.

Member Data Documentation

void(* PPB_AudioInput_Dev_0_4::Close)(PP_Resource audio_input)

Closes the audio input device, and stops capturing if necessary. It is not valid to call Open() again after a call to this method. If an audio input resource is destroyed while a device is still open, then it will be implicitly closed, so you are not required to call this method.

Parameters
[in]audio_inputA PP_Resource corresponding to an audio input resource.

Definition at line 208 of file ppb_audio_input_dev.h.

PP_Resource(* PPB_AudioInput_Dev_0_4::Create)(PP_Instance instance)

Creates an audio input resource.

Parameters
[in]instanceA PP_Instance identifying one instance of a module.
Returns
A PP_Resource corresponding to an audio input resource if successful, 0 if failed.

Definition at line 90 of file ppb_audio_input_dev.h.

int32_t(* PPB_AudioInput_Dev_0_4::EnumerateDevices)(PP_Resource audio_input, struct PP_ArrayOutput output, struct PP_CompletionCallback callback)

Enumerates audio input devices.

Parameters
[in]audio_inputA PP_Resource corresponding to an audio input resource.
[in]outputAn output array which will receive PPB_DeviceRef_Dev resources on success. Please note that the ref count of those resources has already been increased by 1 for the caller.
[in]callbackA PP_CompletionCallback to run on completion.
Returns
An error code from pp_errors.h.

Definition at line 114 of file ppb_audio_input_dev.h.

PP_Resource(* PPB_AudioInput_Dev_0_4::GetCurrentConfig)(PP_Resource audio_input)

Returns an audio config resource for the given audio input resource.

Parameters
[in]audio_inputA PP_Resource corresponding to an audio input resource.
Returns
A PP_Resource containing the audio config resource if successful.

Definition at line 173 of file ppb_audio_input_dev.h.

PP_Bool(* PPB_AudioInput_Dev_0_4::IsAudioInput)(PP_Resource resource)

Determines if the given resource is an audio input resource.

Parameters
[in]resourceA PP_Resource containing a resource.
Returns
A PP_Bool containing PP_TRUE if the given resource is an audio input resource, otherwise PP_FALSE.

Definition at line 99 of file ppb_audio_input_dev.h.

int32_t(* PPB_AudioInput_Dev_0_4::MonitorDeviceChange)(PP_Resource audio_input, PP_MonitorDeviceChangeCallback callback, void *user_data)

Requests device change notifications.

Parameters
[in]audio_inputA PP_Resource corresponding to an audio input resource.
[in]callbackThe callback to receive notifications. If not NULL, it will be called once for the currently available devices, and then every time the list of available devices changes. All calls will happen on the same thread as the one on which MonitorDeviceChange() is called. It will receive notifications until audio_input is destroyed or MonitorDeviceChange() is called to set a new callback for audio_input. You can pass NULL to cancel sending notifications.
[in,out]user_dataAn opaque pointer that will be passed to callback.
Returns
An error code from pp_errors.h.

Definition at line 135 of file ppb_audio_input_dev.h.

int32_t(* PPB_AudioInput_Dev_0_4::Open)(PP_Resource audio_input, PP_Resource device_ref, PP_Resource config, PPB_AudioInput_Callback audio_input_callback, void *user_data, struct PP_CompletionCallback callback)

Opens an audio input device. No sound will be captured until StartCapture() is called.

Parameters
[in]audio_inputA PP_Resource corresponding to an audio input resource.
[in]device_refIdentifies an audio input device. It could be one of the resource in the array returned by EnumerateDevices(), or 0 which means the default device.
[in]configA PPB_AudioConfig audio configuration resource.
[in]audio_input_callbackA PPB_AudioInput_Callback function that will be called when data is available.
[in,out]user_dataAn opaque pointer that will be passed into audio_input_callback.
[in]callbackA PP_CompletionCallback to run when this open operation is completed.
Returns
An error code from pp_errors.h.

Definition at line 158 of file ppb_audio_input_dev.h.

PP_Bool(* PPB_AudioInput_Dev_0_4::StartCapture)(PP_Resource audio_input)

Starts the capture of the audio input resource and begins periodically calling the callback.

Parameters
[in]audio_inputA PP_Resource corresponding to an audio input resource.
Returns
A PP_Bool containing PP_TRUE if successful, otherwise PP_FALSE. Also returns PP_TRUE (and is a no-op) if called while capture is already started.

Definition at line 186 of file ppb_audio_input_dev.h.

PP_Bool(* PPB_AudioInput_Dev_0_4::StopCapture)(PP_Resource audio_input)

Stops the capture of the audio input resource.

Parameters
[in]audio_inputA PP_Resource containing the audio input resource.
Returns
A PP_Bool containing PP_TRUE if successful, otherwise PP_FALSE. Also returns PP_TRUE (and is a no-op) if called while capture is already stopped. If a buffer is being captured, StopCapture will block until the call completes.

Definition at line 198 of file ppb_audio_input_dev.h.


The documentation for this struct was generated from the following file: