changeset 4551:716b00618bfc

add mfi support
author pontscho
date Wed, 06 Feb 2002 20:16:35 +0000
parents ff9f62e4bdd8
children 46ccfbb41f9c
files cfg-common.h libmpdemux/Makefile libmpdemux/demuxer.c libmpdemux/demuxer.h libmpdemux/open.c libmpdemux/stream.h
diffstat 6 files changed, 61 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/cfg-common.h	Wed Feb 06 20:15:36 2002 +0000
+++ b/cfg-common.h	Wed Feb 06 20:16:35 2002 +0000
@@ -57,6 +57,8 @@
 
 // ------------------------- codec/pp options --------------------
 
+        {"mf", mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL},
+	
 #ifdef USE_FAKE_MONO
 	{"stereo", &fakemono, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL},
 #endif
@@ -153,4 +155,19 @@
 	{NULL, NULL, 0, 0, 0, 0, NULL}
 };
 
+extern int    mf_support;
+extern int    mf_w;
+extern int    mf_h;
+extern int    mf_fps;
+extern char * mf_type;
+
+struct config mfopts_conf[]={
+        {"on", &mf_support, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+        {"w", &mf_w, CONF_TYPE_INT, 0, 0, 0, NULL},
+        {"h", &mf_h, CONF_TYPE_INT, 0, 0, 0, NULL},
+        {"fps", &mf_fps, CONF_TYPE_INT, 0, 0, 0, NULL},
+        {"type", &mf_type, CONF_TYPE_STRING, 0, 0, 0, NULL},
+        {NULL, NULL, 0, 0, 0, 0, NULL}
+};
+						
 #endif
--- a/libmpdemux/Makefile	Wed Feb 06 20:15:36 2002 +0000
+++ b/libmpdemux/Makefile	Wed Feb 06 20:16:35 2002 +0000
@@ -3,7 +3,7 @@
 
 include ../config.mak
 
-SRCS = mp3_hdr.c video.c mpeg_hdr.c cache2.c asfheader.c aviheader.c aviprint.c aviwrite.c demux_asf.c demux_avi.c demux_mov.c demux_mpg.c demux_viv.c demuxer.c dvdauth.c open.c parse_es.c stream.c tv.c tvi_dummy.c tvi_v4l.c frequencies.c demux_fli.c demux_real.c demux_y4m.c yuv4mpeg.c yuv4mpeg_ratio.c demux_nuv.c demux_film.c demux_roq.c
+SRCS = mp3_hdr.c video.c mpeg_hdr.c cache2.c asfheader.c aviheader.c aviprint.c aviwrite.c demux_asf.c demux_avi.c demux_mov.c demux_mpg.c demux_viv.c demuxer.c dvdauth.c open.c parse_es.c stream.c tv.c tvi_dummy.c tvi_v4l.c frequencies.c demux_fli.c demux_real.c demux_y4m.c yuv4mpeg.c yuv4mpeg_ratio.c demux_nuv.c demux_film.c demux_roq.c mf.c demux_mf.c
 ifeq ($(STREAMING),yes)
 SRCS += asf_streaming.c url.c http.c network.c rtp.c
 endif
--- a/libmpdemux/demuxer.c	Wed Feb 06 20:15:36 2002 +0000
+++ b/libmpdemux/demuxer.c	Wed Feb 06 20:16:35 2002 +0000
@@ -15,6 +15,7 @@
 #include "stream.h"
 #include "demuxer.h"
 #include "stheader.h"
+#include "mf.h"
 
 void free_demuxer_stream(demux_stream_t *ds){
     ds_free_packs(ds);
@@ -150,6 +151,7 @@
 // return value:
 //     0 = EOF or no stream found or invalid type
 //     1 = successfully read a packet
+int demux_mf_fill_buffer( demuxer_t *demux);
 int demux_roq_fill_buffer(demuxer_t *demux);
 int demux_film_fill_buffer(demuxer_t *demux);
 int demux_fli_fill_buffer(demuxer_t *demux);
@@ -177,6 +179,7 @@
   // Note: parameter 'ds' can be NULL!
 //  printf("demux->type=%d\n",demux->type);
   switch(demux->type){
+    case DEMUXER_TYPE_MF: return demux_mf_fill_buffer(demux);
     case DEMUXER_TYPE_ROQ: return demux_roq_fill_buffer(demux);
     case DEMUXER_TYPE_FILM: return demux_film_fill_buffer(demux);
     case DEMUXER_TYPE_FLI: return demux_fli_fill_buffer(demux);
@@ -368,6 +371,7 @@
 int mov_check_file(demuxer_t* demuxer);
 int mov_read_header(demuxer_t* demuxer);
 int demux_open_fli(demuxer_t* demuxer);
+int demux_open_mf(demuxer_t* demuxer);
 int demux_open_film(demuxer_t* demuxer);
 int demux_open_roq(demuxer_t* demuxer);
 
@@ -397,6 +401,12 @@
 
 //printf("demux_open(%p,%d,%d,%d,%d)  \n",stream,file_format,audio_id,video_id,dvdsub_id);
 
+if ( mf_support )
+ {
+  mp_msg(MSGT_DEMUXER,MSGL_INFO,"forced mf.\n");
+  file_format=DEMUXER_TYPE_MF;
+ }
+
 #ifdef USE_TV
 //=============== Try to open as TV-input: =================
 if((tv_param_on == 1) &&
@@ -564,6 +574,17 @@
     mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedMPEGESfile);
   }
 }
+//=============== Try to open as multi file: =================
+if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MF){
+  demuxer=new_demuxer(stream,DEMUXER_TYPE_MF,audio_id,video_id,dvdsub_id);
+  {
+   if ( mf_support )
+    {
+     file_format=DEMUXER_TYPE_MF;
+     mp_msg( MSGT_DEMUXER,MSGL_INFO,"[demuxer] mf support.\n" );
+    }
+  }
+}
 //=============== Unknown, exiting... ===========================
 if(file_format==DEMUXER_TYPE_UNKNOWN){
   mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_FormatNotRecognized);
