375 const char *instance,
bool user_friendly);
397 const char *stream_id);
419 const char *description);
441 const char *media_name);
struct funnel_stream funnel_stream
A PipeWire video stream.
Definition funnel.h:36
struct funnel_buffer funnel_buffer
A video buffer (frame).
Definition funnel.h:58
int funnel_init(struct funnel_ctx **pctx)
Initialize a Funnel context.
void * funnel_buffer_get_user_data(struct funnel_buffer *buf)
Get an arbitrary user data pointer for a buffer.
int funnel_stream_return(struct funnel_stream *stream, struct funnel_buffer *buf)
Return a buffer to the pool without enqueueing it.
int funnel_stream_configure(struct funnel_stream *stream)
Apply the stream configuration and register the stream with PipeWire.
static struct funnel_fraction FUNNEL_FRACTION(uint32_t num, uint32_t den)
Helper to create a funnel_fraction.
Definition funnel.h:80
void(* funnel_buffer_callback)(void *opaque, struct funnel_stream *stream, struct funnel_buffer *buf)
A user callback for buffer creation/destruction.
Definition funnel.h:92
funnel_mode
Synchronization modes for the frame pacing.
Definition funnel.h:99
@ FUNNEL_SINGLE_BUFFERED
Produce frames synchronously to the consumer with single buffering.
Definition funnel.h:154
@ FUNNEL_SYNCHRONOUS
Produce frames synchronously with the PipeWire process cycle.
Definition funnel.h:170
@ FUNNEL_ASYNC
Produce frames asynchronously to the consumer.
Definition funnel.h:117
@ FUNNEL_DOUBLE_BUFFERED
Produce frames synchronously to the consumer with double buffering.
Definition funnel.h:137
int funnel_stream_enqueue(struct funnel_stream *stream, struct funnel_buffer *buf)
Enqueue a buffer to a stream.
int funnel_stream_stop(struct funnel_stream *stream)
Stop running a stream.
struct funnel_ctx funnel_ctx
A libfunnel context.
Definition funnel.h:24
int funnel_stream_set_sync(struct funnel_stream *stream, enum funnel_sync frontend, enum funnel_sync backend)
Configure the synchronization modes for the stream.
bool funnel_buffer_is_efficient_for_rendering(struct funnel_buffer *buf)
Return whether a buffer is considered efficient for rendering.
void funnel_shutdown(struct funnel_ctx *ctx)
Shut down a Funnel context.
int funnel_stream_set_size(struct funnel_stream *stream, uint32_t width, uint32_t height)
Set the frame dimensions for a stream.
int funnel_connect(struct funnel_ctx *ctx)
Connect to PipeWire.
void funnel_buffer_set_user_data(struct funnel_buffer *buf, void *opaque)
Set an arbitrary user data pointer for a buffer.
int funnel_new(struct funnel_ctx **pctx)
Create a Funnel context.
void funnel_stream_set_buffer_callbacks(struct funnel_stream *stream, funnel_buffer_callback alloc, funnel_buffer_callback free, void *opaque)
Specify callbacks for buffer creation/destruction.
int funnel_stream_create(struct funnel_ctx *ctx, const char *name, struct funnel_stream **pstream)
Create a new stream.
int funnel_set_app_version(struct funnel_ctx *ctx, const char *app_version)
Set the application version.
void funnel_stream_destroy(struct funnel_stream *stream)
Destroy a stream.
int funnel_set_app_id(struct funnel_ctx *ctx, const char *app_id)
Set the application ID.
int funnel_stream_set_mode(struct funnel_stream *stream, enum funnel_mode mode)
Configure the queueing mode for the stream.
funnel_sync
Buffer synchronization modes for frames.
Definition funnel.h:178
@ FUNNEL_SYNC_BOTH
Support both implicit and explicit sync.
Definition funnel.h:192
@ FUNNEL_SYNC_EXPLICIT
Use explicit sync only.
Definition funnel.h:187
@ FUNNEL_SYNC_IMPLICIT
Use implicit sync only.
Definition funnel.h:182
int funnel_stream_get_rate(struct funnel_stream *stream, struct funnel_fraction *prate)
Get the currently negotiated frame rate of a stream.
int funnel_stream_start(struct funnel_stream *stream)
Start running a stream.
int funnel_stream_skip_frame(struct funnel_stream *stream)
Break out of a frame processing cycle for a stream.
int funnel_stream_set_instance(struct funnel_stream *stream, const char *instance, bool user_friendly)
Set the instance for this stream.
bool funnel_buffer_has_sync(struct funnel_buffer *buf)
Check whether a buffer requires explicit synchronization.
int funnel_stream_get_state(struct funnel_stream *stream, enum funnel_stream_state *pstate)
Get the current state of a stream.
int funnel_stream_set_rate(struct funnel_stream *stream, struct funnel_fraction def, struct funnel_fraction min, struct funnel_fraction max)
Set the frame rate of a stream.
int funnel_stream_set_media_name(struct funnel_stream *stream, const char *media_name)
Set the media name for this stream.
funnel_stream_state
Represents the state of a stream.
Definition funnel.h:200
@ FUNNEL_STREAM_STATE_PAUSED
The stream is paused or reconfiguring.
Definition funnel.h:206
@ FUNNEL_STREAM_STATE_CONNECTING
The stream is currently connecting to a consumer.
Definition funnel.h:204
@ FUNNEL_STREAM_STATE_STREAMING
The stream is actively streaming.
Definition funnel.h:208
@ FUNNEL_STREAM_STATE_UNCONNECTED
The stream is not connected to a consumer.
Definition funnel.h:202
int funnel_stream_set_description(struct funnel_stream *stream, const char *description)
Set the description for this stream.
int funnel_set_app_name(struct funnel_ctx *ctx, const char *app_name)
Set the user-friendly application name.
void funnel_buffer_get_size(struct funnel_buffer *buf, uint32_t *pwidth, uint32_t *pheight)
Get the dimensions of a Funnel buffer.
static const struct funnel_fraction FUNNEL_RATE_VARIABLE
Indicates that the frame rate is variable.
Definition funnel.h:71
int funnel_stream_dequeue(struct funnel_stream *stream, struct funnel_buffer **pbuf)
Dequeue a buffer from a stream.
int funnel_stream_set_unique_id(struct funnel_stream *stream, const char *stream_id)
Set the unique ID for this stream.
void funnel_stream_clear_formats(struct funnel_stream *stream)
Clear the supported format list.
A rational frame rate.
Definition funnel.h:63