annotate libmpdemux/network.h @ 3435:7b78672b7ad4

support in dbgprintf for mp_msg (mplayer only)
author alex
date Mon, 10 Dec 2001 16:06:10 +0000
parents 9acbded8e5ba
children 10577da4a7b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
903
7f6641b1b0df Added autodetection of potential stream type.
bertrand
parents: 841
diff changeset
1 /*
7f6641b1b0df Added autodetection of potential stream type.
bertrand
parents: 841
diff changeset
2 * Network layer for MPlayer
7f6641b1b0df Added autodetection of potential stream type.
bertrand
parents: 841
diff changeset
3 * by Bertrand BAUDET <bertrand_baudet@yahoo.com>
7f6641b1b0df Added autodetection of potential stream type.
bertrand
parents: 841
diff changeset
4 * (C) 2001, MPlayer team.
7f6641b1b0df Added autodetection of potential stream type.
bertrand
parents: 841
diff changeset
5 */
7f6641b1b0df Added autodetection of potential stream type.
bertrand
parents: 841
diff changeset
6
7f6641b1b0df Added autodetection of potential stream type.
bertrand
parents: 841
diff changeset
7 #ifndef __NETWORK_H
7f6641b1b0df Added autodetection of potential stream type.
bertrand
parents: 841
diff changeset
8 #define __NETWORK_H
7f6641b1b0df Added autodetection of potential stream type.
bertrand
parents: 841
diff changeset
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
7f6641b1b0df Added autodetection of potential stream type.
bertrand
parents: 841
diff changeset
18 #include "url.h"
7f6641b1b0df Added autodetection of potential stream type.
bertrand
parents: 841
diff changeset
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
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
27 typedef struct streaming_control {
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
28 URL_t *url;
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
29 streaming_status status;
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
30 int buffering; // boolean
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
31 unsigned int prebuffer_size;
999
92833c9472e8 Continue implementation of the network streaming part.
bertrand
parents: 903
diff changeset
32 char *buffer;
3042
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
33 unsigned int buffer_size;
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
34 unsigned int buffer_pos;
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
35 int (*streaming_read)( int fd, char *buffer, int buffer_size, struct streaming_control *stream_ctrl );
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
36 int (*streaming_seek)( int fd, off_t pos, struct streaming_control *stream_ctrl );
999
92833c9472e8 Continue implementation of the network streaming part.
bertrand
parents: 903
diff changeset
37 } streaming_ctrl_t;
92833c9472e8 Continue implementation of the network streaming part.
bertrand
parents: 903
diff changeset
38
3042
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
39 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
40
3042
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
41 int nop_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *stream_ctrl );
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
42 int nop_streaming_seek( int fd, off_t pos, streaming_ctrl_t *stream_ctrl );
841
c906b7600fc6 Included "netdb.h" file needed.
bertrand
parents:
diff changeset
43
3428
9acbded8e5ba Added the connect2Server prototype.
bertrand
parents: 3424
diff changeset
44 int connect2Server(char *host, int port);
9acbded8e5ba Added the connect2Server prototype.
bertrand
parents: 3424
diff changeset
45
841
c906b7600fc6 Included "netdb.h" file needed.
bertrand
parents:
diff changeset
46 #endif