2001-10-20 18:49:08 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2001-10-30 17:03:11 +00:00
|
|
|
#include "config.h"
|
2001-10-20 18:49:08 +00:00
|
|
|
#include "mp_msg.h"
|
|
|
|
|
|
|
|
#include "stream.h"
|
|
|
|
#include "demuxer.h"
|
|
|
|
#include "stheader.h"
|
|
|
|
|
|
|
|
//--------------------------
|
|
|
|
|
|
|
|
// audio stream skip/resync functions requires only for seeking.
|
|
|
|
// (they should be implemented in the audio codec layer)
|
|
|
|
void skip_audio_frame(sh_audio_t *sh_audio){
|
|
|
|
}
|
|
|
|
void resync_audio_stream(sh_audio_t *sh_audio){
|
|
|
|
}
|
|
|
|
|
2002-10-23 14:46:20 +00:00
|
|
|
int mp_input_check_interrupt(int time){
|
2002-10-23 17:21:01 +00:00
|
|
|
if(time) usleep(time);
|
2002-10-23 14:46:20 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-10-23 13:59:05 +00:00
|
|
|
// for libmpdvdkit2:
|
|
|
|
#include "../get_path.c"
|
|
|
|
|
2001-10-20 23:51:02 +00:00
|
|
|
int verbose=5; // must be global!
|
2001-10-20 18:49:08 +00:00
|
|
|
|
2002-10-23 18:20:13 +00:00
|
|
|
int stream_cache_size=0;
|
|
|
|
|
|
|
|
// for demux_ogg:
|
|
|
|
void* vo_sub=NULL;
|
|
|
|
int vo_osd_changed(int new_value){return 0;}
|
|
|
|
int subcc_enabled=0;
|
|
|
|
|
2001-10-20 18:49:08 +00:00
|
|
|
//---------------
|
|
|
|
|
|
|
|
extern stream_t* open_stream(char* filename,int vcd_track,int* file_format);
|
|
|
|
|
|
|
|
int main(int argc,char* argv[]){
|
|
|
|
|
|
|
|
stream_t* stream=NULL;
|
|
|
|
demuxer_t* demuxer=NULL;
|
|
|
|
int file_format=DEMUXER_TYPE_UNKNOWN;
|
|
|
|
|
|
|
|
mp_msg_init(verbose+MSGL_STATUS);
|
|
|
|
|
|
|
|
if(argc>1)
|
|
|
|
stream=open_stream(argv[1],0,&file_format);
|
|
|
|
else
|
|
|
|
// stream=open_stream("/3d/divx/405divx_sm_v2[1].avi",0,&file_format);
|
|
|
|
stream=open_stream("/dev/cdrom",2,&file_format); // VCD track 2
|
|
|
|
|
|
|
|
if(!stream){
|
|
|
|
printf("Cannot open file/device\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
2001-10-20 23:51:02 +00:00
|
|
|
|
2001-10-20 18:49:08 +00:00
|
|
|
printf("success: format: %d data: 0x%X - 0x%X\n",file_format, (int)(stream->start_pos),(int)(stream->end_pos));
|
|
|
|
|
2002-10-23 18:20:13 +00:00
|
|
|
if(stream_cache_size)
|
|
|
|
stream_enable_cache(stream,stream_cache_size,0,0);
|
2001-10-20 23:51:02 +00:00
|
|
|
|
2001-10-20 18:49:08 +00:00
|
|
|
demuxer=demux_open(stream,file_format,-1,-1,-1);
|
|
|
|
if(!demuxer){
|
|
|
|
printf("Cannot open demuxer\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
2002-10-23 18:20:13 +00:00
|
|
|
|
|
|
|
if(demuxer->video->sh)
|
|
|
|
video_read_properties(demuxer->video->sh);
|
2001-10-20 18:49:08 +00:00
|
|
|
|
|
|
|
}
|