Skip to main content
Version: 0.9.0 (next)

Render Sender

Typedefs Index​

typedefvoid(* qar_render_sender_begin_frame_callback_t)(QarResult status, QarRenderFrameInfo *frame_info, void *user_state)
typedefvoid(* qar_render_sender_create_callback_t)(QarResult status, QarRenderSender *out_stream, void *user_state)

Functions Index​

static QarResultqar_render_frame_info_get_view_fov (QarRenderFrameInfo *handle, size_t view_index, QarFov *out_fov)

The field of view of one view, in view space, in radians. A view of eye QAR_VIDEO_FRAME_VIEW_EYE_NONE gets the left eye's. More...

static QarResultqar_render_frame_info_get_view_pose (QarRenderFrameInfo *handle, size_t view_index, QarPose *out_pose)

The pose to render one view with, in the bound app volume's app content space. More...

static voidqar_render_frame_info_handle_destroy (QarRenderFrameInfo *handle)
static boolqar_render_frame_info_handle_is_valid (QarRenderFrameInfo *handle)
static QarResultqar_render_request_get_stream_id (QarRenderStreamRequest *request, QarStreamId *out_stream_id)

Get the stream id from a render request. More...

static QarResultqar_render_request_get_target_peer_id (QarRenderStreamRequest *request, QarPeerId *out_peer_id)

Get the target peer id from a render request. More...

static voidqar_render_request_handle_destroy (QarRenderStreamRequest *request)

Destroy a render stream request handle. More...

static boolqar_render_request_handle_is_valid (QarRenderStreamRequest *request)

Check if a render stream request handle is valid. More...

static QarResultqar_render_sender_begin_frame (QarRenderSender *stream, QarCancelToken *token, QarRenderFrameInfo **out_frame_info)

Begin producing a new frame. More...

static QarResultqar_render_sender_begin_frame_async (QarRenderSender *stream, qar_render_sender_begin_frame_callback_t callback, void *user_state, QarCancelToken *token)

Async version of begin_frame. Same poses, same space, same failures and the same wait through a paused stream as qar_render_sender_begin_frame(). More...

static QarResultqar_render_sender_change_layout (QarRenderSender *stream, const QarVideoFrameLayout *layout)

Request a layout change for subsequent frames. More...

static QarResultqar_render_sender_create (QarSession *session, QarRenderSenderInit *init, QarCancelToken *cancel, QarRenderSender **out_stream)

Create a rendering stream sender bound to a session. More...

static QarResultqar_render_sender_create_async (QarSession *session, QarRenderSenderInit *init, qar_render_sender_create_callback_t callback, void *user_state, QarCancelToken *token)

Async variant of qar_render_sender_create. More...

static QarResultqar_render_sender_frame_cpu (QarRenderSender *stream, QarVideoFrameCpu *out_frame)

Get CPU-backed frame access. More...

static QarResultqar_render_sender_frame_d3d11 (QarRenderSender *stream, QarVideoFrameD3D11 *out_frame)

Get D3D11-backed frame access. Readable before the first begin-frame; writable only inside a frame cycle. More...

static QarResultqar_render_sender_last_hands (QarRenderSender *stream, QarDeviceHandsWithJoints *out_hands)

Query the newest hands data the device sent since the previous call. More...

static QarResultqar_render_sender_layout (QarRenderSender *stream, QarVideoFrameLayout *out_layout)

Retrieve the negotiated video frame layout. More...

static QarResultqar_render_sender_show_frame (QarRenderSender *stream, const QarRenderFrameShow *frame_show)

Submit the rendered frame for presentation/streaming. More...

static QarResultqar_render_sender_subscribe_requests (QarSession *session, qar_render_sender_request_callback_t callback, void *user_state, QarCancelToken *token)

Subscribe to render stream requests for this application's content. More...

static QarResultqar_render_sender_try_begin_frame (QarRenderSender *stream, QarRenderFrameInfo **out_frame_info, bool *out_ready)

Non-blocking attempt to begin producing a new frame. More...

static voidqar_render_stream_handle_destroy (QarRenderSender *handle)

Destroy a render stream sender handle. More...

Typedefs​

qar_render_sender_begin_frame_callback_t​

typedef void(* qar_render_sender_begin_frame_callback_t)(QarResult status, QarRenderFrameInfo *frame_info, void *user_state)

Definition at line 3094 of file qar_streaming.h.

qar_render_sender_create_callback_t​

typedef void(* qar_render_sender_create_callback_t)(QarResult status, QarRenderSender *out_stream, void *user_state)

Definition at line 2969 of file qar_streaming.h.

Functions​

qar_render_frame_info_get_view_fov()​

QarResult qar_render_frame_info_get_view_fov (QarRenderFrameInfo * handle, size_t view_index, QarFov * out_fov)
inline static

The field of view of one view, in view space, in radians. A view of eye QAR_VIDEO_FRAME_VIEW_EYE_NONE gets the left eye's.

Definition at line 3158 of file qar_streaming.h.

qar_render_frame_info_get_view_pose()​

QarResult qar_render_frame_info_get_view_pose (QarRenderFrameInfo * handle, size_t view_index, QarPose * out_pose)
inline static

The pose to render one view with, in the bound app volume's app content space.

The sender has already taken the viewer's room-space pose through the volume's pose, app pose and app scale, so the application renders its scene in its own coordinates. A view of eye QAR_VIDEO_FRAME_VIEW_EYE_NONE gets the head pose.

Definition at line 3151 of file qar_streaming.h.

qar_render_frame_info_handle_destroy()​

void qar_render_frame_info_handle_destroy (QarRenderFrameInfo * handle)
inline static

Definition at line 3141 of file qar_streaming.h.

qar_render_frame_info_handle_is_valid()​

bool qar_render_frame_info_handle_is_valid (QarRenderFrameInfo * handle)
inline static

Definition at line 6745 of file qar_streaming.h.

qar_render_request_get_stream_id()​

QarResult qar_render_request_get_stream_id (QarRenderStreamRequest * request, QarStreamId * out_stream_id)
inline static

Get the stream id from a render request.

Definition at line 2940 of file qar_streaming.h.

qar_render_request_get_target_peer_id()​

QarResult qar_render_request_get_target_peer_id (QarRenderStreamRequest * request, QarPeerId * out_peer_id)
inline static

Get the target peer id from a render request.

Definition at line 2936 of file qar_streaming.h.

qar_render_request_handle_destroy()​

void qar_render_request_handle_destroy (QarRenderStreamRequest * request)
inline static

Destroy a render stream request handle.

Definition at line 2934 of file qar_streaming.h.

qar_render_request_handle_is_valid()​

bool qar_render_request_handle_is_valid (QarRenderStreamRequest * request)
inline static

Check if a render stream request handle is valid.

Definition at line 6751 of file qar_streaming.h.

qar_render_sender_begin_frame()​

QarResult qar_render_sender_begin_frame (QarRenderSender * stream, QarCancelToken * token, QarRenderFrameInfo ** out_frame_info)
inline static

Begin producing a new frame.

Returns per-frame information such as per-eye pose/FOV to render with. The poses are in the bound app volume's app content space (ADR-0253).

Fails with QAR_STATUS_RENDERING_PRODUCER_APP_VOLUME_UNRESOLVED, without beginning a frame, while the app volume does not resolve: app content space is undefined then, and no room-space pose is handed out in its place. The failure is recoverable - keep calling, a frame begins once the volume resolves. The call is held about 16 ms first, so a retrying loop does not spin.

Waits, rather than fails, while the receiver has paused the stream (for example, its display is not visible): the sender and its stream stay up and the frame begins as soon as the receiver resumes. Cancel token to stop waiting; the call then fails.

Definition at line 3068 of file qar_streaming.h.

qar_render_sender_begin_frame_async()​

QarResult qar_render_sender_begin_frame_async (QarRenderSender * stream, qar_render_sender_begin_frame_callback_t callback, void * user_state, QarCancelToken * token)
inline static

Async version of begin_frame. Same poses, same space, same failures and the same wait through a paused stream as qar_render_sender_begin_frame().

Definition at line 3100 of file qar_streaming.h.

qar_render_sender_change_layout()​

QarResult qar_render_sender_change_layout (QarRenderSender * stream, const QarVideoFrameLayout * layout)
inline static

Request a layout change for subsequent frames.

Not callable inside a frame cycle: between a successful begin-frame and its qar_render_sender_show_frame() it returns QAR_STATUS_LOGIC_ERROR and changes nothing. The views and textures of later frames keep the order given in layout.

Definition at line 3003 of file qar_streaming.h.

qar_render_sender_create()​

QarResult qar_render_sender_create (QarSession * session, QarRenderSenderInit * init, QarCancelToken * cancel, QarRenderSender ** out_stream)
inline static

Create a rendering stream sender bound to a session.

**init->peer_id is the target this stream renders for**, not this process' own id; see "Basic flow" at the top of this header for where it comes from. The sender attaches that target to init->app_volume_id. A fresh qar_peer_id_unique() belongs to no peer: a stream created with one negotiates with nobody and never produces a frame.

**init->app_volume_id must name an app volume that already exists.** The volume is what places the stream in the shared 3D scene, so create it first with qar_app_volumes_get_or_create() and pass the id it returns.

Parameters
session

Active session handle.

init

Stream configuration (views, formats, target peer, app volume).

cancel

Optional cancellation token for creation.

out_stream

Receives the created stream sender handle.

Returns

QarResult QAR_STATUS_APP_VOLUME_INVALID_ID when no app volume id is given.

Definition at line 2963 of file qar_streaming.h.

qar_render_sender_create_async()​

QarResult qar_render_sender_create_async (QarSession * session, QarRenderSenderInit * init, qar_render_sender_create_callback_t callback, void * user_state, QarCancelToken * token)
inline static

Async variant of qar_render_sender_create.

Definition at line 2973 of file qar_streaming.h.

qar_render_sender_frame_cpu()​

