[Mplayer-cvslog] CVS: main/libmpdemux Makefile,1.18,1.19 demuxer.c,1.69,1.70 demuxer.h,1.27,1.28 open.c,1.36,1.37 stream.h,1.31,1.32

Zoltan Ponekker pontscho at mplayer.dev.hu
Wed Feb 6 20:22:52 CET 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv3341/libmpdemux

Modified Files:
	Makefile demuxer.c demuxer.h open.c stream.h 
Log Message:
add mfi support

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/Makefile,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- Makefile	1 Feb 2002 05:35:16 -0000	1.18
+++ Makefile	6 Feb 2002 19:22:50 -0000	1.19
@@ -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

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- demuxer.c	1 Feb 2002 05:35:16 -0000	1.69
+++ demuxer.c	6 Feb 2002 19:22:50 -0000	1.70
@@ -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);
@@ -104,8 +105,8 @@
     int i;
     // free streams:
     for(i=0;i<256;i++){
-	if(demuxer->a_streams[i]) free_sh_audio(demuxer->a_streams[i]);
-	if(demuxer->v_streams[i]) free_sh_video(demuxer->v_streams[i]);
+        if(demuxer->a_streams[i]) free_sh_audio(demuxer->a_streams[i]);
+        if(demuxer->v_streams[i]) free_sh_video(demuxer->v_streams[i]);
     }
     //if(sh_audio) free_sh_audio(sh_audio);
     //if(sh_video) free_sh_video(sh_video);
