1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-15 11:25:10 +00:00
mpv/libmpdemux/network.h
alex 0884192c18 removed some wrappers, now the configure checks for inet_pton. patch by Joey Parrish <joey@nicewarrior.org>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9891 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-04-09 16:21:42 +00:00

58 lines
1.4 KiB
C

/*
* Network layer for MPlayer
* by Bertrand BAUDET <bertrand_baudet@yahoo.com>
* (C) 2001, MPlayer team.
*/
#ifndef __NETWORK_H
#define __NETWORK_H
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include "url.h"
#include "http.h"
#include "stream.h"
#define BUFFER_SIZE 2048
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 );
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 );
int connect2Server(char *host, int port);
int http_send_request(URL_t *url);
HTTP_header_t *http_read_response(int fd);
int http_authenticate(HTTP_header_t *http_hdr, URL_t *url, int *auth_retry);
#endif