Data Structures | |
| struct | RMF_AudioCapture_Settings |
| Configuration parameters of audio capture interface. More... | |
| struct | RMF_AudioCapture_Status |
| Status of audio capture interface. More... | |
Macros | |
| #define | RMF_ERROR (1) |
| #define | RMF_INVALID_PARM (2) |
| #define | RMF_AC_TYPE_PRIMARY "primary" |
| Primary audio that is currently selected to play with video. | |
| #define | RMF_AC_TYPE_AUXILIARY "auxiliary" |
| Audio source that is different from primary audio - can be audio track with a different language. | |
Typedefs | |
| typedef struct RMF_AudioCapture_Struct * | RMF_AudioCaptureHandle |
| Opaque handle to an instance of RMF AudioCapture interface. | |
| typedef char * | RMF_AudioCaptureType |
| Audio source to be captured. Options are RMF_AC_TYPE_PRIMARY or RMF_AC_TYPE_AUXILIARY. | |
| typedef enum RMF_AudioCapture_Format | racFormat |
| Describes more specifics about the audio parameters to be used for audio samples. | |
| typedef enum RMF_AudioCapture_Freq | racFreq |
| Audio sampling rate. | |
| typedef rmf_Error(* | RMF_AudioCaptureBufferReadyCb) (void *cbBufferReadyParm, void *AudioCaptureBuffer, unsigned int AudioCaptureBufferSize) |
| Callbacks. | |
| typedef rmf_Error(* | RMF_AudioCapture_StatusChangeCb) (void *cbStatusParm) |
| Callback for underlying implementation to signal a change in status. | |
| typedef struct RMF_AudioCapture_Settings | RMF_AudioCapture_Settings |
| Configuration parameters of audio capture interface. | |
| typedef struct RMF_AudioCapture_Status | RMF_AudioCapture_Status |
| Status of audio capture interface. | |
Enumerations | |
| enum | RMF_AudioCapture_Format { racFormat_e16BitStereo , racFormat_e24BitStereo , racFormat_e16BitMonoLeft , racFormat_e16BitMonoRight , racFormat_e16BitMono , racFormat_e24Bit5_1 , racFormat_eMax } |
| Describes more specifics about the audio parameters to be used for audio samples. More... | |
| enum | RMF_AudioCapture_Freq { racFreq_e16000 , racFreq_e22050 , racFreq_e24000 , racFreq_e32000 , racFreq_e44100 , racFreq_e48000 , racFreq_eMax } |
| Audio sampling rate. More... | |
Functions | |
| rmf_Error | RMF_AudioCapture_Open (RMF_AudioCaptureHandle *handle) |
| Opens the audio capture interface for primary audio. | |
| rmf_Error | RMF_AudioCapture_Open_Type (RMF_AudioCaptureHandle *handle, RMF_AudioCaptureType rmfAcType) |
| Opens the audio capture interface for specified audio source. | |
| rmf_Error | RMF_AudioCapture_GetStatus (RMF_AudioCaptureHandle handle, RMF_AudioCapture_Status *status) |
| Gets the current status of audio capture interface. | |
| rmf_Error | RMF_AudioCapture_GetDefaultSettings (RMF_AudioCapture_Settings *settings) |
| Returns friendly default values for RMF_AudioCapture_Settings. | |
| rmf_Error | RMF_AudioCapture_GetCurrentSettings (RMF_AudioCaptureHandle handle, RMF_AudioCapture_Settings *settings) |
| Returns current values of RMF_AudioCapture_Settings in effect. | |
| rmf_Error | RMF_AudioCapture_Start (RMF_AudioCaptureHandle handle, RMF_AudioCapture_Settings *settings) |
| Starts audio capture. | |
| rmf_Error | RMF_AudioCapture_Stop (RMF_AudioCaptureHandle handle) |
| Stops audio capture. | |
| rmf_Error | RMF_AudioCapture_Close (RMF_AudioCaptureHandle handle) |
| Closes the audio capture interface. | |
| #define RMF_AC_TYPE_AUXILIARY "auxiliary" |
Audio source that is different from primary audio - can be audio track with a different language.
| #define RMF_AC_TYPE_PRIMARY "primary" |
Primary audio that is currently selected to play with video.
| #define RMF_ERROR (1) |
| #define RMF_INVALID_PARM (2) |
| typedef enum RMF_AudioCapture_Format racFormat |
Describes more specifics about the audio parameters to be used for audio samples.
| typedef enum RMF_AudioCapture_Freq racFreq |
Audio sampling rate.
| typedef struct RMF_AudioCapture_Settings RMF_AudioCapture_Settings |
Configuration parameters of audio capture interface.
| typedef struct RMF_AudioCapture_Status RMF_AudioCapture_Status |
Status of audio capture interface.
| typedef rmf_Error(* RMF_AudioCapture_StatusChangeCb) (void *cbStatusParm) |
Callback for underlying implementation to signal a change in status.
RDK may then call RMF_AudioCapture_GetStatus() to get more details
| [in] | cbStatusParm | - Caller context data passed back (optional) in the callback |
| RMF_ERROR | General error |
| RMF_INVALID_PARM | Invalid parameter |
| typedef rmf_Error(* RMF_AudioCaptureBufferReadyCb) (void *cbBufferReadyParm, void *AudioCaptureBuffer, unsigned int AudioCaptureBufferSize) |
Callbacks.
Callback via which SoC will send captured audio samples
The callback will not take ownership of AudioCaptureBuffer. It will consume the audio data completely before returning and it is the responsibility of the caller to free/manage this memory.
| [in] | cbBufferReadyParm | - Caller context data passed back (optional) in the callback |
| [in] | AudioCaptureBuffer | - Pointer to the buffer holding audio data |
| [in] | AudioCaptureBufferSize | - Size of audio data available in buffer |
| RMF_ERROR | General error |
| RMF_INVALID_PARM | Invalid parameter |
| typedef struct RMF_AudioCapture_Struct* RMF_AudioCaptureHandle |
Opaque handle to an instance of RMF AudioCapture interface.
| typedef char* RMF_AudioCaptureType |
Audio source to be captured. Options are RMF_AC_TYPE_PRIMARY or RMF_AC_TYPE_AUXILIARY.
Describes more specifics about the audio parameters to be used for audio samples.
| rmf_Error RMF_AudioCapture_Close | ( | RMF_AudioCaptureHandle | handle | ) |
Closes the audio capture interface.
This call must free all resources acquired since RMF_AudioCapture_Open() call and will invalidate the handle. The caller will not go directly from STARTED to CLOSED state; it will call stop beforehand. RMF_AudioCapture may choose to open the interface again using RMF_AudioCapture_Open() in future.
| [in] | handle | - Handle of the audio capture interface. |
| RMF_ERROR | General error |
| rmf_Error RMF_AudioCapture_GetCurrentSettings | ( | RMF_AudioCaptureHandle | handle, |
| RMF_AudioCapture_Settings * | settings ) |
Returns current values of RMF_AudioCapture_Settings in effect.
The output should match the configuration previously set successfully via RMF_AudioCapture_Start()
| [in] | handle | - Handle of the audio capture interface. |
| [out] | settings | - current values of audio capture Settings. The life-cycle of settings will be managed by the caller. |
| RMF_ERROR | General error |
| RMF_INVALID_PARM | Invalid parameter |
| rmf_Error RMF_AudioCapture_GetDefaultSettings | ( | RMF_AudioCapture_Settings * | settings | ) |
Returns friendly default values for RMF_AudioCapture_Settings.
Caller will use this to understand what audio-related parameters preferable for this interface. Caller may then use this structure as a baseline and tweak only stricly necessary parameters before passing it with RMF_AudioCapture_Start(). The defaults are not expected to change no matter how the capture interface was configured by caller previously (if at all). Caller will only call this API when the interface is in OPEN or STARTED state.
| [out] | settings | - Default values for audio capture settings. The life-cycle of settings will be managed by the caller. |
| RMF_ERROR | General error |
| RMF_INVALID_PARM | Invalid parameter |
| rmf_Error RMF_AudioCapture_GetStatus | ( | RMF_AudioCaptureHandle | handle, |
| RMF_AudioCapture_Status * | status ) |
Gets the current status of audio capture interface.
This API can be called as long as a valid handle is available (after opening and before close). API may be invoked as a resonse to RMF_AudioCapture_StatusChangeCb(), possibly inside the callback itself.
| [in] | handle | - Handle of the audio capture interface. |
| [out] | status | - Status returned by the underlying implementation. The life-cycle of status will be managed by the caller. |
| RMF_ERROR | General error |
| RMF_INVALID_PARM | Invalid parameter |
| rmf_Error RMF_AudioCapture_Open | ( | RMF_AudioCaptureHandle * | handle | ) |
Opens the audio capture interface for primary audio.
This function or RMF_AudioCapture_Open_Type() will be the first call when this library is used. Any other interface exposed by this library. Underlying implementation must acquire the necessary hardware and software resources necessary to capture audio. RMF_AudioCapture doesn't expect more than one primary capture session to be available concurrently and will close the open session before calling open again.
| [out] | handle | - An opaque capture interface handle, which should not be modified by caller and has to be passed as an argument for all subsequent API calls. |
| RMF_ERROR | General error |
| RMF_INVALID_PARM | Invalid parameter |
| rmf_Error RMF_AudioCapture_Open_Type | ( | RMF_AudioCaptureHandle * | handle, |
| RMF_AudioCaptureType | rmfAcType ) |
Opens the audio capture interface for specified audio source.
This function or RMF_AudioCapture_Open() will be the first call when this library is used. Underlying implementation must acquire the necessary hardware and software resources to capture audio. RMF_AudioCapture may have both primary and auxiliary capture sessions open at the same time. There will not be more than one capture session open for the same capture type at any point of time.
| [out] | handle | - An opaque capture interface handle, which should not be modified by caller and has to be passed as an argument for all subsequent API calls. |
| [in] | rmfAcType | - Source of audio to be captured (primary or auxiliary). |
| RMF_ERROR | General error |
| RMF_INVALID_PARM | Invalid parameter |
| rmf_Error RMF_AudioCapture_Start | ( | RMF_AudioCaptureHandle | handle, |
| RMF_AudioCapture_Settings * | settings ) |
Starts audio capture.
HAL must apply the new settings before starting audio capture. Underlying implementation must invoke RMF_AudioCaptureBufferReadyCb() repeatedly to deliver the data in accordance with the FIFO thresholds set. This process must continue until RMF_AudioCapture_Stop() is called. Once stopped, RMF_AudioCapture may call RMF_AudioCapture_Start() again so long as RMF_AudioCapture_Close() hasn't been invoked yet. settings.cbBufferReady is not allowed to be NULL.
| [in] | handle | - Handle of the audio capture interface. |
| [in] | settings | - Capture settings to use. The life-cycle of settings will be managed by the caller. |
| RMF_ERROR | General error |
| RMF_INVALID_PARM | Invalid settings |
| rmf_Error RMF_AudioCapture_Stop | ( | RMF_AudioCaptureHandle | handle | ) |
Stops audio capture.
Underlying implementation must no longer generate RMF_AudioCaptureBufferReadyCb() calls after this. Caller may choose to call RMF_AudioCapture_Start() again to restart capture as long as RMF_AudioCapture_Close() hasn't been called.
| [in] | handle | - Handle of the audio capture interface. |
| RMF_ERROR | General error. |