Mercurial > mplayer.hg
annotate libmpdemux/network.h @ 3670:d867df5432ad
DeFucking
author | gabucino |
---|---|
date | Sun, 23 Dec 2001 13:32:32 +0000 |
parents | 10577da4a7b1 |
children | f732854e3d16 |
rev | line source |
---|---|
903 | 1 /* |
2 * Network layer for MPlayer | |
3 * by Bertrand BAUDET <bertrand_baudet@yahoo.com> | |
4 * (C) 2001, MPlayer team. | |
5 */ | |
6 | |
7 #ifndef __NETWORK_H | |
8 #define __NETWORK_H | |
9 | |
3424
1c2fb4764745
Moved the network related include files from network.c to network.h
bertrand
parents:
3042
diff
changeset
|
10 #include <fcntl.h> |
1c2fb4764745
Moved the network related include files from network.c to network.h
bertrand
parents:
3042
diff
changeset
|
11 #include <netdb.h> |
1c2fb4764745
Moved the network related include files from network.c to network.h
bertrand
parents:
3042
diff
changeset
|
12 #include <netinet/in.h> |
1c2fb4764745
Moved the network related include files from network.c to network.h
bertrand
parents:
3042
diff
changeset
|
13 #include <sys/time.h> |
1c2fb4764745
Moved the network related include files from network.c to network.h
bertrand
parents:
3042
diff
changeset
|
14 #include <sys/types.h> |
1c2fb4764745
Moved the network related include files from network.c to network.h
bertrand
parents:
3042
diff
changeset
|
15 #include <sys/socket.h> |
1c2fb4764745
Moved the network related include files from network.c to network.h
bertrand
parents:
3042
diff
changeset
|
16 #include <arpa/inet.h> |
1c2fb4764745
Moved the network related include files from network.c to network.h
bertrand
parents:
3042
diff
changeset
|
17 |
903 | 18 #include "url.h" |
19 | |
999
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
20 #define BUFFER_SIZE 2048 |
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
21 |
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
22 typedef enum { |
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
23 streaming_stopped_e, |
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
24 streaming_playing_e |
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
25 } streaming_status; |
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
26 |
3042 | 27 typedef struct streaming_control { |
28 URL_t *url; | |
29 streaming_status status; | |
30 int buffering; // boolean | |
31 unsigned int prebuffer_size; | |
999
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
32 char *buffer; |
3042 | 33 unsigned int buffer_size; |
34 unsigned int buffer_pos; | |
35 int (*streaming_read)( int fd, char *buffer, int buffer_size, struct streaming_control *stream_ctrl ); | |
36 int (*streaming_seek)( int fd, off_t pos, struct streaming_control *stream_ctrl ); | |
3453
10577da4a7b1
Added a data field in the streaming_ctrl_t struct, to store any
bertrand
parents:
3428
diff
changeset
|
37 void *data; |
999
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
38 } streaming_ctrl_t; |
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
39 |
3042 | 40 int streaming_bufferize( streaming_ctrl_t *streaming_ctrl, char *buffer, int size); |
999
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
41 |
3042 | 42 int nop_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *stream_ctrl ); |
43 int nop_streaming_seek( int fd, off_t pos, streaming_ctrl_t *stream_ctrl ); | |
841 | 44 |
3428 | 45 int connect2Server(char *host, int port); |
46 | |
841 | 47 #endif |