Mercurial > mplayer.hg
annotate libmpdemux/network.h @ 15286:1e8305fffa79
Also '3g2a' can be used for 3GPP Profile 2
Based on patch by adland
author | rtognimp |
---|---|
date | Thu, 28 Apr 2005 18:25:50 +0000 |
parents | 3d75bcc28231 |
children | 281d155fb37f |
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> |
10281 | 11 #include <sys/time.h> |
12 #include <sys/types.h> | |
13 | |
14 #include "config.h" | |
15 #ifndef HAVE_WINSOCK2 | |
3424
1c2fb4764745
Moved the network related include files from network.c to network.h
bertrand
parents:
3042
diff
changeset
|
16 #include <netdb.h> |
1c2fb4764745
Moved the network related include files from network.c to network.h
bertrand
parents:
3042
diff
changeset
|
17 #include <netinet/in.h> |
1c2fb4764745
Moved the network related include files from network.c to network.h
bertrand
parents:
3042
diff
changeset
|
18 #include <sys/socket.h> |
1c2fb4764745
Moved the network related include files from network.c to network.h
bertrand
parents:
3042
diff
changeset
|
19 #include <arpa/inet.h> |
10281 | 20 #endif |
3424
1c2fb4764745
Moved the network related include files from network.c to network.h
bertrand
parents:
3042
diff
changeset
|
21 |
903 | 22 #include "url.h" |
6455
c4078c1f9d53
Added a function prototype for reuse outside of network.c
bertrand
parents:
4729
diff
changeset
|
23 #include "http.h" |
4046
f732854e3d16
Kept the HTTP connection open after autodetect, so
bertrand
parents:
3453
diff
changeset
|
24 #include "stream.h" |
903 | 25 |
999
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
26 #define BUFFER_SIZE 2048 |
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
27 |
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
28 typedef enum { |
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
29 streaming_stopped_e, |
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
30 streaming_playing_e |
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
31 } streaming_status; |
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
32 |
3042 | 33 typedef struct streaming_control { |
34 URL_t *url; | |
35 streaming_status status; | |
36 int buffering; // boolean | |
37 unsigned int prebuffer_size; | |
999
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
38 char *buffer; |
3042 | 39 unsigned int buffer_size; |
40 unsigned int buffer_pos; | |
6641
2cdaadd779ac
Added the bandwidth variable. Used to set the max download bandwidth
bertrand
parents:
6455
diff
changeset
|
41 unsigned int bandwidth; // The downstream available |
3042 | 42 int (*streaming_read)( int fd, char *buffer, int buffer_size, struct streaming_control *stream_ctrl ); |
43 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
|
44 void *data; |
999
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
45 } streaming_ctrl_t; |
92833c9472e8
Continue implementation of the network streaming part.
bertrand
parents:
903
diff
changeset
|
46 |
4729
f51bd827ed1c
fixed MP3 ICY detection, return detected file format for open_stream
alex
parents:
4251
diff
changeset
|
47 //int streaming_start( stream_t *stream, int *demuxer_type, URL_t *url ); |
4046
f732854e3d16
Kept the HTTP connection open after autodetect, so
bertrand
parents:
3453
diff
changeset
|
48 |
3042 | 49 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
|
50 |
3042 | 51 int nop_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *stream_ctrl ); |
52 int nop_streaming_seek( int fd, off_t pos, streaming_ctrl_t *stream_ctrl ); | |
841 | 53 |
10625
620cc649f519
ftp support. The change on connect2Server is needed bcs we need 2
albeu
parents:
10281
diff
changeset
|
54 int connect2Server(char *host, int port,int verb); |
3428 | 55 |
11965 | 56 int http_send_request(URL_t *url, off_t pos); |
6455
c4078c1f9d53
Added a function prototype for reuse outside of network.c
bertrand
parents:
4729
diff
changeset
|
57 HTTP_header_t *http_read_response(int fd); |
c4078c1f9d53
Added a function prototype for reuse outside of network.c
bertrand
parents:
4729
diff
changeset
|
58 |
7953 | 59 int http_authenticate(HTTP_header_t *http_hdr, URL_t *url, int *auth_retry); |
60 | |
841 | 61 #endif |