diff options
Diffstat (limited to 'stream/stream.h')
-rw-r--r-- | stream/stream.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/stream/stream.h b/stream/stream.h index 8bd8ecfc01..4bd6a7b713 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -37,6 +37,7 @@ // flags for stream_open_ext (this includes STREAM_READ and STREAM_WRITE) #define STREAM_SAFE_ONLY 4 #define STREAM_NETWORK_ONLY 8 +#define STREAM_SILENT 16 #define STREAM_UNSAFE -3 #define STREAM_NO_MATCH -2 @@ -47,9 +48,6 @@ enum stream_ctrl { STREAM_CTRL_GET_SIZE = 1, - // stream_memory.c - STREAM_CTRL_SET_CONTENTS, - // Certain network protocols STREAM_CTRL_AVSEEK, STREAM_CTRL_HAS_AVSEEK, @@ -72,6 +70,8 @@ typedef struct stream_info_st { const char *name; // opts is set from ->opts int (*open)(struct stream *st); + // Alternative to open(). Only either open() or open2() can be set. + int (*open2)(struct stream *st, void *arg); const char *const *protocols; bool can_write; // correctly checks for READ/WRITE modes bool is_safe; // opening is no security issue, even with remote provided URLs @@ -165,15 +165,20 @@ struct bstr stream_read_file(const char *filename, void *talloc_ctx, struct mpv_global *global, int max_size); int stream_control(stream_t *s, int cmd, void *arg); void free_stream(stream_t *s); +int stream_create_instance(const stream_info_t *sinfo, const char *url, int flags, + struct mp_cancel *c, struct mpv_global *global, + void *arg, struct stream **ret); struct stream *stream_create(const char *url, int flags, struct mp_cancel *c, struct mpv_global *global); struct stream *stream_open(const char *filename, struct mpv_global *global); stream_t *open_output_stream(const char *filename, struct mpv_global *global); -stream_t *open_memory_stream(void *data, int len); void mp_url_unescape_inplace(char *buf); char *mp_url_escape(void *talloc_ctx, const char *s, const char *ok); +// stream_memory.c +struct stream *stream_memory_open(struct mpv_global *global, void *data, int len); + // stream_file.c char *mp_file_url_to_filename(void *talloc_ctx, bstr url); char *mp_file_get_path(void *talloc_ctx, bstr url); |