comparison libmpdemux/demuxer.c @ 11590:0908285ada31

LML-M4 mpeg4 capture card raw stream format support original code by Maxim Yevtyushkin <max@linuxmedialabs.com> partially rewritten, "mplayerized" by me
author arpi
date Mon, 08 Dec 2003 19:33:38 +0000
parents 2c9e2da67647
children c43d654a1f45
comparison
equal deleted inserted replaced
11589:5cff0d11b47b 11590:0908285ada31
132 extern void demux_close_rawdv(demuxer_t* demuxer); 132 extern void demux_close_rawdv(demuxer_t* demuxer);
133 extern void demux_close_pva(demuxer_t* demuxer); 133 extern void demux_close_pva(demuxer_t* demuxer);
134 extern void demux_close_smjpeg(demuxer_t* demuxer); 134 extern void demux_close_smjpeg(demuxer_t* demuxer);
135 extern void demux_close_xmms(demuxer_t* demuxer); 135 extern void demux_close_xmms(demuxer_t* demuxer);
136 extern void demux_close_gif(demuxer_t* demuxer); 136 extern void demux_close_gif(demuxer_t* demuxer);
137 extern void demux_close_lmlm4(demuxer_t* demuxer);
137 extern void demux_close_ts(demuxer_t* demuxer); 138 extern void demux_close_ts(demuxer_t* demuxer);
138 extern void demux_close_mkv(demuxer_t* demuxer); 139 extern void demux_close_mkv(demuxer_t* demuxer);
139 extern void demux_close_ra(demuxer_t* demuxer); 140 extern void demux_close_ra(demuxer_t* demuxer);
140 extern void demux_close_ty(demuxer_t* demuxer); 141 extern void demux_close_ty(demuxer_t* demuxer);
141 142
213 #endif 214 #endif
214 #ifdef HAVE_GIF 215 #ifdef HAVE_GIF
215 case DEMUXER_TYPE_GIF: 216 case DEMUXER_TYPE_GIF:
216 demux_close_gif(demuxer); break; 217 demux_close_gif(demuxer); break;
217 #endif 218 #endif
219 case DEMUXER_TYPE_LMLM4:
220 demux_close_lmlm4(demuxer); break;
218 case DEMUXER_TYPE_MPEG_TS: 221 case DEMUXER_TYPE_MPEG_TS:
219 case DEMUXER_TYPE_MPEG4_IN_TS: 222 case DEMUXER_TYPE_MPEG4_IN_TS:
220 demux_close_ts(demuxer); break; 223 demux_close_ts(demuxer); break;
221 case DEMUXER_TYPE_REALAUDIO: 224 case DEMUXER_TYPE_REALAUDIO:
222 demux_close_ra(demuxer); break; 225 demux_close_ra(demuxer); break;
306 extern int demux_demuxers_fill_buffer(demuxer_t *demux,demux_stream_t *ds); 309 extern int demux_demuxers_fill_buffer(demuxer_t *demux,demux_stream_t *ds);
307 extern int demux_ogg_fill_buffer(demuxer_t *d); 310 extern int demux_ogg_fill_buffer(demuxer_t *d);
308 extern int demux_rawaudio_fill_buffer(demuxer_t* demuxer, demux_stream_t *ds); 311 extern int demux_rawaudio_fill_buffer(demuxer_t* demuxer, demux_stream_t *ds);
309 extern int demux_rawvideo_fill_buffer(demuxer_t* demuxer, demux_stream_t *ds); 312 extern int demux_rawvideo_fill_buffer(demuxer_t* demuxer, demux_stream_t *ds);
310 extern int demux_smjpeg_fill_buffer(demuxer_t* demux); 313 extern int demux_smjpeg_fill_buffer(demuxer_t* demux);
314 extern int demux_lmlm4_fill_buffer(demuxer_t* demux);
311 extern int demux_mkv_fill_buffer(demuxer_t *d); 315 extern int demux_mkv_fill_buffer(demuxer_t *d);
312 316
313 int demux_fill_buffer(demuxer_t *demux,demux_stream_t *ds){ 317 int demux_fill_buffer(demuxer_t *demux,demux_stream_t *ds){
314 // Note: parameter 'ds' can be NULL! 318 // Note: parameter 'ds' can be NULL!
315 // printf("demux->type=%d\n",demux->type); 319 // printf("demux->type=%d\n",demux->type);
358 #endif 362 #endif
359 case DEMUXER_TYPE_SMJPEG: return demux_smjpeg_fill_buffer(demux); 363 case DEMUXER_TYPE_SMJPEG: return demux_smjpeg_fill_buffer(demux);
360 #ifdef HAVE_GIF 364 #ifdef HAVE_GIF
361 case DEMUXER_TYPE_GIF: return demux_gif_fill_buffer(demux); 365 case DEMUXER_TYPE_GIF: return demux_gif_fill_buffer(demux);
362 #endif 366 #endif
367 case DEMUXER_TYPE_LMLM4: return demux_lmlm4_fill_buffer(demux);
363 case DEMUXER_TYPE_MPEG_TS: 368 case DEMUXER_TYPE_MPEG_TS:
364 case DEMUXER_TYPE_MPEG4_IN_TS: 369 case DEMUXER_TYPE_MPEG4_IN_TS:
365 return demux_ts_fill_buffer(demux); 370 return demux_ts_fill_buffer(demux);
366 case DEMUXER_TYPE_REALAUDIO: return demux_ra_fill_buffer(demux); 371 case DEMUXER_TYPE_REALAUDIO: return demux_ra_fill_buffer(demux);
367 } 372 }
595 extern int demux_open_smjpeg(demuxer_t* demuxer); 600 extern int demux_open_smjpeg(demuxer_t* demuxer);
596 extern int bmp_check_file(demuxer_t *demuxer); 601 extern int bmp_check_file(demuxer_t *demuxer);
597 extern int demux_xmms_open(demuxer_t* demuxer); 602 extern int demux_xmms_open(demuxer_t* demuxer);
598 extern int gif_check_file(demuxer_t *demuxer); 603 extern int gif_check_file(demuxer_t *demuxer);
599 extern int demux_open_gif(demuxer_t* demuxer); 604 extern int demux_open_gif(demuxer_t* demuxer);
605 extern int lmlm4_check_file(demuxer_t* demuxer);
606 extern int demux_open_lmlm4(demuxer_t* demuxer);
600 extern int ts_check_file(demuxer_t * demuxer); 607 extern int ts_check_file(demuxer_t * demuxer);
601 extern int demux_open_ts(demuxer_t *demuxer); 608 extern int demux_open_ts(demuxer_t *demuxer);
602 extern int demux_open_mkv(demuxer_t *demuxer); 609 extern int demux_open_mkv(demuxer_t *demuxer);
603 extern int ra_check_file(demuxer_t *demuxer); 610 extern int ra_check_file(demuxer_t *demuxer);
604 extern int demux_open_ra(demuxer_t* demuxer); 611 extern int demux_open_ra(demuxer_t* demuxer);
892 file_format=DEMUXER_TYPE_MPEG_TS; 899 file_format=DEMUXER_TYPE_MPEG_TS;
893 } else { 900 } else {
894 free_demuxer(demuxer); 901 free_demuxer(demuxer);
895 demuxer=NULL; 902 demuxer=NULL;
896 } 903 }
904 }
905 //=============== Try to open as LMLM4 file: =================
906 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_LMLM4){
907 demuxer=new_demuxer(stream,DEMUXER_TYPE_LMLM4,audio_id,video_id,dvdsub_id);
908 if(lmlm4_check_file(demuxer)){
909 mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_Detected_XXX_FileFormat,"RAW LMLM4");
910 file_format=DEMUXER_TYPE_LMLM4;
911 } else {
912 free_demuxer(demuxer);
913 demuxer = NULL;
914 }
897 } 915 }
898 //=============== Try to open as MPEG-PS file: ================= 916 //=============== Try to open as MPEG-PS file: =================
899 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MPEG_PS){ 917 if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MPEG_PS){
900 int pes=1; 918 int pes=1;
901 int tmp; 919 int tmp;
1165 } 1183 }
1166 case DEMUXER_TYPE_Y4M: { 1184 case DEMUXER_TYPE_Y4M: {
1167 demux_open_y4m(demuxer); 1185 demux_open_y4m(demuxer);
1168 break; 1186 break;
1169 } 1187 }
1188 case DEMUXER_TYPE_LMLM4: {
1189 demux_open_lmlm4(demuxer);
1190 if(!ds_fill_buffer(d_video)){
1191 mp_msg(MSGT_DEMUXER,MSGL_INFO,"LMLM4: " MSGTR_MissingVideoStream);
1192 sh_video=NULL;
1193 } else {
1194 sh_video=d_video->sh;sh_video->ds=d_video;
1195 }
1196 if(audio_id!=-2) {
1197 if(!ds_fill_buffer(d_audio)){
1198 mp_msg(MSGT_DEMUXER,MSGL_INFO,"LMLM4: " MSGTR_MissingAudioStream);
1199 sh_audio=NULL;
1200 } else {
1201 sh_audio=d_audio->sh;sh_audio->ds=d_audio;
1202 }
1203 }
1204 break;
1205 }
1170 case DEMUXER_TYPE_REAL: { 1206 case DEMUXER_TYPE_REAL: {
1171 demux_open_real(demuxer); 1207 demux_open_real(demuxer);
1172 break; 1208 break;
1173 } 1209 }
1174 case DEMUXER_TYPE_ASF: { 1210 case DEMUXER_TYPE_ASF: {