From f26534ca8d7107b14fdd5a02cbadd56505d159de Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 8 Aug 2019 22:12:09 +0200 Subject: Switch from libmpv to mpv process with window embed --- include/Program.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/Program.h') diff --git a/include/Program.h b/include/Program.h index ba7e523..69ee564 100644 --- a/include/Program.h +++ b/include/Program.h @@ -1,10 +1,18 @@ #ifndef QUICKMEDIA_PROGRAM_H #define QUICKMEDIA_PROGRAM_H +#include + #ifdef __cplusplus extern "C" { #endif +typedef struct { + pid_t pid; + int read_fd; + int write_fd; +} ProgramPipe; + /* Return 0 if you want to continue reading. @data is null-terminated */ typedef int (*ProgramOutputCallback)(char *data, int size, void *userdata); @@ -14,6 +22,18 @@ typedef int (*ProgramOutputCallback)(char *data, int size, void *userdata); */ int exec_program(const char **args, ProgramOutputCallback output_callback, void *userdata); +/* + @args need to have at least 2 arguments. The first which is the program name + and the last which is NULL, which indicates end of args +*/ +int exec_program_async(const char **args, pid_t *result_process_id); +#if 0 + +int program_pipe_write(ProgramPipe *self, const char *data, size_t size); +int program_pipe_read(ProgramPipe *self, ProgramOutputCallback output_callback, void *userdata); +void program_pipe_close(ProgramPipe *self); +#endif + #ifdef __cplusplus } #endif -- cgit v1.2.3