Monado OpenXR Runtime
Loading...
Searching...
No Matches
xrt_frame_source Interface Reference

Something that produces frames, and pushes them to all sinks added to it. More...

#include <xrt/xrt_frame_source.h>

Collaboration diagram for xrt_frame_source:

Static Public Member Functions

static XRT_NONNULL_ALL xrt_result_t xrt_frame_source_add_sink (struct xrt_frame_source *xfsrc, struct xrt_frame_sink *xs)
 Add a sink that frames will be pushed to.
 
static XRT_NONNULL_ALL void xrt_frame_source_remove_sink (struct xrt_frame_source *xfsrc, struct xrt_frame_sink *xs)
 Remove a sink, does nothing if it hasn't been added.
 

Data Fields

xrt_result_t(* add_sink )(struct xrt_frame_source *xfsrc, struct xrt_frame_sink *xs)
 Add a sink that frames will be pushed to.
 
void(* remove_sink )(struct xrt_frame_source *xfsrc, struct xrt_frame_sink *xs)
 Remove a sink, does nothing if it hasn't been added.
 

Detailed Description

Something that produces frames, and pushes them to all sinks added to it.

The frame counterpart of t_timing_event_source.

Implementations must also implement xrt_frame_node. Once xrt_frame_source::remove_sink returns the sink will not be pushed to again, so it is safe to destroy it.

The same frame is pushed to all sinks, so they must not modify it. Sinks must not add or remove sinks on the same source from within xrt_frame_sink::push_frame.

Member Function Documentation

◆ xrt_frame_source_add_sink()

static XRT_NONNULL_ALL xrt_result_t xrt_frame_source_add_sink ( struct xrt_frame_source *  xfsrc,
struct xrt_frame_sink *  xs 
)
inlinestatic

Add a sink that frames will be pushed to.

Parameters
xfsrcThe frame source.
xsThe sink to add.
Returns
XRT_SUCCESS, XRT_ERROR_ALLOCATION if the source is full, or another error if the source can't take sinks right now.

Helper for calling through the function pointer.

References add_sink.

◆ xrt_frame_source_remove_sink()

static XRT_NONNULL_ALL void xrt_frame_source_remove_sink ( struct xrt_frame_source *  xfsrc,
struct xrt_frame_sink *  xs 
)
inlinestatic

Remove a sink, does nothing if it hasn't been added.

Waits for any in-flight push to the sink to return.

Parameters
xfsrcThe frame source.
xsThe sink to remove.

Helper for calling through the function pointer.

References remove_sink.

Field Documentation

◆ add_sink

xrt_result_t(* xrt_frame_source::add_sink) (struct xrt_frame_source *xfsrc, struct xrt_frame_sink *xs)

Add a sink that frames will be pushed to.

Parameters
xfsrcThe frame source.
xsThe sink to add.
Returns
XRT_SUCCESS, XRT_ERROR_ALLOCATION if the source is full, or another error if the source can't take sinks right now.

Referenced by b_frame_source_create(), and xrt_frame_source_add_sink().

◆ remove_sink

void(* xrt_frame_source::remove_sink) (struct xrt_frame_source *xfsrc, struct xrt_frame_sink *xs)

Remove a sink, does nothing if it hasn't been added.

Waits for any in-flight push to the sink to return.

Parameters
xfsrcThe frame source.
xsThe sink to remove.

Referenced by b_frame_source_create(), and xrt_frame_source_remove_sink().


The documentation for this interface was generated from the following file: