Monado OpenXR Runtime
|
Common client side code. More...
#include "xrt/xrt_compiler.h"
#include "xrt/xrt_config_os.h"
#include "util/u_threading.h"
#include "util/u_logging.h"
#include "shared/ipc_utils.h"
#include "shared/ipc_protocol.h"
#include "shared/ipc_message_channel.h"
#include <stdio.h>
Go to the source code of this file.
Data Structures | |
struct | ipc_connection |
Connection. More... | |
struct | ipc_client_xdev |
An IPC client proxy for an xrt_device. More... | |
Macros | |
#define | IPC_TRACE(IPC_C, ...) U_LOG_IFL_T((IPC_C)->imc.log_level, __VA_ARGS__) |
#define | IPC_DEBUG(IPC_C, ...) U_LOG_IFL_D((IPC_C)->imc.log_level, __VA_ARGS__) |
#define | IPC_INFO(IPC_C, ...) U_LOG_IFL_I((IPC_C)->imc.log_level, __VA_ARGS__) |
#define | IPC_WARN(IPC_C, ...) U_LOG_IFL_W((IPC_C)->imc.log_level, __VA_ARGS__) |
#define | IPC_ERROR(IPC_C, ...) U_LOG_IFL_E((IPC_C)->imc.log_level, __VA_ARGS__) |
#define | IPC_CHK_AND_RET(IPC_C, XRET, FUNC_STR) |
This define will error if XRET is not XRT_SUCCESS , printing out that the FUNC_STR string has failed, then returns XRET . More... | |
#define | IPC_CHK_WITH_GOTO(IPC_C, XRET, FUNC_STR, GOTO) |
This define will error if XRET is not XRT_SUCCESS , printing out that the FUNC_STR string has failed, then gotos GOTO . More... | |
#define | IPC_CHK_WITH_RET(IPC_C, XRET, FUNC_STR, RET) |
This define will error if XRET is not XRT_SUCCESS , printing out that the FUNC_STR string has failed, then returns RET . More... | |
#define | IPC_CHK_ONLY_PRINT(IPC_C, XRET, FUNC_STR) |
This define will error if XRET is not XRT_SUCCESS , printing out that the FUNC_STR string has failed, it only prints and does nothing else. More... | |
#define | IPC_CHK_ALWAYS_RET(IPC_C, XRET, FUNC_STR) |
This define will error if XRET is not XRT_SUCCESS , printing out that the FUNC_STR string has failed, then it will always return the value. More... | |
Functions | |
static struct ipc_client_xdev * | ipc_client_xdev (struct xrt_device *xdev) |
Convenience helper to go from a xdev to ipc_client_xdev. More... | |
xrt_result_t | ipc_client_create_system_compositor (struct ipc_connection *ipc_c, struct xrt_image_native_allocator *xina, struct xrt_device *xdev, struct xrt_system_compositor **out_xcs) |
Create an IPC client system compositor. More... | |
xrt_result_t | ipc_client_create_native_compositor (struct xrt_system_compositor *xsysc, const struct xrt_session_info *xsi, struct xrt_compositor_native **out_xcn) |
Create a native compositor from a system compositor, this is used instead of the normal xrt_system_compositor::create_native_compositor function because it doesn't support events being generated on the app side. More... | |
struct xrt_device * | ipc_client_hmd_create (struct ipc_connection *ipc_c, struct xrt_tracking_origin *xtrack, uint32_t device_id) |
struct xrt_device * | ipc_client_device_create (struct ipc_connection *ipc_c, struct xrt_tracking_origin *xtrack, uint32_t device_id) |
struct xrt_system * | ipc_client_system_create (struct ipc_connection *ipc_c, struct xrt_system_compositor *xsysc) |
struct xrt_space_overseer * | ipc_client_space_overseer_create (struct ipc_connection *ipc_c) |
struct xrt_system_devices * | ipc_client_system_devices_create (struct ipc_connection *ipc_c) |
struct xrt_session * | ipc_client_session_create (struct ipc_connection *ipc_c) |
Common client side code.
xrt_result_t ipc_client_create_native_compositor | ( | struct xrt_system_compositor * | xsysc, |
const struct xrt_session_info * | xsi, | ||
struct xrt_compositor_native ** | out_xcn | ||
) |
Create a native compositor from a system compositor, this is used instead of the normal xrt_system_compositor::create_native_compositor function because it doesn't support events being generated on the app side.
This will also create the session on the service side.
xsysc | IPC created system compositor. | |
xsi | Session information struct. | |
[out] | out_xcn | Pointer to receive the created xrt_compositor_native. |
References ipc_client_compositor::compositor_created, container_of, IPC_CHK_AND_RET, ipc_client_compositor::system, and XRT_ERROR_MULTI_SESSION_NOT_IMPLEMENTED.
xrt_result_t ipc_client_create_system_compositor | ( | struct ipc_connection * | ipc_c, |
struct xrt_image_native_allocator * | xina, | ||
struct xrt_device * | xdev, | ||
struct xrt_system_compositor ** | out_xcs | ||
) |
Create an IPC client system compositor.
It owns a special implementation of the xrt_system_compositor interface.
This actually creates an IPC client "native" compositor with deferred initialization. The ipc_client_create_native_compositor function actually completes the deferred initialization of the compositor, effectively finishing creation of a compositor IPC proxy.
ipc_c | IPC connection |
xina | Optional native image allocator for client-side allocation. Takes ownership if one is supplied. |
xdev | Taken in but not used currently |
[out] | out_xcs | Pointer to receive the created xrt_system_compositor. |
References xrt_system_compositor::create_native_compositor, ipc_client_compositor::system, and U_TYPED_CALLOC.