mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
build: change how some OS specific source files are selected
In a bunch of cases, we emulate highly platform specific APIs on a higher level across all OSes, such as IPC, terminal, subprocess handling, and more. We have source files for each OS, and they implement all the same mpv internal API. Selecting which source file to use on an OS can be tricky, because there is partially overlapping and emulated APIs (consider Cygwin on Windows). Add a pick_first_matching_dep() function to make this slightly easier and more structured. Also add dummy backends in some cases, to deal with APIs not being available. Clarify the Windows dependency identifiers, as these are the most confusing.
This commit is contained in:
@@ -1392,7 +1392,7 @@ void mp_input_load_config(struct input_ctx *ictx)
|
||||
talloc_free(tmp);
|
||||
}
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
#if HAVE_WIN32_PIPES
|
||||
if (ictx->global->opts->input_file && *ictx->global->opts->input_file)
|
||||
mp_input_pipe_add(ictx, ictx->global->opts->input_file);
|
||||
#endif
|
||||
|
||||
@@ -259,6 +259,8 @@ void mp_input_pipe_add(struct input_ctx *ictx, const char *filename);
|
||||
|
||||
struct mp_ipc_ctx;
|
||||
struct mp_client_api;
|
||||
|
||||
// Platform specific implementation, provided by ipc-*.c.
|
||||
struct mp_ipc_ctx *mp_init_ipc(struct mp_client_api *client_api,
|
||||
struct mpv_global *global);
|
||||
void mp_uninit_ipc(struct mp_ipc_ctx *ctx);
|
||||
|
||||
13
input/ipc-dummy.c
Normal file
13
input/ipc-dummy.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include "input/input.h"
|
||||
|
||||
struct mp_ipc_ctx *mp_init_ipc(struct mp_client_api *client_api,
|
||||
struct mpv_global *global)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void mp_uninit_ipc(struct mp_ipc_ctx *ctx)
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user