annotate stream/network.h @ 26391:16ab100f5870

removed useless parameter :type from -dvbin (the frontend type is reported by the card)
author nicodvb
date Sat, 12 Apr 2008 20:36:57 +0000
parents 4d54efbb35ec
children 5a30f5bc23a0
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
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
7 #ifndef MPLAYER_NETWORK_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
8 #define MPLAYER_NETWORK_H
903
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>
10281
54bcbf28698a Networking support under MinGW.
diego
parents: 9890
diff changeset
11 #include <sys/time.h>
54bcbf28698a Networking support under MinGW.
diego
parents: 9890
diff changeset
12 #include <sys/types.h>
54bcbf28698a Networking support under MinGW.
diego
parents: 9890
diff changeset
13
54bcbf28698a Networking support under MinGW.
diego
parents: 9890
diff changeset
14 #include "config.h"
54bcbf28698a Networking support under MinGW.
diego
parents: 9890
diff changeset
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
54bcbf28698a Networking support under MinGW.
diego
parents: 9890
diff changeset
20 #endif
3424
1c2fb4764745 Moved the network related include files from network.c to network.h
bertrand
parents: 3042
diff changeset
21
903
7f6641b1b0df Added autodetection of potential stream type.
bertrand
parents: 841
diff changeset
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"
903
7f6641b1b0df Added autodetection of potential stream type.
bertrand
parents: 841
diff changeset
24
999
92833c9472e8 Continue implementation of the network streaming part.
bertrand
parents: 903
diff changeset
25 #define BUFFER_SIZE 2048
92833c9472e8 Continue implementation of the network streaming part.
bertrand
parents: 903
diff changeset
26
15585
281d155fb37f ported all network streams to the new API
nicodvb
parents: 11965
diff changeset
27 typedef struct {
19194
5949a654e2d4 marks some read-only char* inside structs as const, patch by Stefan Huehner, stefan At huehner-org
reynaldo
parents: 17566
diff changeset
28 const char *mime_type;
15585
281d155fb37f ported all network streams to the new API
nicodvb
parents: 11965
diff changeset
29 int demuxer_type;
281d155fb37f ported all network streams to the new API
nicodvb
parents: 11965
diff changeset
30 } mime_struct_t;
281d155fb37f ported all network streams to the new API
nicodvb
parents: 11965
diff changeset
31
999
92833c9472e8 Continue implementation of the network streaming part.
bertrand
parents: 903
diff changeset
32 typedef enum {
92833c9472e8 Continue implementation of the network streaming part.
bertrand
parents: 903
diff changeset
33 streaming_stopped_e,
92833c9472e8 Continue implementation of the network streaming part.
bertrand
parents: 903
diff changeset
34 streaming_playing_e
92833c9472e8 Continue implementation of the network streaming part.
bertrand
parents: 903
diff changeset
35 } streaming_status;
92833c9472e8 Continue implementation of the network streaming part.
bertrand
parents: 903
diff changeset
36
3042
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
37 typedef struct streaming_control {
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
38 URL_t *url;
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
39 streaming_status status;
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
40 int buffering; // boolean
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
41 unsigned int prebuffer_size;
999
92833c9472e8 Continue implementation of the network streaming part.
bertrand
parents: 903
diff changeset
42 char *buffer;
3042
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
43 unsigned int buffer_size;
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
44 unsigned int buffer_pos;
6641
2cdaadd779ac Added the bandwidth variable. Used to set the max download bandwidth
bertrand
parents: 6455
diff changeset
45 unsigned int bandwidth; // The downstream available
3042
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
46 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
47 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
48 void *data;
999
92833c9472e8 Continue implementation of the network streaming part.
bertrand
parents: 903
diff changeset
49 } streaming_ctrl_t;
92833c9472e8 Continue implementation of the network streaming part.
bertrand
parents: 903
diff changeset
50
4729
f51bd827ed1c fixed MP3 ICY detection, return detected file format for open_stream
alex
parents: 4251
diff changeset
51 //int streaming_start( stream_t *stream, int *demuxer_type, URL_t *url );
17566
f580a7755ac5 Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents: 15585
diff changeset
52 streaming_ctrl_t *streaming_ctrl_new(void);
3042
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
53 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
54
3042
6b6fa2be9b97 Removed my buffer hack to use cache2.
bertrand
parents: 2310
diff changeset
55 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
56 int nop_streaming_seek( int fd, off_t pos, streaming_ctrl_t *stream_ctrl );
15585
281d155fb37f ported all network streams to the new API
nicodvb
parents: 11965
diff changeset
57 void streaming_ctrl_free( streaming_ctrl_t *streaming_ctrl );
841
c906b7600fc6 Included "netdb.h" file needed.
bertrand
parents:
diff changeset
58
11965
3d75bcc28231 enable seeking in http streams
attila
parents: 10625
diff changeset
59 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
60 HTTP_header_t *http_read_response(int fd);
c4078c1f9d53 Added a function prototype for reuse outside of network.c
bertrand
parents: 4729
diff changeset
61
7953
60624e692b95 GCC warning fixes
bertrand
parents: 7135
diff changeset
62 int http_authenticate(HTTP_header_t *http_hdr, URL_t *url, int *auth_retry);
15585
281d155fb37f ported all network streams to the new API
nicodvb
parents: 11965
diff changeset
63 URL_t* check4proxies(URL_t *url);
7953
60624e692b95 GCC warning fixes
bertrand
parents: 7135
diff changeset
64
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
65 #endif /* MPLAYER_NETWORK_H */