Hook Extension

Overview

See the PCM (digital audio) interface page for more details. Moreā€¦

// typedefs

typedef struct _snd_pcm_hook snd_pcm_hook_t;
typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook);

// enums

enum snd_pcm_hook_type_t;

// global functions

snd_pcm_t*
snd_pcm_hook_get_pcm(snd_pcm_hook_t* hook);

void*
snd_pcm_hook_get_private(snd_pcm_hook_t* hook);

void
snd_pcm_hook_set_private(
    snd_pcm_hook_t* hook,
    void* private_data
);

int
snd_pcm_hook_add(
    snd_pcm_hook_t** hookp,
    snd_pcm_t* pcm,
    snd_pcm_hook_type_t type,
    snd_pcm_hook_func_t func,
    void* private_data
);

int
snd_pcm_hook_remove(snd_pcm_hook_t* hook);

Detailed Documentation

See the PCM (digital audio) interface page for more details.

Typedefs

typedef struct _snd_pcm_hook snd_pcm_hook_t

PCM hook container

typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook)

PCM hook callback function

Global Functions

snd_pcm_t*
snd_pcm_hook_get_pcm(snd_pcm_hook_t* hook)

Get PCM handle for a PCM hook.

Parameters:

hook

PCM hook handle

Returns:

PCM handle

void*
snd_pcm_hook_get_private(snd_pcm_hook_t* hook)

Get callback function private data for a PCM hook.

Parameters:

hook

PCM hook handle

Returns:

callback function private data

void
snd_pcm_hook_set_private(
    snd_pcm_hook_t* hook,
    void* private_data
)

Set callback function private data for a PCM hook.

Parameters:

hook

PCM hook handle

private_data

The private data value

int
snd_pcm_hook_add(
    snd_pcm_hook_t** hookp,
    snd_pcm_t* pcm,
    snd_pcm_hook_type_t type,
    snd_pcm_hook_func_t func,
    void* private_data
)

Add a PCM hook at end of hooks chain.

Warning: an hook callback function cannot remove an hook of the same type different from itself

Parameters:

hookp

Returned PCM hook handle

pcm

PCM handle

type

PCM hook type

func

PCM hook callback function

private_data

PCM hook private data

Returns:

0 on success otherwise a negative error code

int
snd_pcm_hook_remove(snd_pcm_hook_t* hook)

Remove a PCM hook.

Warning: an hook callback cannot remove an hook of the same type different from itself

Parameters:

hook

PCM hook handle

Returns:

0 on success otherwise a negative error code