[MPlayer-dev-eng] [PATCH] MPEG-ES in GXF demuxer

Nico Sabbi nsabbi at email.it
Thu Aug 25 12:35:18 CEST 2005


Reimar Döffinger wrote:

>Hi,
>would this small patch be acceptable? It would allow playing gxf files
>that contain MPEG2 video directly with MPlayer.
>Since samples are rare, maybe somebody could copy those from
>Address: ftp://www.ropa-net.de
>Username: web49f4
>Password: 123456
>
>Greetings,
>Reimar Döffinger
>  
>
>------------------------------------------------------------------------
>
>Index: libmpdemux/demux_mpg.c
>===================================================================
>RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mpg.c,v
>retrieving revision 1.60
>diff -u -r1.60 demux_mpg.c
>--- libmpdemux/demux_mpg.c	5 Aug 2005 19:57:46 -0000	1.60
>+++ libmpdemux/demux_mpg.c	25 Aug 2005 10:17:43 -0000
>@@ -408,6 +408,7 @@
> static int num_elementary_packets12x=0;
> static int num_elementary_packets1B6=0;
> static int num_elementary_packetsPES=0;
>+static int num_gxf_packets=0;
> static int num_h264_slice=0; //combined slice
> static int num_h264_dpa=0; //DPA Slice
> static int num_h264_dpb=0; //DPB Slice
>@@ -437,6 +438,7 @@
>   num_elementary_packets1B6=0;
>   num_elementary_packets12x=0;
>   num_elementary_packetsPES=0;
>+  num_gxf_packets=0;
>   num_h264_slice=0; //combined slice
>   num_h264_dpa=0; //DPA Slice
>   num_h264_dpb=0; //DPB Slice
>@@ -449,13 +451,14 @@
>   if(demux_mpg_open(demuxer))
>     file_format=DEMUXER_TYPE_MPEG_PS;
>   else {
>-    mp_msg(MSGT_DEMUX,MSGL_V,"MPEG packet stats: p100: %d  p101: %d p1B6: %d p12x: %d sli: %d a: %d b: %d c: %d idr: %d sps: %d pps: %d PES: %d  MP3: %d, synced: %d\n",
>+    mp_msg(MSGT_DEMUX,MSGL_V,"MPEG packet stats: p100: %d  p101: %d p1B6: %d p12x: %d sli: %d a: %d b: %d c: %d idr: %d sps: %d pps: %d GXF: %d PES: %d  MP3: %d, synced: %d\n",
>      num_elementary_packets100,num_elementary_packets101,
>      num_elementary_packets1B6,num_elementary_packets12x,
>      num_h264_slice, num_h264_dpa,
>      num_h264_dpb, num_h264_dpc=0,
>      num_h264_idr, num_h264_sps=0,
>      num_h264_pps,
>+     num_gxf_packets,
>      num_elementary_packetsPES,num_mp3audio_packets, demuxer->synced);
> 
>      //MPEG packet stats: p100: 458  p101: 458  PES: 0  MP3: 1103  (.m2v)
>@@ -464,6 +467,10 @@
>        return file_format;
> 
>       // some hack to get meaningfull error messages to our unhappy users:
>+      if (num_elementary_packets100>=2 && num_elementary_packets101>=2 &&
>+          num_gxf_packets>=2)
>+         file_format=DEMUXER_TYPE_MPEG_GXF;
>+      else
>       if(num_elementary_packets100>=2 && num_elementary_packets101>=2 &&
>          abs(num_elementary_packets101+8-num_elementary_packets100)<16) {
>          if(num_elementary_packetsPES>=4 && num_elementary_packetsPES>=num_elementary_packets100-4) {
>@@ -579,6 +586,7 @@
>       mp_msg(MSGT_DEMUX,MSGL_DBG3,"Opps... PES packet found: %03X\n",head);
>     } else
>       if(head==0x1B6) ++num_elementary_packets1B6;
>+    else if (head == 0x1BC || head == 0x1BF) ++num_gxf_packets;
> #if 1
>     if( ( (num_elementary_packets100>50 && num_elementary_packets101>50) ||
>           (num_elementary_packetsPES>50) ) && skipped>4000000){
>@@ -844,6 +852,22 @@
> };
> 
> 
>  
>

uhm, 0x1b[cf] are startcodes used to identify PSM and padding streams, 
so they are valid
mpeg-ps stream identifiers. With your code there will be collisions and 
fake detections.

BTW, what's the format of gfx? can't you just associate the extension 
with DEMUXER_TYPE_MPEG_ES?
-demuxer 1 should play correctly the file. Testing now...
 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Digitalpix: Il metodo più comodo, veloce e conveniente
* per stampare le tue foto digitali migliori.
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=1523&d=25-8




More information about the MPlayer-dev-eng mailing list