libgpac
Documentation of the core library of GPAC
out_audio.c File Reference
#include <gpac/filters.h>
#include <gpac/constants.h>
#include <gpac/modules/audio_out.h>
#include <gpac/thread.h>
+ Include dependency graph for out_audio.c:

Data Structures

struct  GF_AudioOutCtx
 

Macros

#define OFFS(_n)   #_n, offsetof(GF_AudioOutCtx, _n)
 

Functions

void aout_reconfig (GF_AudioOutCtx *ctx)
 
u32 aout_th_proc (void *p)
 
static u32 aout_fill_output (void *ptr, u8 *buffer, u32 buffer_size)
 
void aout_set_priority (GF_AudioOutCtx *ctx, u32 prio)
 
static GF_Err aout_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
static GF_Err aout_initialize (GF_Filter *filter)
 
static void aout_finalize (GF_Filter *filter)
 
static GF_Err aout_process (GF_Filter *filter)
 
static Bool aout_process_event (GF_Filter *filter, const GF_FilterEvent *evt)
 
GF_Err aout_update_arg (GF_Filter *filter, const char *arg_name, const GF_PropertyValue *new_val)
 
const GF_FilterRegister * aout_register (GF_FilterSession *session)
 

Variables

static const GF_FilterArgs AudioOutArgs []
 
static const GF_FilterCapability AudioOutCaps []
 
GF_FilterRegister AudioOutRegister
 

Data Structure Documentation

◆ GF_AudioOutCtx

struct GF_AudioOutCtx
+ Collaboration diagram for GF_AudioOutCtx:
Data Fields
char * drv
u32 bnum
u32 bdur
u32 threaded
u32 priority
Bool clock
GF_Fraction64 dur
Double speed
Double start
u32 vol
u32 pan
u32 buffer
u32 mbuffer
u32 rbuffer
GF_Fraction adelay
Double media_offset
GF_FilterPid * pid
u32 sr
u32 afmt
u32 nb_ch
u32 timescale
u64 ch_cfg
u32 cur_afmt
GF_AudioOutput * audio_out
Bool do_rem_pid
GF_Thread * th
u32 audio_th_state
Bool needs_recfg
Bool wait_recfg
u32 bytes_per_sample
u32 pck_offset
u64 first_cts
u64 last_cts
Bool aborted
u32 speed_set
GF_Filter * filter
Bool is_eos
Bool in_error
Bool first_write_done
s64 pid_delay
Bool buffer_done
Bool no_buffering
u64 hwdelay_us
u64 totaldelay_us
u64 rebuffer
Bool do_seek
u64 last_clock

Macro Definition Documentation

◆ OFFS

#define OFFS (   _n)    #_n, offsetof(GF_AudioOutCtx, _n)

Function Documentation

◆ aout_reconfig()

void aout_reconfig ( GF_AudioOutCtx ctx)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aout_th_proc()

u32 aout_th_proc ( void *  p)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aout_fill_output()

