diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-08-08 22:12:09 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2019-08-08 22:12:12 +0200 |
commit | f26534ca8d7107b14fdd5a02cbadd56505d159de (patch) | |
tree | e8f91f264126665a175709046bd92c9b0973323a /include/Program.h | |
parent | c9c2621accb68634685a14703491cacdd7ed2bb1 (diff) |
Switch from libmpv to mpv process with window embed
Diffstat (limited to 'include/Program.h')
-rw-r--r-- | include/Program.h | 20 |
1 files changed, 20 insertions, 0 deletions
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 <sys/types.h> + #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 |