From: <wt...@ke...> - 2008-09-04 16:27:56
|
CVS Root: /cvs/gstreamer Module: gst-ffmpeg Changes by: wtay Date: Thu Sep 04 2008 15:50:17 UTC Log message: * ext/ffmpeg/gstffmpegcodecmap.c: (nal_escape), (copy_config), (gst_ffmpeg_caps_with_codecid): Add some debug that revealed that the escape code was disabled... Modified files: . : ChangeLog ext/ffmpeg : gstffmpegcodecmap.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-ffmpeg/ChangeLog.diff?r1=1.507&r2=1.508 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegcodecmap.c.diff?r1=1.166&r2=1.167 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-ffmpeg/ChangeLog,v retrieving revision 1.507 retrieving revision 1.508 diff -u -d -r1.507 -r1.508 --- ChangeLog 4 Sep 2008 14:08:50 -0000 1.507 +++ ChangeLog 4 Sep 2008 15:50:02 -0000 1.508 @@ -1,5 +1,11 @@ 2008-09-04 Wim Taymans <wim...@co...> + * ext/ffmpeg/gstffmpegcodecmap.c: (nal_escape), (copy_config), + (gst_ffmpeg_caps_with_codecid): + Add some debug that revealed that the escape code was disabled... + +2008-09-04 Wim Taymans <wim...@co...> * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame), (gst_ffmpegdec_chain): If we have a parser and we did not consume any of the bytes of a new Index: gstffmpegcodecmap.c RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegcodecmap.c,v retrieving revision 1.166 retrieving revision 1.167 diff -u -d -r1.166 -r1.167 --- gstffmpegcodecmap.c 4 Sep 2008 13:54:58 -0000 1.166 +++ gstffmpegcodecmap.c 4 Sep 2008 15:50:03 -0000 1.167 @@ -1625,6 +1625,7 @@ while (srcp < end) { if (count == 2 && *srcp <= 0x03 ) { + GST_DEBUG ("added escape code"); *dstp++ = 0x03; count = 0; } @@ -1633,6 +1634,7 @@ else + GST_DEBUG ("copy %02x, count %d", *srcp, count); *dstp++ = *srcp++; } *destsize = dstp - dst; @@ -1648,8 +1650,6 @@ gint cnt, i; guint nalsize, esize; - goto full_copy; - /* check size */ if (size < 7) goto full_copy; @@ -1660,11 +1660,14 @@ cnt = *(srcp + 5) & 0x1f; /* Number of sps */ + GST_DEBUG ("num SPS %d", cnt); memcpy (dstp, srcp, 6); srcp += 6; dstp += 6; for (i = 0; i < cnt; i++) { + GST_DEBUG ("copy SPS %d", i); nalsize = (srcp[0] << 8) | srcp[1]; nal_escape (dstp + 2, srcp + 2, nalsize, &esize); dstp[0] = esize >> 8; @@ -1675,7 +1678,10 @@ cnt = *(dstp++) = *(srcp++); /* Number of pps */ + GST_DEBUG ("num PPS %d", cnt); + GST_DEBUG ("copy PPS %d", i); @@ -1689,6 +1695,7 @@ full_copy: { + GST_DEBUG ("something unexpected, doing full copy"); memcpy (dst, src, size); *destsize = size; return; @@ -1731,16 +1738,19 @@ if (codec_id == CODEC_ID_H264) { guint extrasize; + GST_DEBUG ("copy, escaping codec_data %d", size); /* ffmpeg h264 expects the codec_data to be escaped, there is no real * reason for this but let's just escape it for now. Start by allocating * enough space, x2 is more than enough. */ context->extradata = av_mallocz (GST_ROUND_UP_16 (size * 2 + FF_INPUT_BUFFER_PADDING_SIZE)); copy_config (context->extradata, data, size, &extrasize); + GST_DEBUG ("escaped size: %d", extrasize); context->extradata_size = extrasize; else { /* allocate with enough padding */ + GST_DEBUG ("copy codec_data"); av_mallocz (GST_ROUND_UP_16 (size + FF_INPUT_BUFFER_PADDING_SIZE)); memcpy (context->extradata, data, size); |