comparison libmpdemux/stream.h @ 7407:8780415baa87

stream layer cleanup - part 1 STREAMTYPE_MF removed, using STREAMTYPE_DUMMY instead mf.c/demux_mf updated to do the opening in demux_open instead of stream_open
author arpi
date Sun, 15 Sep 2002 19:47:49 +0000
parents 1394aebaa838
children 0c6948b8100f
comparison
equal deleted inserted replaced
7406:1394aebaa838 7407:8780415baa87
5 #include <inttypes.h> 5 #include <inttypes.h>
6 #include <sys/types.h> 6 #include <sys/types.h>
7 7
8 #define STREAM_BUFFER_SIZE 2048 8 #define STREAM_BUFFER_SIZE 2048
9 9
10 #define STREAMTYPE_FILE 0 10 #define STREAMTYPE_DUMMY -1 // for placeholders, when the actual reading is handled in the demuxer
11 #define STREAMTYPE_VCD 1 11 #define STREAMTYPE_FILE 0 // read from seekable file
12 #define STREAMTYPE_STREAM 2 // same as FILE but no seeking (for stdin) 12 #define STREAMTYPE_VCD 1 // raw mode-2 CDROM reading, 2324 bytes/sector
13 #define STREAMTYPE_DVD 3 13 #define STREAMTYPE_STREAM 2 // same as FILE but no seeking (for net/stdin)
14 #define STREAMTYPE_MEMORY 4 14 #define STREAMTYPE_DVD 3 // libdvdread
15 #define STREAMTYPE_TV 5 15 #define STREAMTYPE_MEMORY 4 // read data from memory area
16 #define STREAMTYPE_PLAYLIST 6 16 #define STREAMTYPE_TV 5 // FIXME!!! dummy
17 #define STREAMTYPE_MF 7 17 #define STREAMTYPE_PLAYLIST 6 // FIXME!!! same as STREAMTYPE_FILE now
18 #define STREAMTYPE_DS 8 18 #define STREAMTYPE_DS 8 // read from a demuxer stream
19 #define STREAMTYPE_DVDNAV 9 // we cannot safely "seek" in this... 19 #define STREAMTYPE_DVDNAV 9 // we cannot safely "seek" in this...
20 #define STREAMTYPE_CDDA 10 20 #define STREAMTYPE_CDDA 10 // raw audio CD reader
21 21
22 #define VCD_SECTOR_SIZE 2352 22 #define VCD_SECTOR_SIZE 2352
23 #define VCD_SECTOR_OFFS 24 23 #define VCD_SECTOR_OFFS 24
24 #define VCD_SECTOR_DATA 2324 24 #define VCD_SECTOR_DATA 2324
25 25
29 29
30 int vcd_seek_to_track(int fd,int track); 30 int vcd_seek_to_track(int fd,int track);
31 void vcd_read_toc(int fd); 31 void vcd_read_toc(int fd);
32 32
33 typedef struct { 33 typedef struct {
34 int fd; 34 int fd; // file descriptor, see man open(2)
35 int type; // 0=file 1=VCD 35 int type; // see STREAMTYPE_*
36 unsigned int buf_pos,buf_len; 36 unsigned int buf_pos,buf_len;
37 off_t pos,start_pos,end_pos; 37 off_t pos,start_pos,end_pos;
38 int eof; 38 int eof;
39 unsigned int cache_pid; 39 unsigned int cache_pid;
40 void* cache_data; 40 void* cache_data;
41 void* priv; // used for DVD, TV, RTSP etc 41 void* priv; // used for DVD, TV, RTSP etc
42 unsigned char buffer[STREAM_BUFFER_SIZE>VCD_SECTOR_SIZE?STREAM_BUFFER_SIZE:VCD_SECTOR_SIZE]; 42 char* url; // strdup() of filename/url
43 #ifdef STREAMING 43 #ifdef STREAMING
44 streaming_ctrl_t *streaming_ctrl; 44 streaming_ctrl_t *streaming_ctrl;
45 #endif 45 #endif
46 unsigned char buffer[STREAM_BUFFER_SIZE>VCD_SECTOR_SIZE?STREAM_BUFFER_SIZE:VCD_SECTOR_SIZE];
46 } stream_t; 47 } stream_t;
47 48
48 #ifdef USE_STREAM_CACHE 49 #ifdef USE_STREAM_CACHE
49 int stream_enable_cache(stream_t *stream,int size,int min,int prefill); 50 int stream_enable_cache(stream_t *stream,int size,int min,int prefill);
50 #else 51 #else