diff options
author | 2001-06-04 17:52:33 +0000 | |
---|---|---|
committer | 2001-06-04 17:52:33 +0000 | |
commit | fc3822a39693169d44c264dee5a42760c8e1138a (patch) | |
tree | f79a06f1d1d301a8aaf1abcdc420db8d87341db6 /network.h | |
parent | 98e6e286b95c4166390e68dd025e17037d6208c0 (diff) |
Continue implementation of the network streaming part.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1000 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'network.h')
-rw-r--r-- | network.h | 35 |
1 files changed, 32 insertions, 3 deletions
@@ -7,14 +7,43 @@ #ifndef __NETWORK_H #define __NETWORK_H -#define STREAMING_TYPE_UNKNOWN -1 -#define STREAMING_TYPE_ASF 0 -#define STREAMING_TYPE_MP3 1 +#include <pthread.h> +#include "stream.h" #include "url.h" +#define BUFFER_SIZE 2048 + +typedef enum { + streaming_stopped_e, + streaming_playing_e +} streaming_status; + +typedef struct { + char *buffer; + int length; +} Net_Fifo; + +typedef struct streaming_control { + URL_t **url; + int fd_net; + int fd_pipe_in; + streaming_status status; + pthread_t thread_id; + Net_Fifo *buffer; + int buffering; // boolean + int prebuffer_size; + int (*streaming_read)( struct streaming_control *stream_ctrl ); +} streaming_ctrl_t; + +Net_Fifo* net_fifo_new( ); +void net_fifo_free(Net_Fifo *net_fifo ); +int net_fifo_pop(Net_Fifo *net_fifo, char *buffer, int length ); +int net_fifo_push(Net_Fifo *net_fifo, char *buffer, int length ); + int connect2Server(char *host, int port); +int readFromServer(int fd, char *buffer, int length ); int autodetectProtocol( URL_t *url, int *fd_out ); #endif |