@@ -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) &&
@@ -415,7 +425,7 @@
     if(id==mmioFOURCC('R','I','F','F')){
       stream_read_dword_le(demuxer->stream); //filesize
       id=stream_read_dword_le(demuxer->stream); // "AVI "
-      if(id==formtypeAVI){ 
+      if(id==formtypeAVI){
         mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedAVIfile);
         file_format=DEMUXER_TYPE_AVI;
       }
@@ -478,7 +488,7 @@
     stream_seek(demuxer->stream, 4);
     id=stream_read_word_le(demuxer->stream);
     // check for the FLI file magic number
-    if((id==0xAF11) || (id==0xAF12)){ 
+    if((id==0xAF11) || (id==0xAF12)){
       mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedFLIfile);
       file_format=DEMUXER_TYPE_FLI;
     }
@@ -490,7 +500,7 @@
   {
     int signature=stream_read_fourcc(demuxer->stream);
     // check for the FLI file magic number
-    if(signature==mmioFOURCC('F', 'I', 'L', 'M')){ 
+    if(signature==mmioFOURCC('F', 'I', 'L', 'M')){
       mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedFILMfile);
       file_format=DEMUXER_TYPE_FILM;
     }
@@ -511,7 +521,7 @@
  off_t tmppos;
  while(pes>=0){
   demuxer=new_demuxer(stream,DEMUXER_TYPE_MPEG_PS,audio_id,video_id,dvdsub_id);
-  
+
   // try to pre-detect PES:
   tmppos=stream_tell(demuxer->stream);
   tmp=stream_read_dword(demuxer->stream);
@@ -520,7 +530,7 @@
       if(tmp>1 && tmp<=2048) pes=0; // demuxer->synced=3; // PES...
   }
   stream_seek(demuxer->stream,tmppos);
-  
+
   if(!pes) demuxer->synced=3; // hack!
 
   num_elementary_packets100=0;
@@ -536,7 +546,7 @@
     file_format=DEMUXER_TYPE_MPEG_PS;
   } else {
     printf("MPEG packet stats: p100: %d  p101: %d  PES: %d \n",
-	num_elementary_packets100,num_elementary_packets101,num_elementary_packetsPES);
+        num_elementary_packets100,num_elementary_packets101,num_elementary_packetsPES);
     // some hack to get meaningfull error messages to our unhappy users:
     if(num_elementary_packets100>=2 && num_elementary_packets101>=2 &&
        abs(num_elementary_packets101+8-num_elementary_packets100)<16){
@@ -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;
@@ -680,8 +705,8 @@
  case DEMUXER_TYPE_TV: {
     if (!demux_open_tv(demuxer, tv_handler))
     {
-	tv_uninit(tv_handler);
-	return(NULL);
+        tv_uninit(tv_handler);
+        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);
 
@@ -707,20 +733,20 @@
 
 if(!demuxer->seekable){
     if(demuxer->file_format==DEMUXER_TYPE_AVI)
-	mp_msg(MSGT_SEEK,MSGL_WARN,MSGTR_CantSeekRawAVI);
+        mp_msg(MSGT_SEEK,MSGL_WARN,MSGTR_CantSeekRawAVI);
 #ifdef USE_TV
     else if (demuxer->file_format==DEMUXER_TYPE_TV)
-	mp_msg(MSGT_SEEK,MSGL_WARN,"TV input isn't seekable! (probarly seeking will be for changing channels ;)\n");
+        mp_msg(MSGT_SEEK,MSGL_WARN,"TV input isn't seekable! (probarly seeking will be for changing channels ;)\n");
 #endif
     else
-	mp_msg(MSGT_SEEK,MSGL_WARN,MSGTR_CantSeekFile);
+        mp_msg(MSGT_SEEK,MSGL_WARN,MSGTR_CantSeekFile);
     return 0;
 }
 
     // clear demux buffers:
     if(sh_audio){ ds_free_packs(d_audio);sh_audio->a_buffer_len=0;}
     ds_free_packs(d_video);
-    
+
     demuxer->stream->eof=0; // clear eof flag
     demuxer->video->eof=0;
     demuxer->audio->eof=0;
@@ -739,7 +765,7 @@
 
   case DEMUXER_TYPE_ASF:
       demux_seek_asf(demuxer,rel_seek_secs,flags);  break;
-  
+
   case DEMUXER_TYPE_MPEG_ES:
   case DEMUXER_TYPE_MPEG_PS:
       demux_seek_mpg(demuxer,rel_seek_secs,flags);  break;
@@ -750,6 +776,8 @@
   case DEMUXER_TYPE_Y4M:
       demux_seek_y4m(demuxer,rel_seek_secs,flags);  break;
 
+  case DEMUXER_TYPE_MF:
+      demux_seek_mf(demuxer,rel_seek_secs,flags); break;
   case DEMUXER_TYPE_FLI:
       demux_seek_fli(demuxer,rel_seek_secs,flags);  break;
   case DEMUXER_TYPE_NUV:
@@ -767,61 +795,61 @@
 
     if (!strcasecmp(opt, "name"))
     {
-	if (info->name)
-	{
-	    mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->name already present\n!");
-	    return(0);
-	}
-	info->name = strdup(param);
-	return(1);
+        if (info->name)
+        {
+            mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->name already present\n!");
+            return(0);
+        }
+        info->name = strdup(param);
+        return(1);
     }
 
     if (!strcasecmp(opt, "author"))
     {
-	if (info->author)
-	{
-	    mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->author already present\n!");
-	    return(0);
-	}
-	info->author = strdup(param);
-	return(1);
+        if (info->author)
+        {
+            mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->author already present\n!");
+            return(0);
+        }
+        info->author = strdup(param);
+        return(1);
     }
 
     if (!strcasecmp(opt, "encoder") || !strcasecmp(opt, "software"))
     {
-	if (info->encoder)
-	{
-	    mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->encoder already present\n!");
-	    return(0);
-	}
-	info->encoder = strdup(param);
-	return(1);
+        if (info->encoder)
+        {
+            mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->encoder already present\n!");
+            return(0);
+        }
+        info->encoder = strdup(param);
+        return(1);
     }
 
     if (!strcasecmp(opt, "comment") || !strcasecmp(opt, "comments"))
     {
-	if (info->comments)
-	{
-	    mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->comments already present\n!");
-	    return(0);
-	}
-	info->comments = strdup(param);
-	return(1);
+        if (info->comments)
+        {
+            mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->comments already present\n!");
+            return(0);
+        }
+        info->comments = strdup(param);
+        return(1);
     }
 
     if (!strcasecmp(opt, "copyright"))
     {
-	if (info->copyright)
-	{
-	    mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->copyright already present\n!");
-	    return(0);
-	}
-	info->copyright = strdup(param);
-	return(1);
+        if (info->copyright)
+        {
+            mp_msg(MSGT_DEMUX, MSGL_WARN, "Demuxer info->copyright already present\n!");
+            return(0);
+        }
+        info->copyright = strdup(param);
+        return(1);
     }
 
     mp_msg(MSGT_DEMUX, MSGL_DBG2, "Unknown demuxer info->%s (=%s)!\n",
-	opt, param);
+        opt, param);
     return(1);
 }
 
@@ -831,17 +859,17 @@
 
     if (info->name || info->author || info->encoder || info->comments || info->copyright)
     {
-	mp_msg(MSGT_DEMUX, MSGL_INFO, "Clip info: \n");
-	if (info->name)
-	    mp_msg(MSGT_DEMUX, MSGL_INFO, " Name: %s\n", info->name);
-	if (info->author)
-	    mp_msg(MSGT_DEMUX, MSGL_INFO, " Author: %s\n", info->author);
-	if (info->copyright)
-	    mp_msg(MSGT_DEMUX, MSGL_INFO, " Copyright: %s\n", info->copyright);
-	if (info->comments)
-	    mp_msg(MSGT_DEMUX, MSGL_INFO, " Comments: %s\n", info->comments);
-	if (info->encoder)
-	    mp_msg(MSGT_DEMUX, MSGL_INFO, " Encoder: %s\n", info->encoder);
+        mp_msg(MSGT_DEMUX, MSGL_INFO, "Clip info: \n");
+        if (info->name)
+            mp_msg(MSGT_DEMUX, MSGL_INFO, " Name: %s\n", info->name);
+        if (info->author)
+            mp_msg(MSGT_DEMUX, MSGL_INFO, " Author: %s\n", info->author);
+        if (info->copyright)
+            mp_msg(MSGT_DEMUX, MSGL_INFO, " Copyright: %s\n", info->copyright);
+        if (info->comments)
+            mp_msg(MSGT_DEMUX, MSGL_INFO, " Comments: %s\n", info->comments);
+        if (info->encoder)
+            mp_msg(MSGT_DEMUX, MSGL_INFO, " Encoder: %s\n", info->encoder);
     }
 
     return 0;

Index: demuxer.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- demuxer.h	1 Feb 2002 05:35:16 -0000	1.27
+++ demuxer.h	6 Feb 2002 19:22:50 -0000	1.28
@@ -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

Index: open.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/open.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- open.c	27 Jan 2002 19:23:43 -0000	1.36
+++ open.c	6 Feb 2002 19:22:50 -0000	1.37
@@ -17,6 +17,7 @@
 #include "../cfgparser.h"
 #include "stream.h"
 #include "demuxer.h"
+#include "mf.h"
 
 #ifdef STREAMING
 #include "url.h"
@@ -381,6 +382,20 @@
     return(NULL);
   }
 #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,"-")){

Index: stream.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- stream.h	29 Jan 2002 12:11:52 -0000	1.31
+++ stream.h	6 Feb 2002 19:22:50 -0000	1.32
@@ -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




More information about the MPlayer-cvslog mailing list