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

Data Structures

struct  JackContext
 

Macros

#define MAX_JACK_CLIENT_NAME_SZ   128
 
#define JACK_PORT_NAME_MAX_SZ   128
 

Functions

static void Jack_cleanup (JackContext *ctx)
 
static int process_callback (jack_nframes_t nframes, void *arg)
 
static int onBufferSizeChanged (jack_nframes_t nframes, void *arg)
 
static GF_Err Jack_Setup (GF_AudioOutput *dr, void *os_handle, u32 num_buffers, u32 total_duration)
 
static void Jack_Shutdown (GF_AudioOutput *dr)
 
static GF_Err Jack_Configure (GF_AudioOutput *dr, u32 *SampleRate, u32 *NbChannels, u32 *audioFormat, u64 channel_cfg)
 
static void Jack_SetVolume (GF_AudioOutput *dr, u32 Volume)
 
static void Jack_SetPan (GF_AudioOutput *dr, u32 Pan)
 
static void Jack_SetPriority (GF_AudioOutput *dr, u32 Priority)
 
static u32 Jack_GetAudioDelay (GF_AudioOutput *dr)
 
static GF_Err Jack_QueryOutputSampleRate (GF_AudioOutput *dr, u32 *desired_sr, u32 *NbChannels, u32 *nbBitsPerSample)
 
void * NewJackOutput ()
 
void DeleteJackOutput (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 JackArgs []
 

Data Structure Documentation

◆ JackContext

struct JackContext
Data Fields
char jackClientName[MAX_JACK_CLIENT_NAME_SZ]
jack_client_t * jack
jack_port_t ** jackPorts
jack_nframes_t currentBlockSize
u32 numChannels
char * buffer
u32 bufferSz
u32 bytesPerSample
Bool isActive
Bool autoConnect
jack_default_audio_sample_t ** channels
float volume

Macro Definition Documentation

◆ MAX_JACK_CLIENT_NAME_SZ

#define MAX_JACK_CLIENT_NAME_SZ   128

◆ JACK_PORT_NAME_MAX_SZ

#define JACK_PORT_NAME_MAX_SZ   128

Function Documentation

◆ Jack_cleanup()

static void Jack_cleanup ( JackContext ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ process_callback()

static int process_callback ( jack_nframes_t  nframes,
void *  arg 
)
static

The callback called by the jack thread

+ Here is the caller graph for this function:

◆ onBufferSizeChanged()

static int onBufferSizeChanged ( jack_nframes_t  nframes,
void *  arg 
)
static

Called when jackbuffer size change

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Jack_Setup()

static GF_Err Jack_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:

◆ Jack_Shutdown()

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

◆ Jack_Configure()

static GF_Err Jack_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:

◆ Jack_SetVolume()

static void Jack_SetVolume ( GF_AudioOutput dr,
u32  Volume 
)
static
+ Here is the caller graph for this function:

◆ Jack_SetPan()

static void Jack_SetPan ( GF_AudioOutput dr,
u32  Pan 
)
static
+ Here is the caller graph for this function:

◆ Jack_SetPriority()

static void Jack_SetPriority ( GF_AudioOutput dr,
u32  Priority 
)
static

Jack manages the priority itself, we don't need to interfere here...

+ Here is the caller graph for this function:

◆ Jack_GetAudioDelay()

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

◆ Jack_QueryOutputSampleRate()

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

◆ NewJackOutput()

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

◆ DeleteJackOutput()

void DeleteJackOutput ( 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

◆ JackArgs

GF_GPACArg JackArgs[]
static
Initial value:
= {
GF_DEF_ARG("auto-connect", NULL, "automatically connect to jackd", "true", NULL, GF_ARG_BOOL, 0),
GF_DEF_ARG("start-server", NULL, "automatically start JACK server if not running", "true", NULL, GF_ARG_BOOL, 0),
{0},
}
#define GF_DEF_ARG(_a, _b, _c, _d, _e, _f, _g)
Definition: main.h:166
#define GF_ARG_BOOL
Definition: main.h:149