ext/ffmpeg/gstffmpegcodecmap.c: Update ffmpeg_codec_id <=> mimetype conversions

Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps):
Update ffmpeg_codec_id <=> mimetype conversions
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame):
Finer grained keyframe detection
This commit is contained in:
Edward Hervey 2005-12-19 15:47:13 +00:00
parent 38dc71e266
commit b4e1a56104
4 changed files with 66 additions and 16 deletions

View file

@ -1,3 +1,10 @@
2005-12-19 Edward Hervey <edward@fluendo.com>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps):
Update ffmpeg_codec_id <=> mimetype conversions
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame):
Finer grained keyframe detection
2005-12-16 Tim-Philipp Müller <tim at centricular dot net> 2005-12-16 Tim-Philipp Müller <tim at centricular dot net>
* ext/ffmpeg/gstffmpeg.c: (gst_ffmpeg_avcodec_open), * ext/ffmpeg/gstffmpeg.c: (gst_ffmpeg_avcodec_open),

2
common

@ -1 +1 @@
Subproject commit 4edc214072fe07d2aade96bc336493425654d7b4 Subproject commit d1911d4b3d6267f9cd9dfb68fcef2afe4d098092

View file

@ -244,10 +244,13 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
* MJPEG-B and sp5x decoding...)? */ * MJPEG-B and sp5x decoding...)? */
case CODEC_ID_MJPEG: case CODEC_ID_MJPEG:
case CODEC_ID_LJPEG: case CODEC_ID_LJPEG:
case CODEC_ID_SP5X:
caps = GST_FF_VID_CAPS_NEW ("image/jpeg", NULL); caps = GST_FF_VID_CAPS_NEW ("image/jpeg", NULL);
break; break;
case CODEC_ID_SP5X:
caps = GST_FF_VID_CAPS_NEW ("video/sp5x", NULL);
break;
case CODEC_ID_MJPEGB: case CODEC_ID_MJPEGB:
caps = GST_FF_VID_CAPS_NEW ("video/x-mjpeg-b", NULL); caps = GST_FF_VID_CAPS_NEW ("video/x-mjpeg-b", NULL);
break; break;
@ -378,7 +381,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
break; break;
case CODEC_ID_CYUV: case CODEC_ID_CYUV:
buildcaps = TRUE; caps = GST_FF_VID_CAPS_NEW ("video/x-compressed-yuv", NULL);
break; break;
case CODEC_ID_H264: case CODEC_ID_H264:
@ -410,8 +413,12 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
break; break;
case CODEC_ID_ASV1: case CODEC_ID_ASV1:
caps = GST_FF_VID_CAPS_NEW ("video/x-asus",
"asusversion", G_TYPE_INT, 1, NULL);
break;
case CODEC_ID_ASV2: case CODEC_ID_ASV2:
buildcaps = TRUE; caps = GST_FF_VID_CAPS_NEW ("video/x-asus",
"asusversion", G_TYPE_INT, 2, NULL);
break; break;
case CODEC_ID_FFV1: case CODEC_ID_FFV1:
@ -429,15 +436,22 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
"wcversion", G_TYPE_INT, 3 - CODEC_ID_XAN_WC3 + codec_id, NULL); "wcversion", G_TYPE_INT, 3 - CODEC_ID_XAN_WC3 + codec_id, NULL);
break; break;
case CODEC_ID_FRAPS:
case CODEC_ID_VCR1:
case CODEC_ID_CLJR: case CODEC_ID_CLJR:
caps = GST_FF_VID_CAPS_NEW ("video/x-cirrus-logic-accupak", NULL);
break;
case CODEC_ID_FRAPS:
case CODEC_ID_MDEC: case CODEC_ID_MDEC:
case CODEC_ID_ROQ: case CODEC_ID_ROQ:
case CODEC_ID_INTERPLAY_VIDEO: case CODEC_ID_INTERPLAY_VIDEO:
buildcaps = TRUE; buildcaps = TRUE;
break; break;
case CODEC_ID_VCR1:
caps = GST_FF_VID_CAPS_NEW ("video/x-ati-vcr",
"vcrversion", G_TYPE_INT, 1, NULL);
break;
case CODEC_ID_RPZA: case CODEC_ID_RPZA:
caps = GST_FF_VID_CAPS_NEW ("video/x-apple-video", NULL); caps = GST_FF_VID_CAPS_NEW ("video/x-apple-video", NULL);
break; break;
@ -484,27 +498,50 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
caps = GST_FF_AUD_CAPS_NEW ("audio/x-qdm2", NULL); caps = GST_FF_AUD_CAPS_NEW ("audio/x-qdm2", NULL);
break; break;
case CODEC_ID_MSZH:
caps = GST_FF_VID_CAPS_NEW ("video/x-mszh", NULL);
break;
case CODEC_ID_ZLIB:
caps = GST_FF_VID_CAPS_NEW ("video/x-zlib", NULL);
break;
case CODEC_ID_TRUEMOTION1:
caps = GST_FF_VID_CAPS_NEW ("video/x-truemotion",
"trueversion", G_TYPE_INT, 1, NULL);
break;
case CODEC_ID_TRUEMOTION2:
caps = GST_FF_VID_CAPS_NEW ("video/x-truemotion",
"trueversion", G_TYPE_INT, 2, NULL);
break;
case CODEC_ID_ULTI:
caps = GST_FF_VID_CAPS_NEW ("video/x-ultimotion",
NULL);
break;
case CODEC_ID_TSCC:
caps = GST_FF_VID_CAPS_NEW ("video/x-camtasia", NULL);
break;
case CODEC_ID_PNG:
caps = GST_FF_VID_CAPS_NEW ("image/png", NULL);
break;
case CODEC_ID_WS_VQA: case CODEC_ID_WS_VQA:
case CODEC_ID_IDCIN: case CODEC_ID_IDCIN:
case CODEC_ID_8BPS: case CODEC_ID_8BPS:
case CODEC_ID_SMC: case CODEC_ID_SMC:
case CODEC_ID_FLIC: case CODEC_ID_FLIC:
case CODEC_ID_TRUEMOTION1:
case CODEC_ID_TRUEMOTION2:
case CODEC_ID_VMDVIDEO: case CODEC_ID_VMDVIDEO:
case CODEC_ID_VMDAUDIO: case CODEC_ID_VMDAUDIO:
case CODEC_ID_MSZH:
case CODEC_ID_ZLIB:
case CODEC_ID_SONIC: case CODEC_ID_SONIC:
case CODEC_ID_SONIC_LS: case CODEC_ID_SONIC_LS:
case CODEC_ID_SNOW: case CODEC_ID_SNOW:
case CODEC_ID_TSCC:
case CODEC_ID_ULTI:
case CODEC_ID_QDRAW: case CODEC_ID_QDRAW:
case CODEC_ID_VIXL: case CODEC_ID_VIXL:
case CODEC_ID_QPEG: case CODEC_ID_QPEG:
case CODEC_ID_XVID: case CODEC_ID_XVID:
case CODEC_ID_PNG:
case CODEC_ID_PPM: case CODEC_ID_PPM:
case CODEC_ID_PBM: case CODEC_ID_PBM:
case CODEC_ID_PGM: case CODEC_ID_PGM:

