annotate libmpdemux/test.c @ 2368:e03d8f0e2515

changed functionality means changed definition.
author gabucino
date Mon, 22 Oct 2001 15:20:34 +0000
parents 4f3e8c8ea32f
children 66837325b929
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
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
6 #include "mp_msg.h"
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
7
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
8 #include "stream.h"
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
9 #include "demuxer.h"
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
10 #include "stheader.h"
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
11
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
12 //--------------------------
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
13
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
14 // audio stream skip/resync functions requires only for seeking.
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
15 // (they should be implemented in the audio codec layer)
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
16 void skip_audio_frame(sh_audio_t *sh_audio){
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
17 }
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
18 void resync_audio_stream(sh_audio_t *sh_audio){
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
19 }
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
20
2322
e22ec6fce385 cache2 support
arpi
parents: 2314
diff changeset
21 int verbose=5; // must be global!
2310
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
22
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
23 //---------------
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
24
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
25 extern stream_t* open_stream(char* filename,int vcd_track,int* file_format);
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
26
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
27 int main(int argc,char* argv[]){
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
28
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
29 stream_t* stream=NULL;
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
30 demuxer_t* demuxer=NULL;
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
31 int file_format=DEMUXER_TYPE_UNKNOWN;
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
32
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
33 mp_msg_init(verbose+MSGL_STATUS);
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
34
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
35 if(argc>1)
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
36 stream=open_stream(argv[1],0,&file_format);
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
37 else
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
38 // stream=open_stream("/3d/divx/405divx_sm_v2[1].avi",0,&file_format);
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
39 stream=open_stream("/dev/cdrom",2,&file_format); // VCD track 2
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
40
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
41 if(!stream){
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
42 printf("Cannot open file/device\n");
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
43 exit(1);
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
44 }
2322
e22ec6fce385 cache2 support
arpi
parents: 2314
diff changeset
45
2310
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
46 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
47
2322
e22ec6fce385 cache2 support
arpi
parents: 2314
diff changeset
48 stream_enable_cache(stream,2048*1024);
e22ec6fce385 cache2 support
arpi
parents: 2314
diff changeset
49
2310
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
50 demuxer=demux_open(stream,file_format,-1,-1,-1);
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
51 if(!demuxer){
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
52 printf("Cannot open demuxer\n");
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
53 exit(1);
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
54 }
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
55
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
56
9e059416eea6 libdemuxer...
arpi
parents:
diff changeset
57 }