[MPlayer-cvslog] CVS: main/libmpdemux demux_mpg.c, 1.60, 1.61 demuxer.c, 1.198, 1.199 demuxer.h, 1.79, 1.80 extension.c, 1.12, 1.13 video.c, 1.51, 1.52

Reimar Döffinger CVS syncmail at mplayerhq.hu
Fri Aug 26 19:40:04 CEST 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv27888/libmpdemux

Modified Files:
	demux_mpg.c demuxer.c demuxer.h extension.c video.c 
Log Message:
support MPEG in GXF container with extension-based detection.


Index: demux_mpg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mpg.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- demux_mpg.c	5 Aug 2005 19:57:46 -0000	1.60
+++ demux_mpg.c	26 Aug 2005 17:40:01 -0000	1.61
@@ -506,6 +506,36 @@
   return 1;
 }
 
+static int demux_mpg_gxf_fill_buffer(demuxer_t *demux, demux_stream_t *ds) {
+  demux_packet_t *pack;
+  uint32_t state = (uint32_t)demux->priv;
+  int pos = 0;
+  int discard = 0;
+  unsigned char *buf;
+  if (demux->stream->eof)
+    return 0;
+  demux->filepos = stream_tell(demux->stream);
+  pack = new_demux_packet(STREAM_BUFFER_SIZE);
+  buf = pack->buffer;
+  while (pos < STREAM_BUFFER_SIZE) {
+    register int c = stream_read_char(demux->stream);
+    if (c < 0) { // EOF
+      resize_demux_packet(pack, pos);
+      break;
+    }
+    state = state << 8 | c;
+    if (state == 0x1bc || state == 0x1bf)
+      discard = 1;
+    else if (state == 0x100)
+      discard = 0;
+    if (!discard)
+      buf[pos++] = c;
+  }
+  ds_add_packet(ds, pack);
+  demux->priv = (void *)state;
+  return 1;
+}
+
 int demux_mpg_fill_buffer(demuxer_t *demux, demux_stream_t *ds){
 unsigned int head=0;
 int skipped=0;
@@ -789,6 +819,13 @@
     return demuxer;
 }
 
+static demuxer_t *demux_mpg_gxf_open(demuxer_t *demuxer) {
+  demuxer->audio->sh = NULL;
+  demuxer->video->sh = new_sh_video(demuxer,0);
+  ((sh_video_t *)demuxer->video->sh)->ds = demuxer->video;
+  demuxer->priv = (void *) 0xffffffff;
+  return demuxer;
+}
 
 static demuxer_t* demux_mpg_ps_open(demuxer_t* demuxer)
 {
@@ -844,6 +881,22 @@
 };
 
 
+demuxer_desc_t demuxer_desc_mpeg_gxf = {
+  "MPEG ES in GXF demuxer",
+  "mpeggxf",
+  "MPEG-ES in GXF",
+  "Reimar Döffinger",
+  "Mpeg",
+  DEMUXER_TYPE_MPEG_GXF,
+  0, // hack autodetection
+  NULL,
+  demux_mpg_gxf_fill_buffer,
+  demux_mpg_gxf_open,
+  NULL,
+  NULL,
+  NULL
+};
+
 demuxer_desc_t demuxer_desc_mpeg_es = {
   "MPEG ES demuxer",
   "mpeges",

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -r1.198 -r1.199
--- demuxer.c	23 Aug 2005 08:03:26 -0000	1.198
+++ demuxer.c	26 Aug 2005 17:40:01 -0000	1.199
@@ -51,6 +51,7 @@
 extern demuxer_desc_t demuxer_desc_mpeg_ps;
 extern demuxer_desc_t demuxer_desc_mpeg_pes;
 extern demuxer_desc_t demuxer_desc_mpeg_es;
+extern demuxer_desc_t demuxer_desc_mpeg_gxf;
 extern demuxer_desc_t demuxer_desc_mpeg4_es;
 extern demuxer_desc_t demuxer_desc_h264_es;
 extern demuxer_desc_t demuxer_desc_rawdv;
@@ -100,6 +101,7 @@
   &demuxer_desc_mpeg_ps,
   &demuxer_desc_mpeg_pes,
   &demuxer_desc_mpeg_es,
+  &demuxer_desc_mpeg_gxf,
   &demuxer_desc_mpeg4_es,
   &demuxer_desc_h264_es,
 #ifdef HAVE_LIBDV095

Index: demuxer.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.h,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- demuxer.h	5 Aug 2005 19:57:47 -0000	1.79
+++ demuxer.h	26 Aug 2005 17:40:02 -0000	1.80
@@ -49,11 +49,12 @@
 #define DEMUXER_TYPE_AAC 39
 #define DEMUXER_TYPE_MPC 40
 #define DEMUXER_TYPE_MPEG_PES 41
+#define DEMUXER_TYPE_MPEG_GXF 42
 
 // This should always match the higest demuxer type number.
 // Unless you want to disallow users to force the demuxer to some types
 #define DEMUXER_TYPE_MIN 0
-#define DEMUXER_TYPE_MAX 41
+#define DEMUXER_TYPE_MAX 42
 
 #define DEMUXER_TYPE_DEMUXERS (1<<16)
 // A virtual demuxer type for the network code

Index: extension.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/extension.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- extension.c	7 Apr 2005 18:59:15 -0000	1.12
+++ extension.c	26 Aug 2005 17:40:02 -0000	1.13
@@ -20,6 +20,7 @@
 //        { "mpe", DEMUXER_TYPE_MPEG_PS },
         { "vob", DEMUXER_TYPE_MPEG_PS },
         { "m2v", DEMUXER_TYPE_MPEG_PS },
+        { "gxf", DEMUXER_TYPE_MPEG_GXF },
         { "avi", DEMUXER_TYPE_AVI },
         { "mp4", DEMUXER_TYPE_MOV },
         { "mov", DEMUXER_TYPE_MOV },

Index: video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/video.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- video.c	6 Aug 2005 16:15:07 -0000	1.51
+++ video.c	26 Aug 2005 17:40:02 -0000	1.52
@@ -46,6 +46,7 @@
 
 if((d_video->demuxer->file_format == DEMUXER_TYPE_PVA) ||
    (d_video->demuxer->file_format == DEMUXER_TYPE_MPEG_ES) ||
+   (d_video->demuxer->file_format == DEMUXER_TYPE_MPEG_GXF) ||
    (d_video->demuxer->file_format == DEMUXER_TYPE_MPEG_PS && ((! sh_video->format) || (sh_video->format==0x10000001) || (sh_video->format==0x10000002))) ||
    (d_video->demuxer->file_format == DEMUXER_TYPE_MPEG_TY) ||
    (d_video->demuxer->file_format == DEMUXER_TYPE_MPEG_TS && ((sh_video->format==0x10000001) || (sh_video->format==0x10000002)))
@@ -403,6 +404,7 @@
     *start=NULL;
 
   if(demuxer->file_format==DEMUXER_TYPE_MPEG_ES || 
+     demuxer->file_format==DEMUXER_TYPE_MPEG_GXF ||
   	(demuxer->file_format==DEMUXER_TYPE_MPEG_PS && ((! sh_video->format) || (sh_video->format==0x10000001) || (sh_video->format==0x10000002)))
 		  || demuxer->file_format==DEMUXER_TYPE_PVA || 
 		  ((demuxer->file_format==DEMUXER_TYPE_MPEG_TS) && ((sh_video->format==0x10000001) || (sh_video->format==0x10000002)))




More information about the MPlayer-cvslog mailing list