libgpac
Documentation of the core library of GPAC
alsa.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <poll.h>
#include <alsa/asoundlib.h>
#include <gpac/modules/audio_out.h>
+ Include dependency graph for alsa.c:

Data Structures

struct  ALSAContext
 

Functions

static GF_Err ALSA_Setup (GF_AudioOutput *dr, void *os_handle, u32 num_buffers, u32 total_duration)
 
static void ALSA_Shutdown (GF_AudioOutput *dr)
 
static GF_Err ALSA_Configure (GF_AudioOutput *dr, u32 *SampleRate, u32 *NbChannels, u32 *audioFormat, u64 channel_cfg)
 
static void ALSA_WriteAudio (GF_AudioOutput *dr)
 
static u32 ALSA_GetAudioDelay (GF_AudioOutput *dr)
 
static GF_Err ALSA_QueryOutputSampleRate (GF_AudioOutput *dr, u32 *desired_sr, u32 *NbChannels, u32 *nbBitsPerSample)
 
void * NewALSAOutput ()
 
void DeleteALSAOutput (void *ifce)
 
GPAC_MODULE_EXPORT const u32QueryInterfaces ()
 
GPAC_MODULE_EXPORT GF_BaseInterfaceLoadInterface (u32 InterfaceType)
 
GPAC_MODULE_EXPORT void ShutdownInterface (GF_BaseInterface *ifce)
 

Variables

static GF_GPACArg ALSAArgs []
 

Data Structure Documentation

◆ ALSAContext

struct ALSAContext
Data Fields
snd_pcm_t * playback_handle
u32 nb_ch
u32 buf_size
u32 delay
u32 num_buffers
u32 total_duration
u32 block_align
u32 force_sr
const char * dev_name
char * wav_buf

Function Documentation

◆ ALSA_Setup()

static GF_Err ALSA_Setup ( GF_AudioOutput dr,
void *  os_handle,
u32  num_buffers,
u32  total_duration 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ALSA_Shutdown()

static void ALSA_Shutdown ( GF_AudioOutput dr)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ALSA_Configure()

static GF_Err ALSA_Configure ( GF_AudioOutput dr,
u32 SampleRate,
u32 NbChannels,
u32 audioFormat,
u64  channel_cfg 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ALSA_WriteAudio()

static void ALSA_WriteAudio ( GF_AudioOutput dr)
static
+ Here is the caller graph for this function:

◆ ALSA_GetAudioDelay()

static u32 ALSA_GetAudioDelay ( GF_AudioOutput dr)
static
+ Here is the caller graph for this function:

◆ ALSA_QueryOutputSampleRate()

static GF_Err ALSA_QueryOutputSampleRate ( GF_AudioOutput dr,
u32 desired_sr,
u32 NbChannels,
u32 nbBitsPerSample 
)
static
+ Here is the caller graph for this function:

◆ NewALSAOutput()

void* NewALSAOutput ( )
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeleteALSAOutput()

void DeleteALSAOutput ( void *  ifce)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ QueryInterfaces()

GPAC_MODULE_EXPORT const u32* QueryInterfaces ( )

◆ LoadInterface()

GPAC_MODULE_EXPORT GF_BaseInterface* LoadInterface ( u32  InterfaceType)
+ Here is the call graph for this function:

◆ ShutdownInterface()

GPAC_MODULE_EXPORT void ShutdownInterface ( GF_BaseInterface ifce)
+ Here is the call graph for this function:

Variable Documentation

◆ ALSAArgs

GF_GPACArg ALSAArgs[]
static
Initial value:
= {
GF_DEF_ARG("devname", NULL, "alsa device name", "hw:0,0", NULL, GF_ARG_STRING, 0),
GF_DEF_ARG("force-rate", NULL, "force alsa sample rate", "0", NULL, GF_ARG_INT, 0),
{0},
}
#define GF_ARG_STRING
Definition: main.h:155
#define GF_ARG_INT
Definition: main.h:151
#define GF_DEF_ARG(_a, _b, _c, _d, _e, _f, _g)
Definition: main.h:166