19#ifndef OVE_AUDIO_NODE_H
20#define OVE_AUDIO_NODE_H
29#define OVE_AUDIO_MAX_CHANNELS 8
267 float gain_db,
const char *name);
ove_audio_sample_fmt
PCM sample format tag.
Definition audio_node.h:38
int ove_audio_node_tap(struct ove_audio_graph *g, ove_audio_tap_fn fn, void *user_data, const char *name)
Add a tap (observer) sink node to the graph.
#define OVE_AUDIO_MAX_CHANNELS
Maximum number of audio channels supported by the channel-map node.
Definition audio_node.h:29
int ove_audio_node_converter(struct ove_audio_graph *g, enum ove_audio_sample_fmt target_fmt, const char *name)
Add a sample-format converter processor node to the graph.
ove_audio_node_type
Role of a node within the audio graph.
Definition audio_node.h:178
int ove_audio_node_channel_map(struct ove_audio_graph *g, const struct ove_audio_channel_map *map, const char *name)
Add a channel-mapping processor node to the graph.
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:275
int ove_audio_node_gain(struct ove_audio_graph *g, float gain_db, const char *name)
Add a gain processor node to the graph.
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:81
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:50
@ OVE_AUDIO_FMT_S16
Signed 16-bit integer (int16_t).
Definition audio_node.h:39
@ OVE_AUDIO_FMT_S32
Signed 32-bit integer (int32_t).
Definition audio_node.h:40
@ OVE_AUDIO_FMT_F32
32-bit IEEE 754 float.
Definition audio_node.h:41
@ OVE_AUDIO_NODE_PROCESSOR
Transforms audio; has one upstream connection.
Definition audio_node.h:180
@ OVE_AUDIO_NODE_SINK
Consumes audio; has no downstream connection.
Definition audio_node.h:181
@ OVE_AUDIO_NODE_SOURCE
Produces audio; has no upstream connection.
Definition audio_node.h:179
Audio buffer passed between nodes during graph processing.
Definition audio_node.h:97
unsigned int frames
Number of frames in data.
Definition audio_node.h:99
void * data
Pointer to interleaved sample data.
Definition audio_node.h:98
const struct ove_audio_fmt * fmt
Format descriptor for this buffer.
Definition audio_node.h:100
Channel routing table used by ove_audio_node_channel_map().
Definition audio_node.h:228
unsigned int out_channels
Number of output channels produced.
Definition audio_node.h:229
int map[OVE_AUDIO_MAX_CHANNELS]
map[out_ch] = in_ch index, or -1 for silence.
Definition audio_node.h:230
Complete audio stream format descriptor.
Definition audio_node.h:68
unsigned int sample_rate
Sample rate in Hz.
Definition audio_node.h:69
enum ove_audio_sample_fmt sample_fmt
PCM sample format.
Definition audio_node.h:71
unsigned int channels
Number of interleaved channels.
Definition audio_node.h:70
Audio processing graph instance.
Definition audio.h:93
Virtual function table (vtable) for an audio processing node.
Definition audio_node.h:112
void(* destroy)(void *ctx)
Release all resources owned by the node context.
Definition audio_node.h:170
int(* start)(void *ctx)
Start the node (called on graph start). NULL = no-op.
Definition audio_node.h:137
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:128
int(* process)(void *ctx, const struct ove_audio_buf *in, struct ove_audio_buf *out)
Process one buffer period.
Definition audio_node.h:160
int(* stop)(void *ctx)
Stop the node (called on graph stop). NULL = no-op.
Definition audio_node.h:145
Descriptor for a single node in the audio graph.
Definition audio_node.h:190
const struct ove_audio_node_ops * ops
Vtable for this node.
Definition audio_node.h:193
const char * name
Human-readable node name.
Definition audio_node.h:191
enum ove_audio_node_type type
Source, processor, or sink.
Definition audio_node.h:192
struct ove_audio_fmt out_fmt
Output format resolved during graph build.
Definition audio_node.h:195
void * ctx
Opaque context forwarded to every vtable call.
Definition audio_node.h:194