2001-05-29 17:03:17 +00:00
|
|
|
/*
|
|
|
|
* Network layer for MPlayer
|
|
|
|
* by Bertrand BAUDET <bertrand_baudet@yahoo.com>
|
|
|
|
* (C) 2001, MPlayer team.
|
|
|
|
*/
|
2001-05-20 12:58:41 +00:00
|
|
|
|
2001-05-29 17:03:17 +00:00
|
|
|
#ifndef __NETWORK_H
|
|
|
|
#define __NETWORK_H
|
|
|
|
|
2001-12-10 01:34:08 +00:00
|
|
|
#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>
|
|
|
|
|
2001-05-29 17:03:17 +00:00
|
|
|
#include "url.h"
|
2001-05-20 12:58:41 +00:00
|
|
|
|
2001-06-04 17:52:33 +00:00
|
|
|
#define BUFFER_SIZE 2048
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
streaming_stopped_e,
|
|
|
|
streaming_playing_e
|
|
|
|
} streaming_status;
|
|
|
|
|
|
|
|
typedef struct streaming_control {
|
2001-11-20 22:20:20 +00:00
|
|
|
URL_t *url;
|
2001-06-04 17:52:33 +00:00
|
|
|
streaming_status status;
|
|
|
|
int buffering; // boolean
|
2001-11-20 22:20:20 +00:00
|
|
|
unsigned int prebuffer_size;
|
|
|
|
char *buffer;
|
|
|
|
unsigned int buffer_size;
|
|
|
|
unsigned int buffer_pos;
|
|
|
|
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 );
|
2001-12-11 01:06:08 +00:00
|
|
|
void *data;
|
2001-06-04 17:52:33 +00:00
|
|
|
} streaming_ctrl_t;
|
|
|
|
|
2001-11-20 22:20:20 +00:00
|
|
|
int streaming_bufferize( streaming_ctrl_t *streaming_ctrl, char *buffer, int size);
|
2001-06-04 17:52:33 +00:00
|
|
|
|
2001-11-20 22:20:20 +00:00
|
|
|
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 );
|
2001-05-20 12:58:41 +00:00
|
|
|
|
2001-12-10 01:39:25 +00:00
|
|
|
int connect2Server(char *host, int port);
|
|
|
|
|
2001-05-20 12:58:41 +00:00
|
|
|
#endif
|