@@ -578,6 +599,10 @@
 demuxer->file_format=file_format;
 
 switch(file_format){
+ case DEMUXER_TYPE_MF: {
+  if (!demux_open_mf(demuxer)) return NULL;
+  break;
+ }
  case DEMUXER_TYPE_FLI: {
   if (!demux_open_fli(demuxer)) return NULL;
   break;
@@ -696,6 +721,7 @@
 int demux_seek_mpg(demuxer_t *demuxer,float rel_seek_secs,int flags);
 int demux_seek_y4m(demuxer_t *demuxer,float rel_seek_secs,int flags);
 int demux_seek_fli(demuxer_t *demuxer,float rel_seek_secs,int flags);
+int demux_seek_mf(demuxer_t *demuxer,float rel_seek_secs,int flags);
 int demux_seek_nuv(demuxer_t *demuxer,float rel_seek_secs,int flags);
 void demux_seek_mov(demuxer_t *demuxer,float pts,int flags);
 
--- a/libmpdemux/demuxer.h	Wed Feb 06 20:15:36 2002 +0000
+++ b/libmpdemux/demuxer.h	Wed Feb 06 20:16:35 2002 +0000
@@ -18,6 +18,7 @@
 #define DEMUXER_TYPE_NUV 13
 #define DEMUXER_TYPE_FILM 14
 #define DEMUXER_TYPE_ROQ 15
+#define DEMUXER_TYPE_MF 16
 
 #define DEMUXER_TIME_NONE 0
 #define DEMUXER_TIME_PTS 1
--- a/libmpdemux/open.c	Wed Feb 06 20:15:36 2002 +0000
+++ b/libmpdemux/open.c	Wed Feb 06 20:16:35 2002 +0000
@@ -17,6 +17,7 @@
 #include "../cfgparser.h"
 #include "stream.h"
 #include "demuxer.h"
+#include "mf.h"
 
 #ifdef STREAMING
 #include "url.h"
@@ -382,6 +383,20 @@
   }
 #endif
 
+//============ Check for multi file-input ====
+  if (mf_support == 1)
+  {
+    /* create stream */
+    stream = new_stream(-1, STREAMTYPE_MF);
+    if (!stream)
+       return(NULL);
+
+    if (!stream_open_mf(filename, stream))
+        return(NULL);
+
+    return(stream);
+  }
+
 //============ Open STDIN ============
   if(!strcmp(filename,"-")){
       // read from stdin
--- a/libmpdemux/stream.h	Wed Feb 06 20:15:36 2002 +0000
+++ b/libmpdemux/stream.h	Wed Feb 06 20:16:35 2002 +0000
@@ -12,6 +12,7 @@
 #define STREAMTYPE_MEMORY  4
 #define STREAMTYPE_TV	5
 #define STREAMTYPE_PLAYLIST 6
+#define STREAMTYPE_MF   7
 
 #define VCD_SECTOR_SIZE 2352
 #define VCD_SECTOR_OFFS 24