View file

@ -807,6 +807,8 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
case CODEC_TYPE_VIDEO: case CODEC_TYPE_VIDEO:
{ {
gboolean iskeyframe = FALSE; gboolean iskeyframe = FALSE;
gboolean is_itype = FALSE;
gboolean is_reference = FALSE;
ffmpegdec->picture->pict_type = -1; /* in case we skip frames */ ffmpegdec->picture->pict_type = -1; /* in case we skip frames */
@ -814,10 +816,14 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
len = avcodec_decode_video (ffmpegdec->context, len = avcodec_decode_video (ffmpegdec->context,
ffmpegdec->picture, &have_data, data, size); ffmpegdec->picture, &have_data, data, size);
iskeyframe = ((ffmpegdec->picture->pict_type == FF_I_TYPE) || (ffmpegdec->picture->reference)); is_itype = (ffmpegdec->picture->pict_type == FF_I_TYPE);
is_reference = (ffmpegdec->picture->reference == 1);
iskeyframe = ( is_itype || is_reference )
|| (oclass->in_plugin->id == CODEC_ID_MSZH)
|| (oclass->in_plugin->id == CODEC_ID_ZLIB);
GST_DEBUG_OBJECT (ffmpegdec, GST_DEBUG_OBJECT (ffmpegdec,
"Decoded video: len=%d, have_data=%d, is_keyframe:%d", "Decoded video: len=%d, have_data=%d, is_keyframe:%d, is_itype:%d, is_reference:%d",
len, have_data, iskeyframe); len, have_data, iskeyframe, is_itype, is_reference);
if (ffmpegdec->waiting_for_key) { if (ffmpegdec->waiting_for_key) {
if (iskeyframe) { if (iskeyframe) {