mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-29 18:08:29 +00:00
ipc: Create android_instance_base if required.
Co-authored-by: Jarvis Huang <quic_jarvhuan@quicinc.com> Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/1655>
This commit is contained in:
parent
bc6a42441c
commit
13e023955c
|
@ -85,6 +85,11 @@ if(WIN32)
|
|||
endif()
|
||||
target_link_libraries(ipc_client PRIVATE aux_util ipc_shared)
|
||||
|
||||
if(ANDROID)
|
||||
# Need android_instance_base on the client side too.
|
||||
target_link_libraries(ipc_client PRIVATE aux_android)
|
||||
endif()
|
||||
|
||||
###
|
||||
# Server
|
||||
|
||||
|
|
|
@ -54,8 +54,9 @@
|
|||
#endif
|
||||
|
||||
#ifdef XRT_OS_ANDROID
|
||||
#include "android/android_globals.h"
|
||||
#include "xrt/xrt_android.h"
|
||||
#include "android/ipc_client_android.h"
|
||||
#include "android/android_instance_base.h"
|
||||
#endif // XRT_OS_ANDROID
|
||||
|
||||
DEBUG_GET_ONCE_LOG_OPTION(ipc_log, "IPC_LOG", U_LOGGING_WARN)
|
||||
|
@ -82,6 +83,10 @@ struct ipc_client_instance
|
|||
|
||||
struct xrt_device *xdevs[XRT_SYSTEM_MAX_DEVICES];
|
||||
size_t xdev_count;
|
||||
|
||||
#ifdef XRT_OS_ANDROID
|
||||
struct android_instance_base android;
|
||||
#endif
|
||||
};
|
||||
|
||||
static inline struct ipc_client_instance *
|
||||
|
@ -232,6 +237,11 @@ ipc_client_instance_destroy(struct xrt_instance *xinst)
|
|||
}
|
||||
ii->xtrack_count = 0;
|
||||
|
||||
#ifdef XRT_OS_ANDROID
|
||||
android_instance_base_cleanup(&(ii->android), xinst);
|
||||
ipc_client_android_destroy(&(ii->ipc_c.ica));
|
||||
#endif // XRT_OS_ANDROID
|
||||
|
||||
#ifdef XRT_OS_WINDOWS
|
||||
timeEndPeriod(1);
|
||||
#endif
|
||||
|
@ -265,11 +275,23 @@ ipc_instance_create(const struct xrt_instance_info *i_info, struct xrt_instance
|
|||
timeBeginPeriod(1);
|
||||
#endif
|
||||
|
||||
xrt_result_t xret = ipc_client_connection_init(&ii->ipc_c, debug_get_log_option_ipc_log(), i_info);
|
||||
xrt_result_t xret;
|
||||
#ifdef XRT_OS_ANDROID
|
||||
xret = android_instance_base_init(&ii->android, &ii->base, i_info);
|
||||
if (xret != XRT_SUCCESS) {
|
||||
free(ii);
|
||||
return xret;
|
||||
}
|
||||
#endif
|
||||
|
||||
xret = ipc_client_connection_init(&ii->ipc_c, debug_get_log_option_ipc_log(), i_info);
|
||||
if (xret != XRT_SUCCESS) {
|
||||
#ifdef XRT_OS_ANDROID
|
||||
android_instance_base_cleanup(&(ii->android), &(ii->base));
|
||||
#endif
|
||||
free(ii);
|
||||
return xret;
|
||||
}
|
||||
|
||||
uint32_t count = 0;
|
||||
struct xrt_tracking_origin *xtrack = NULL;
|
||||
|
|
Loading…
Reference in a new issue