annotate libmpdemux/test.c @ 9545:d1bbeae9f46a

tdfx_vid a new kernel driver for tdfx wich let use agp move :)
author albeu
date Fri, 07 Mar 2003 18:42:08 +0000
parents 4c832590e18e
children 9a88e80e6314
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2310
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
1
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
2 #include <stdio.h>
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
3 #include <stdlib.h>
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
4 #include <string.h>
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
5
2555
66837325b929 config.h cleanup, few things added to steram/demuxer headers
arpi
parents: 2338
diff changeset
6 #include "config.h"
2310
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
7 #include "mp_msg.h"
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
8
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
9 #include "stream.h"
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
10 #include "demuxer.h"
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
11 #include "stheader.h"
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
12
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
13 //--------------------------
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
14
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
15 // audio stream skip/resync functions requires only for seeking.
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
16 // (they should be implemented in the audio codec layer)
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
17 void skip_audio_frame(sh_audio_t *sh_audio){
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
18 }
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
19 void resync_audio_stream(sh_audio_t *sh_audio){
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
20 }
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
21
7862
013c255225d8 mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents: 7859
diff changeset
22 int mp_input_check_interrupt(int time){
7867
3dc0b71630ff cleanup config option handling in libmpdemux.
arpi
parents: 7862
diff changeset
23 if(time) usleep(time);
7862
013c255225d8 mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents: 7859
diff changeset
24 return 0;
013c255225d8 mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents: 7859
diff changeset
25 }
013c255225d8 mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents: 7859
diff changeset
26
7859
72671e2510fd added libmpdemux depends to test.c
arpi
parents: 3562
diff changeset
27 // for libmpdvdkit2:
72671e2510fd added libmpdemux depends to test.c
arpi
parents: 3562
diff changeset
28 #include "../get_path.c"
72671e2510fd added libmpdemux depends to test.c
arpi
parents: 3562
diff changeset
29
2322
e22ec6fce385 cache2 support
arpi
parents: 2314
diff changeset
30 int verbose=5; // must be global!
2310
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
31
7874
4c832590e18e yeah, test.c works now!
arpi
parents: 7867
diff changeset
32 int stream_cache_size=0;
4c832590e18e yeah, test.c works now!
arpi
parents: 7867
diff changeset
33
4c832590e18e yeah, test.c works now!
arpi
parents: 7867
diff changeset
34 // for demux_ogg:
4c832590e18e yeah, test.c works now!
arpi
parents: 7867
diff changeset
35 void* vo_sub=NULL;
4c832590e18e yeah, test.c works now!
arpi
parents: 7867
diff changeset
36 int vo_osd_changed(int new_value){return 0;}
4c832590e18e yeah, test.c works now!
arpi
parents: 7867
diff changeset
37 int subcc_enabled=0;
4c832590e18e yeah, test.c works now!
arpi
parents: 7867
diff changeset
38
2310
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
39 //---------------
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
40
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
41 extern stream_t* open_stream(char* filename,int vcd_track,int* file_format);
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
42
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
43 int main(int argc,char* argv[]){
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
44
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
45 stream_t* stream=NULL;
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
46 demuxer_t* demuxer=NULL;
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
47 int file_format=DEMUXER_TYPE_UNKNOWN;
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
48
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
49 mp_msg_init(verbose+MSGL_STATUS);
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
50
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
51 if(argc>1)
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
52 stream=open_stream(argv[1],0,&file_format);
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
53 else
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
54 // stream=open_stream("/3d/divx/405divx_sm_v2[1].avi",0,&file_format);
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
55 stream=open_stream("/dev/cdrom",2,&file_format); // VCD track 2
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
56
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
57 if(!stream){
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
58 printf("Cannot open file/device\n");
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
59 exit(1);
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
60 }
2322
e22ec6fce385 cache2 support
arpi
parents: 2314
diff changeset
61
2310
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
62 printf("success: format: %d data: 0x%X - 0x%X\n",file_format, (int)(stream->start_pos),(int)(stream->end_pos));
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
63
7874
4c832590e18e yeah, test.c works now!
arpi
parents: 7867
diff changeset
64 if(stream_cache_size)
4c832590e18e yeah, test.c works now!
arpi
parents: 7867
diff changeset
65 stream_enable_cache(stream,stream_cache_size,0,0);
2322
e22ec6fce385 cache2 support
arpi
parents: 2314
diff changeset
66
2310
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
67 demuxer=demux_open(stream,file_format,-1,-1,-1);
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
68 if(!demuxer){
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
69 printf("Cannot open demuxer\n");
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
70 exit(1);
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
71 }
7874
4c832590e18e yeah, test.c works now!
arpi
parents: 7867
diff changeset
72
4c832590e18e yeah, test.c works now!
arpi
parents: 7867
diff changeset
73 if(demuxer->video->sh)
4c832590e18e yeah, test.c works now!
arpi
parents: 7867
diff changeset
74 video_read_properties(demuxer->video->sh);
2310
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
75
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
76 }