20#ifndef OVE_AUDIO_NODE_H
21#define OVE_AUDIO_NODE_H
32#define OVE_AUDIO_MAX_CHANNELS 8
57 return sizeof(int16_t);
59 return sizeof(int32_t);
283int ove_audio_node_gain(
struct ove_audio_graph *g,
float gain_db,
const char *name);
ove_audio_sample_fmt
PCM sample format tag.
Definition audio_node.h:41
#define OVE_AUDIO_MAX_CHANNELS
Maximum number of audio channels supported by the channel-map node.
Definition audio_node.h:32
ove_audio_node_type
Role of a node within the audio graph.
Definition audio_node.h:183
void(* ove_audio_tap_fn)(const struct ove_audio_buf *buf, void *user_data)
Callback invoked by the tap node for every processed buffer.
Definition audio_node.h:226
static int ove_audio_fmt_equal(const struct ove_audio_fmt *a, const struct ove_audio_fmt *b)
Test two format descriptors for equality.
Definition audio_node.h:88
static unsigned int ove_audio_sample_size(enum ove_audio_sample_fmt fmt)
Return the size in bytes of one sample for a given format.
Definition audio_node.h:53
@ OVE_AUDIO_FMT_S16
Signed 16-bit integer (int16_t).
Definition audio_node.h:42
@ OVE_AUDIO_FMT_S32
Signed 32-bit integer (int32_t).
Definition audio_node.h:43
@ OVE_AUDIO_FMT_F32
32-bit IEEE 754 float.
Definition audio_node.h:44
@ OVE_AUDIO_NODE_PROCESSOR
Transforms audio; has one upstream connection.
Definition audio_node.h:185
@ OVE_AUDIO_NODE_SINK
Consumes audio; has no downstream connection.
Definition audio_node.h:186
@ OVE_AUDIO_NODE_SOURCE
Produces audio; has no upstream connection.
Definition audio_node.h:184
Audio buffer passed between nodes during graph processing.
Definition audio_node.h:102
unsigned int frames
Number of frames in data.
Definition audio_node.h:104
void * data
Pointer to interleaved sample data.
Definition audio_node.h:103
const struct ove_audio_fmt * fmt
Format descriptor for this buffer.
Definition audio_node.h:105
Channel routing table used by ove_audio_node_channel_map().
Definition audio_node.h:215
unsigned int out_channels
Number of output channels produced.
Definition audio_node.h:216
int map[OVE_AUDIO_MAX_CHANNELS]
map[out_ch] = in_ch index, or -1 for silence.
Definition audio_node.h:217
Complete audio stream format descriptor.
Definition audio_node.h:75
unsigned int sample_rate
Sample rate in Hz.
Definition audio_node.h:76
enum ove_audio_sample_fmt sample_fmt
PCM sample format.
Definition audio_node.h:78
unsigned int channels
Number of interleaved channels.
Definition audio_node.h:77
Audio processing graph instance.
Definition audio.h:96
Virtual function table (vtable) for an audio processing node.
Definition audio_node.h:118
void(* destroy)(void *ctx)
Release all resources owned by the node context.
Definition audio_node.h:175
int(* start)(void *ctx)
Start the node (called on graph start). NULL = no-op.
Definition audio_node.h:143
int(* configure)(void *ctx, const struct ove_audio_fmt *in_fmt, struct ove_audio_fmt *out_fmt)
Negotiate format during graph build (topological order).
Definition audio_node.h:134
int(* process)(void *ctx, const struct ove_audio_buf *in, struct ove_audio_buf *out)
Process one buffer period.
Definition audio_node.h:166
int(* stop)(void *ctx)
Stop the node (called on graph stop). NULL = no-op.
Definition audio_node.h:151
Descriptor for a single node in the audio graph.
Definition audio_node.h:195
const struct ove_audio_node_ops * ops
Vtable for this node.
Definition audio_node.h:198
const char * name
Human-readable node name.
Definition audio_node.h:196
enum ove_audio_node_type type
Source, processor, or sink.
Definition audio_node.h:197
struct ove_audio_fmt out_fmt
Output format resolved during graph build.
Definition audio_node.h:200
void * ctx
Opaque context forwarded to every vtable call.
Definition audio_node.h:199