From 49867bd432352d19172ab26cf873bd5651e69e25 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 31 Jul 2006 17:39:17 +0000 Subject: introduce new 'stream' directory for all stream layer related components and split them from libmpdemux git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19277 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/network.h | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 stream/network.h (limited to 'stream/network.h') diff --git a/stream/network.h b/stream/network.h new file mode 100644 index 0000000000..bb659fa6ba --- /dev/null +++ b/stream/network.h @@ -0,0 +1,68 @@ +/* + * Network layer for MPlayer + * by Bertrand BAUDET + * (C) 2001, MPlayer team. + */ + +#ifndef __NETWORK_H +#define __NETWORK_H + +#include +#include +#include + +#include "config.h" +#ifndef HAVE_WINSOCK2 +#include +#include +#include +#include +#endif + +#include "url.h" +#include "http.h" +#include "stream.h" + +#define BUFFER_SIZE 2048 + +typedef struct { + const char *mime_type; + 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; +} 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); + +int nop_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *stream_ctrl ); +int nop_streaming_seek( int fd, off_t pos, streaming_ctrl_t *stream_ctrl ); +void streaming_ctrl_free( streaming_ctrl_t *streaming_ctrl ); + +int connect2Server(char *host, int port,int verb); + +int http_send_request(URL_t *url, off_t pos); +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); + +#endif -- cgit v1.2.3