From 13039414f5fd00a6b20d2bbad9fd497c6e579d34 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Thu, 16 Oct 2014 11:48:18 +0200 Subject: input: implement JSON-based IPC protocol --- player/core.h | 6 ++++++ player/main.c | 8 ++++++++ 2 files changed, 14 insertions(+) (limited to 'player') diff --git a/player/core.h b/player/core.h index 4f88710081..2d4c22434b 100644 --- a/player/core.h +++ b/player/core.h @@ -345,6 +345,8 @@ typedef struct MPContext { struct command_ctx *command_ctx; struct encode_lavc_context *encode_lavc_ctx; struct mp_nav_state *nav_state; + + void *ipc_ctx; } MPContext; // audio.c @@ -376,6 +378,10 @@ void mp_nav_user_input(struct MPContext *mpctx, char *command); void mp_handle_nav(struct MPContext *mpctx); int mp_nav_in_menu(struct MPContext *mpctx); +// ipc.c +void mp_init_ipc(struct MPContext *mpctx); +void mp_uninit_ipc(struct MPContext *mpctx); + // loadfile.c void uninit_player(struct MPContext *mpctx, unsigned int mask); struct track *mp_add_subtitles(struct MPContext *mpctx, char *filename); diff --git a/player/main.c b/player/main.c index 160b5deab3..3bed127de7 100644 --- a/player/main.c +++ b/player/main.c @@ -131,6 +131,10 @@ void mp_destroy(struct MPContext *mpctx) shutdown_clients(mpctx); +#if !defined(__MINGW32__) + mp_uninit_ipc(mpctx); +#endif + command_uninit(mpctx); osd_free(mpctx->osd); @@ -441,6 +445,10 @@ int mp_initialize(struct MPContext *mpctx) // where this is safe. mp_load_scripts(mpctx); +#if !defined(__MINGW32__) + mp_init_ipc(mpctx); +#endif + if (opts->shuffle) playlist_shuffle(mpctx->playlist); -- cgit v1.2.3