static u32 aout_fill_output ( void *  ptr,
u8 buffer,
u32  buffer_size 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aout_set_priority()

void aout_set_priority ( GF_AudioOutCtx ctx,
u32  prio 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aout_configure_pid()

static GF_Err aout_configure_pid ( GF_Filter *  filter,
GF_FilterPid *  pid,
Bool  is_remove 
)
static
+ Here is the call graph for this function:

◆ aout_initialize()

static GF_Err aout_initialize ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ aout_finalize()

static void aout_finalize ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ aout_process()

static GF_Err aout_process ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ aout_process_event()

static Bool aout_process_event ( GF_Filter *  filter,
const GF_FilterEvent *  evt 
)
static
+ Here is the call graph for this function:

◆ aout_update_arg()

GF_Err aout_update_arg ( GF_Filter *  filter,
const char *  arg_name,
const GF_PropertyValue *  new_val 
)
+ Here is the call graph for this function:

◆ aout_register()

const GF_FilterRegister* aout_register ( GF_FilterSession *  session)

Variable Documentation

◆ AudioOutArgs

const GF_FilterArgs AudioOutArgs[]
static
Initial value:
=
{
{ OFFS(drv), "audio driver name", GF_PROP_NAME, NULL, NULL, 0},
{ OFFS(bnum), "number of audio buffers (0 for auto)", GF_PROP_UINT, "2", NULL, 0},
{ OFFS(bdur), "total duration of all buffers in ms (0 for auto)", GF_PROP_UINT, "100", NULL, 0},
{ OFFS(threaded), "force dedicated thread creation if sound card driver is not threaded", GF_PROP_BOOL, "true", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(dur), "only play the specified duration", GF_PROP_FRACTION, "0", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(clock), "hint audio clock for this stream", GF_PROP_BOOL, "true", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(speed), "set playback speed. If speed is negative and start is 0, start is set to -1", GF_PROP_DOUBLE, "1.0", NULL, GF_FS_ARG_UPDATE},
{ OFFS(start), "set playback start offset. A negative value means percent of media duration with -1 equal to duration", GF_PROP_DOUBLE, "0.0", NULL, GF_FS_ARG_UPDATE},
{ OFFS(vol), "set default audio volume, as a percentage between 0 and 100", GF_PROP_UINT, "100", "0-100", GF_FS_ARG_UPDATE},
{ OFFS(pan), "set stereo pan, as a percentage between 0 and 100, 50 being centered", GF_PROP_UINT, "50", "0-100", GF_FS_ARG_UPDATE},
{ OFFS(buffer), "set playout buffer in ms", GF_PROP_UINT, "200", NULL, 0},
{ OFFS(mbuffer), "set max buffer occupancy in ms. If less than buffer, use buffer", GF_PROP_UINT, "0", NULL, 0},
{ OFFS(rbuffer), "rebuffer trigger in ms. If 0 or more than buffer, disable rebuffering", GF_PROP_UINT, "0", NULL, GF_FS_ARG_UPDATE},
{ OFFS(adelay), "set audio delay in sec", GF_PROP_FRACTION, "0", NULL, GF_FS_ARG_HINT_ADVANCED|GF_FS_ARG_UPDATE},
{ OFFS(buffer_done), "buffer done indication (readonly, for user app)", GF_PROP_BOOL, NULL, NULL, GF_ARG_HINT_EXPERT},
{ OFFS(rebuffer), "system time in us at which last rebuffer started, 0 if not rebuffering (readonly, for user app)", GF_PROP_LUINT, NULL, NULL, GF_ARG_HINT_EXPERT},
{ OFFS(media_offset), "media offset (substract this value to CTS to get media time - readonly)", GF_PROP_DOUBLE, "0", NULL, GF_FS_ARG_HINT_EXPERT},
{0}
}
@ GF_FS_ARG_HINT_EXPERT
Definition: filters.h:2104
@ GF_FS_ARG_UPDATE
Definition: filters.h:2108
@ GF_FS_ARG_HINT_ADVANCED
Definition: filters.h:2102
@ GF_PROP_BOOL
Definition: filters.h:858
@ GF_PROP_LUINT
Definition: filters.h:856
@ GF_PROP_DOUBLE
Definition: filters.h:866
@ GF_PROP_NAME
Definition: filters.h:884
@ GF_PROP_UINT
Definition: filters.h:852
@ GF_PROP_FRACTION
Definition: filters.h:860
#define GF_ARG_HINT_EXPERT
Definition: main.h:123
#define OFFS(_n)
Definition: out_audio.c:757

◆ AudioOutCaps

const GF_FilterCapability AudioOutCaps[]
static
Initial value:
=
{
}
@ GF_CODECID_RAW
Definition: constants.h:600
@ GF_STREAM_AUDIO
Definition: constants.h:66
#define CAP_UINT(_f, _a, _b)
Definition: filters.h:2172
#define GF_CAPS_INPUT
Definition: filters.h:2220
@ GF_PROP_PID_CODECID
Definition: filters.h:1116
@ GF_PROP_PID_STREAM_TYPE
Definition: filters.h:1112

◆ AudioOutRegister

GF_FilterRegister AudioOutRegister
Initial value:
= {
.name = "aout",
GF_FS_SET_HELP("This filter writes a single PCM (uncompressed) audio input PID to a sound card or other audio output device.\n"
"\n"
"The longer the audio buffering [-bdur]() is, the longer the audio latency will be (pause/resume). The quality of fast forward audio playback will also be degraded when using large audio buffers.\n"
"\n"
"If [-clock]() is set, the filter will report system time (in us) and corresponding packet CTS for other filters to use for AV sync.\n")
.private_size = sizeof(GF_AudioOutCtx),
.initialize = aout_initialize,
.finalize = aout_finalize,
.configure_pid = aout_configure_pid,
.process = aout_process,
.process_event = aout_process_event,
.update_arg = aout_update_arg,
.hint_class_type = GF_FS_CLASS_MM_IO
}
#define GF_FS_SET_HELP(_help)
Definition: filters.h:2372
#define SETCAPS(__struct)
Definition: filters.h:2364
@ GF_FS_CLASS_MM_IO
Definition: filters.h:2447
attribute Array args
Definition: jsf.idl:24
static GF_Err aout_configure_pid(GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
Definition: out_audio.c:433
GF_Err aout_update_arg(GF_Filter *filter, const char *arg_name, const GF_PropertyValue *new_val)
Definition: out_audio.c:720
static Bool aout_process_event(GF_Filter *filter, const GF_FilterEvent *evt)
Definition: out_audio.c:699
static GF_Err aout_process(GF_Filter *filter)
Definition: out_audio.c:665
static GF_Err aout_initialize(GF_Filter *filter)
Definition: out_audio.c:577
static const GF_FilterArgs AudioOutArgs[]
Definition: out_audio.c:759
static const GF_FilterCapability AudioOutCaps[]
Definition: out_audio.c:781
static void aout_finalize(GF_Filter *filter)
Definition: out_audio.c:638
Definition: out_audio.c:35