summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-10 01:08:50 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-10 01:08:50 +0200
commit194efde18f8f2621f847bd2bc2c13bf58e865730 (patch)
treea98b71eb9727c082d71d1fc728c76e0393ea8b2a /stream
parent415a39cad0c801a9b904e75090730dbe5232142d (diff)
parente59081d1218547907a143ab54e1feaec43ec2bff (diff)
downloadmpv-194efde18f8f2621f847bd2bc2c13bf58e865730.tar.bz2
mpv-194efde18f8f2621f847bd2bc2c13bf58e865730.tar.xz
Merge svn changes up to r30702
Diffstat (limited to 'stream')
-rw-r--r--stream/http.c2
-rw-r--r--stream/network.h27
-rw-r--r--stream/stream.h30
3 files changed, 30 insertions, 29 deletions
diff --git a/stream/http.c b/stream/http.c
index f4ce03e038..bda6c060c7 100644
--- a/stream/http.c
+++ b/stream/http.c
@@ -47,8 +47,6 @@ extern const mime_struct_t mime_type_table[];
extern int stream_cache_size;
extern int network_bandwidth;
-int http_seek(stream_t *stream, off_t pos);
-
typedef struct {
unsigned metaint;
unsigned metapos;
diff --git a/stream/network.h b/stream/network.h
index 8e1f5982b3..b842b1ed24 100644
--- a/stream/network.h
+++ b/stream/network.h
@@ -35,6 +35,7 @@
#include <arpa/inet.h>
#endif
+#include "stream.h"
#include "url.h"
#include "http.h"
@@ -52,29 +53,6 @@ typedef struct {
int demuxer_type;
} mime_struct_t;
-typedef enum {
- streaming_stopped_e,
- streaming_playing_e
-} streaming_status;
-
-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;
- unsigned int bandwidth; // The downstream available
- int (*streaming_read)( int fd, char *buffer, int buffer_size, struct streaming_control *stream_ctrl );
- int (*streaming_seek)( int fd, off_t pos, struct streaming_control *stream_ctrl );
- void *data;
- // hacks for asf
- int *audio_id_ptr;
- int *video_id_ptr;
-} streaming_ctrl_t;
-
-//int streaming_start( stream_t *stream, int *demuxer_type, URL_t *url );
streaming_ctrl_t *streaming_ctrl_new(void);
int streaming_bufferize( streaming_ctrl_t *streaming_ctrl, char *buffer, int size);
@@ -88,4 +66,7 @@ HTTP_header_t *http_read_response(int fd);
int http_authenticate(HTTP_header_t *http_hdr, URL_t *url, int *auth_retry);
URL_t* check4proxies(URL_t *url);
+void fixup_network_stream_cache(stream_t *stream);
+int http_seek(stream_t *stream, off_t pos);
+
#endif /* MPLAYER_NETWORK_H */
diff --git a/stream/stream.h b/stream/stream.h
index 2dd65051c8..c48dd2a8b2 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -21,6 +21,7 @@
#include "config.h"
#include "mp_msg.h"
+#include "url.h"
#include <string.h>
#include <inttypes.h>
#include <sys/types.h>
@@ -89,9 +90,27 @@
#define STREAM_CTRL_SET_ANGLE 11
-#ifdef CONFIG_NETWORK
-#include "network.h"
-#endif
+typedef enum {
+ streaming_stopped_e,
+ streaming_playing_e
+} streaming_status;
+
+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;
+ unsigned int bandwidth; // The downstream available
+ int (*streaming_read)( int fd, char *buffer, int buffer_size, struct streaming_control *stream_ctrl );
+ int (*streaming_seek)( int fd, off_t pos, struct streaming_control *stream_ctrl );
+ void *data;
+ // hacks for asf
+ int *audio_id_ptr;
+ int *video_id_ptr;
+} streaming_ctrl_t;
struct stream;
typedef struct stream_info_st {
@@ -143,6 +162,10 @@ typedef struct stream {
unsigned char buffer[STREAM_BUFFER_SIZE>VCD_SECTOR_SIZE?STREAM_BUFFER_SIZE:VCD_SECTOR_SIZE];
} stream_t;
+#ifdef CONFIG_NETWORK
+#include "network.h"
+#endif
+
int stream_fill_buffer(stream_t *s);
int stream_seek_long(stream_t *s, off_t pos);
@@ -156,7 +179,6 @@ int cache_stream_seek_long(stream_t *s,off_t pos);
#define cache_stream_seek_long(x,y) stream_seek_long(x,y)
#define stream_enable_cache(x,y,z,w) 1
#endif
-void fixup_network_stream_cache(stream_t *stream);
int stream_write_buffer(stream_t *s, unsigned char *buf, int len);
inline static int stream_read_char(stream_t *s){