summaryrefslogtreecommitdiffstats
path: root/stream/stream.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-12-01 23:28:58 +0100
committerwm4 <wm4@nowhere>2012-12-03 21:08:51 +0100
commit6294c785490be5fc31d29758ca592510fd161371 (patch)
treea03c9135534f28cf7e9a62abcde87c65eb54eeaa /stream/stream.h
parent2d58234c86e59298de52fec12d1eb59086d68763 (diff)
downloadmpv-6294c785490be5fc31d29758ca592510fd161371.tar.bz2
mpv-6294c785490be5fc31d29758ca592510fd161371.tar.xz
cache: simplify further
This commit is separate from the previous one to separate our own changes from changes merged from mplayer2 (as far as that was possible). Make it easier for stream implementations to request being cached. Set a default cache size in stream.c, and remove them from various stream implementations. Only MS streaming support sets a meaningful cache size. Make querying cache size saner. This reduces the amount of #ifdefs needed.
Diffstat (limited to 'stream/stream.h')
-rw-r--r--stream/stream.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/stream/stream.h b/stream/stream.h
index dd092ddaec..a112b0f3f6 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -98,6 +98,8 @@
#define STREAM_CTRL_GET_NUM_TITLES 12
#define STREAM_CTRL_GET_LANG 13
#define STREAM_CTRL_GET_CURRENT_TITLE 14
+#define STREAM_CTRL_GET_CACHE_SIZE 15
+#define STREAM_CTRL_GET_CACHE_FILL 16
struct stream_lang_req {
int type; // STREAM_AUDIO, STREAM_SUB
@@ -113,8 +115,6 @@ typedef enum {
typedef struct streaming_control {
URL_t *url;
streaming_status status;
- int buffering; // boolean
- unsigned int prebuffer_size;
char *buffer;
unsigned int buffer_size;
unsigned int buffer_pos;
@@ -167,8 +167,9 @@ typedef struct stream {
int64_t pos,start_pos,end_pos;
int eof;
int mode; //STREAM_READ or STREAM_WRITE
- int cache_size; // cache size to use if enabled
- bool cached;
+ bool streaming; // known to be a network stream if true
+ int cache_size; // cache size in KB to use if enabled
+ bool cached; // cache active
unsigned int cache_pid;
void* cache_data;
void* priv; // used for DVD, TV, RTSP etc