2 * Network layer for MPlayer
3 * by Bertrand BAUDET <bertrand_baudet@yahoo.com>
4 * (C) 2001, MPlayer team.
12 #include <sys/types.h>
17 #include <netinet/in.h>
18 #include <sys/socket.h>
19 #include <arpa/inet.h>
26 #define BUFFER_SIZE 2048
29 const char *mime_type
;
38 typedef struct streaming_control
{
40 streaming_status status
;
41 int buffering
; // boolean
42 unsigned int prebuffer_size
;
44 unsigned int buffer_size
;
45 unsigned int buffer_pos
;
46 unsigned int bandwidth
; // The downstream available
47 int (*streaming_read
)( int fd
, char *buffer
, int buffer_size
, struct streaming_control
*stream_ctrl
);
48 int (*streaming_seek
)( int fd
, off_t pos
, struct streaming_control
*stream_ctrl
);
52 //int streaming_start( stream_t *stream, int *demuxer_type, URL_t *url );
53 streaming_ctrl_t
*streaming_ctrl_new(void);
54 int streaming_bufferize( streaming_ctrl_t
*streaming_ctrl
, char *buffer
, int size
);
56 int nop_streaming_read( int fd
, char *buffer
, int size
, streaming_ctrl_t
*stream_ctrl
);
57 int nop_streaming_seek( int fd
, off_t pos
, streaming_ctrl_t
*stream_ctrl
);
58 void streaming_ctrl_free( streaming_ctrl_t
*streaming_ctrl
);
60 int http_send_request(URL_t
*url
, off_t pos
);
61 HTTP_header_t
*http_read_response(int fd
);
63 int http_authenticate(HTTP_header_t
*http_hdr
, URL_t
*url
, int *auth_retry
);
64 URL_t
* check4proxies(URL_t
*url
);
66 #endif /* NETWORK_H */