QarResult qar_render_sender_frame_cpu (QarRenderSender * stream, QarVideoFrameCpu * out_frame)
inline static

Get CPU-backed frame access.

The frame exists from creation, so it may be read – textures, views, sizes – before the first begin-frame. Its contents and synchronization may be written only inside a frame cycle.

Definition at line 3013 of file qar_streaming.h.

qar_render_sender_frame_d3d11()​

QarResult qar_render_sender_frame_d3d11 (QarRenderSender * stream, QarVideoFrameD3D11 * out_frame)
inline static

Get D3D11-backed frame access. Readable before the first begin-frame; writable only inside a frame cycle.

Definition at line 3021 of file qar_streaming.h.

qar_render_sender_last_hands()​

QarResult qar_render_sender_last_hands (QarRenderSender * stream, QarDeviceHandsWithJoints * out_hands)
inline static

Query the newest hands data the device sent since the previous call.

Drains everything that arrived and returns the last sample. The poses are in the bound app volume's app content space, like the view poses, and so are the joint radii and velocities measured beside them: radii in app units, velocities in app axes, linear ones in app units per second (ADR-0253). Never room space - hand data a peer publishes on a data stream is in that peer's room space, but this call converts it. Samples arrive only while the target peer is focused on the volume and not editing it, and while the volume resolves; otherwise both hands are untracked. When nothing arrived since the previous call, the last sample is returned again while it is younger than a second, so polling faster than the device sends never blinks the hands out between its samples. Once no sample has arrived for a second, both hands are reported untracked: a device that stopped sending has no hands. Poll it once per frame.

Parameters
stream

The render sender.

out_hands

Receives the newest sample, the last one while it is younger than a second, or a sample with both hands untracked.

Returns

Success, or an error once the hand stream has closed.

Definition at line 3134 of file qar_streaming.h.

qar_render_sender_layout()​

QarResult qar_render_sender_layout (QarRenderSender * stream, QarVideoFrameLayout * out_layout)
inline static

Retrieve the negotiated video frame layout.

Available as soon as the sender exists: it is what the stream request settled on, so it can be read before the first begin-frame and while a transfer is reconnecting. Size lasting resources from this rather than from a frame that has not arrived yet.

Its views come in exactly the order declared in QarRenderSenderInit::frame_views, and every frame's views and textures match it; after qar_render_sender_change_layout(), in the order of that layout.

Definition at line 2992 of file qar_streaming.h.

qar_render_sender_show_frame()​

QarResult qar_render_sender_show_frame (QarRenderSender * stream, const QarRenderFrameShow * frame_show)
inline static

Submit the rendered frame for presentation/streaming.

Definition at line 3109 of file qar_streaming.h.

qar_render_sender_subscribe_requests()​

QarResult qar_render_sender_subscribe_requests (QarSession * session, qar_render_sender_request_callback_t callback, void * user_state, QarCancelToken * token)
inline static

Subscribe to render stream requests for this application's content.

A target requests the content only once it is attached to the application's app volume, so this does not discover targets for a new application - see "Basic flow" at the top of this header for that. It sees requests for a volume something else attached a target to.

In the callback, read qar_render_request_get_target_peer_id(), then enqueue that id for the application's render thread, which creates one sender (and a camera using its per-frame pose/FOV) per target. Repeated requests for a target already served do not require another sender.

Callbacks run asynchronously, so synchronize handoff to the render thread. Release each delivered request with qar_render_request_handle_destroy(). Keep user_state alive until the call ending the subscription has returned, see Ending a subscription.

Parameters
session

Active session.

callback

Required callback for each pending request.

user_state

Application state passed unchanged to the callback.

token

Required cancellation token owning the subscription; cancelling or destroying it, or destroying the session, ends it.

Returns

Success when subscribed, or a subscription setup error.

Definition at line 2923 of file qar_streaming.h.

qar_render_sender_try_begin_frame()​

QarResult qar_render_sender_try_begin_frame (QarRenderSender * stream, QarRenderFrameInfo ** out_frame_info, bool * out_ready)
inline static

Non-blocking attempt to begin producing a new frame.

Starts the begin-frame wait on the first call and polls it on every call without blocking. When the wait has completed, out_ready is set to true and out_frame_info receives the per-frame information; otherwise out_ready is set to false and the caller should poll again later. The returned QarResult reports only real failures (invalid arguments, a failed begin-frame); a still-pending wait is reported through out_ready, not as an error. Poll with the same stream until out_ready becomes true. Fails like qar_render_sender_begin_frame(), including QAR_STATUS_RENDERING_PRODUCER_APP_VOLUME_UNRESOLVED while the app volume does not resolve. While the receiver has paused the stream the wait does not complete: out_ready stays false and the call succeeds until it resumes.

Definition at line 3089 of file qar_streaming.h.

qar_render_stream_handle_destroy()​

void qar_render_stream_handle_destroy (QarRenderSender * handle)
inline static

Destroy a render stream sender handle.

Definition at line 2898 of file qar_streaming.h.


Generated via doxygen2docusaurus 2.2.1 by Doxygen 1.9.8.