ipc: Add a interface header for ipc_server_main[_android]

This commit is contained in:
Jakob Bornecrantz 2023-07-31 17:24:30 +01:00 committed by Ryan Pavlik
parent 5be0767aa9
commit 3de99b63d9
5 changed files with 58 additions and 28 deletions

View file

@ -355,31 +355,6 @@ struct ipc_server
};
#ifndef XRT_OS_ANDROID
/*!
* Main entrypoint to the compositor process.
*
* @ingroup ipc_server
*/
int
ipc_server_main(int argc, char **argv);
#endif
#ifdef XRT_OS_ANDROID
/*!
* Main entrypoint to the server process.
*
* @param ps Pointer to populate with the server struct.
* @param startup_complete_callback Function to call upon completing startup and populating *ps, but before entering the
* mainloop.
* @param data user data to pass to your callback.
*
* @ingroup ipc_server
*/
int
ipc_server_main_android(struct ipc_server **ps, void (*startup_complete_callback)(void *data), void *data);
#endif
/*!
* Get the current state of a client.
*

View file

@ -0,0 +1,54 @@
// Copyright 2020-2023, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief Interface for IPC server code.
* @author Pete Black <pblack@collabora.com>
* @author Jakob Bornecrantz <jakob@collabora.com>
* @author Ryan Pavlik <ryan.pavlik@collabora.com>
* @ingroup ipc_server
*/
#include "xrt/xrt_compiler.h"
#include "xrt/xrt_config_os.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef XRT_OS_ANDROID
/*!
* Main entrypoint to the compositor process.
*
* @ingroup ipc_server
*/
int
ipc_server_main(int argc, char **argv);
#endif
#ifdef XRT_OS_ANDROID
/*!
* Main entrypoint to the server process.
*
* @param ps Pointer to populate with the server struct.
* @param startup_complete_callback Function to call upon completing startup
* and populating *ps, but before entering
* the mainloop.
* @param data user data to pass to your callback.
*
* @ingroup ipc_server
*/
int
ipc_server_main_android(struct ipc_server **ps, void (*startup_complete_callback)(void *data), void *data);
#endif
#ifdef __cplusplus
}
#endif

View file

@ -29,6 +29,7 @@
#include "shared/ipc_shmem.h"
#include "server/ipc_server.h"
#include "server/ipc_server_interface.h"
#include <stdlib.h>
#include <inttypes.h>

View file

@ -13,6 +13,7 @@
#include "wrap/android.view.h"
#include "server/ipc_server.h"
#include "server/ipc_server_interface.h"
#include "server/ipc_server_mainloop_android.h"
#include "util/u_logging.h"

View file

@ -18,15 +18,14 @@
#include "util/u_windows.h"
#endif
#include "server/ipc_server_interface.h"
#include "target_lists.h"
// Insert the on load constructor to init trace marker.
U_TRACE_TARGET_SETUP(U_TRACE_WHICH_SERVICE)
int
ipc_server_main(int argc, char *argv[]);
int
main(int argc, char *argv[])