summaryrefslogtreecommitdiffstats
path: root/stream/stream.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-02 17:02:34 +0200
committerwm4 <wm4@nowhere>2013-08-02 17:02:34 +0200
commitbc1d61cf4296ab41564adb896e454e48c292e451 (patch)
tree461dfa0cb61af73b62838608aa8fbb3dd99d3642 /stream/stream.h
parent964194b55bf86d7c8b76febe8bf54c49648e79c1 (diff)
downloadmpv-bc1d61cf4296ab41564adb896e454e48c292e451.tar.bz2
mpv-bc1d61cf4296ab41564adb896e454e48c292e451.tar.xz
stream: redo URL parsing, replace m_struct usage with m_config
Move the URL parsing code from m_option.c to stream.c, and simplify it dramatically. This code originates from times when http code used this, but now it's just relict from other stream implementations reusing this code. Remove the unused bits and simplify the rest. stream_vcd is insane, and the priv struct is different on every platform, so drop the URL parsing. This means you can't specify a track anymore, only the device. (Does anyone use stream_vcd? Not like this couldn't be fixed, but it doesn't seem worth the effort, especially because it'd require potentially touching platform specific code.)
Diffstat (limited to 'stream/stream.h')
-rw-r--r--stream/stream.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/stream/stream.h b/stream/stream.h
index a0cd3d58fc..9800efbafd 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -109,15 +109,17 @@ struct stream;
typedef struct stream_info_st {
const char *name;
// opts is set from ->opts
- int (*open)(struct stream *st, int mode, void *opts);
+ int (*open)(struct stream *st, int mode);
const char *protocols[MAX_STREAM_PROTOCOLS];
- const void *opts;
- int opts_url; /* If this is 1 we will parse the url as an option string
- * too. Otherwise options are only parsed from the
- * options string given to open_stream_plugin */
+ int priv_size;
+ const void *priv_defaults;
+ const struct m_option *options;
+ const char *url_options[][2];
} stream_info_t;
typedef struct stream {
+ const struct stream_info_st *info;
+
// Read
int (*fill_buffer)(struct stream *s, char *buffer, int max_len);
// Write
@@ -142,7 +144,8 @@ typedef struct stream {
int mode; //STREAM_READ or STREAM_WRITE
bool streaming; // known to be a network stream if true
void *priv; // used for DVD, TV, RTSP etc
- char *url; // strdup() of filename/url
+ char *url; // filename/url (possibly including protocol prefix)
+ char *path; // filename (url without protocol prefix)
char *mime_type; // when HTTP streaming is used
char *demuxer; // request demuxer to be used
char *lavf_type; // name of expected demuxer type for lavf