mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
ext/ffmpeg/gstffmpegcodecmap.c: Add ALAC, shorten and some more in new FFMPEG snapshot of 21/4, somewhere this aftern...
Original commit message from CVS: * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps), (gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid), (gst_ffmpeg_get_codecid_longname): Add ALAC, shorten and some more in new FFMPEG snapshot of 21/4, somewhere this afternoon. * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_register): * ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_register): Add warnings to decoder registration to easier add new ones during snapshot updates.
This commit is contained in:
parent
f20095d007
commit
23e0f2c1f6
4 changed files with 118 additions and 10 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2005-04-21 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
|
||||
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_caps_to_codecid),
|
||||
(gst_ffmpeg_get_codecid_longname):
|
||||
Add ALAC, shorten and some more in new FFMPEG snapshot of
|
||||
21/4, somewhere this afternoon.
|
||||
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_register):
|
||||
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_register):
|
||||
Add warnings to decoder registration to easier add new ones
|
||||
during snapshot updates.
|
||||
|
||||
2005-04-21 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* ext/ffmpeg/gstffmpegcodecmap.c:
|
||||
|
|
|
@ -395,6 +395,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
|
|||
"indeoversion", G_TYPE_INT, 3, NULL);
|
||||
break;
|
||||
|
||||
case CODEC_ID_INDEO2:
|
||||
caps = GST_FF_VID_CAPS_NEW ("video/x-indeo",
|
||||
"indeoversion", G_TYPE_INT, 2, NULL);
|
||||
break;
|
||||
|
||||
case CODEC_ID_VP3:
|
||||
caps = GST_FF_VID_CAPS_NEW ("video/x-vp3", NULL);
|
||||
break;
|
||||
|
@ -463,6 +468,12 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
|
|||
"msvideoversion", G_TYPE_INT, 1, NULL);
|
||||
break;
|
||||
|
||||
case CODEC_ID_WMV3:
|
||||
case CODEC_ID_VC9:
|
||||
caps = GST_FF_VID_CAPS_NEW ("video/x-wmv",
|
||||
"wmvversion", G_TYPE_INT, 3, NULL);
|
||||
break;
|
||||
|
||||
case CODEC_ID_WS_VQA:
|
||||
case CODEC_ID_IDCIN:
|
||||
case CODEC_ID_8BPS:
|
||||
|
@ -490,6 +501,12 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
|
|||
case CODEC_ID_PGMYUV:
|
||||
case CODEC_ID_PAM:
|
||||
case CODEC_ID_FFVHUFF:
|
||||
case CODEC_ID_LOCO:
|
||||
case CODEC_ID_WNV1:
|
||||
case CODEC_ID_AASC:
|
||||
case CODEC_ID_MP3ADU:
|
||||
case CODEC_ID_MP3ON4:
|
||||
case CODEC_ID_WESTWOOD_SND1:
|
||||
buildcaps = TRUE;
|
||||
break;
|
||||
|
||||
|
@ -575,6 +592,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
|
|||
case CODEC_ID_ADPCM_EA:
|
||||
case CODEC_ID_ADPCM_G726:
|
||||
case CODEC_ID_ADPCM_CT:
|
||||
case CODEC_ID_ADPCM_SWF:
|
||||
do {
|
||||
gchar *layout = NULL;
|
||||
|
||||
|
@ -618,6 +636,9 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
|
|||
case CODEC_ID_ADPCM_CT:
|
||||
layout = "ct";
|
||||
break;
|
||||
case CODEC_ID_ADPCM_SWF:
|
||||
layout = "swf";
|
||||
break;
|
||||
default:
|
||||
g_assert (0); /* don't worry, we never get here */
|
||||
break;
|
||||
|
@ -689,6 +710,18 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
|
|||
} while (0);
|
||||
break;
|
||||
|
||||
case CODEC_ID_SHORTEN:
|
||||
caps = gst_caps_new_simple ("audio/x-shorten", NULL);
|
||||
break;
|
||||
|
||||
case CODEC_ID_ALAC:
|
||||
caps = GST_FF_AUD_CAPS_NEW ("audio/x-alac", NULL);
|
||||
if (context) {
|
||||
gst_caps_set_simple (caps,
|
||||
"samplesize", G_TYPE_INT, context->bits_per_sample, NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
case CODEC_ID_FLAC:
|
||||
/* Note that ffmpeg has no encoder yet, but just for safety. In the
|
||||
* encoder case, we want to add things like samplerate, channels... */
|
||||
|
@ -1247,6 +1280,10 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id,
|
|||
} while (0);
|
||||
break;
|
||||
|
||||
case CODEC_ID_ALAC:
|
||||
gst_structure_get_int (str, "samplesize", &context->bits_per_sample);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1479,6 +1516,9 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context)
|
|||
case 2:
|
||||
id = CODEC_ID_WMV2;
|
||||
break;
|
||||
case 3:
|
||||
id = CODEC_ID_WMV3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (id != CODEC_ID_NONE)
|
||||
|
@ -1590,10 +1630,17 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context)
|
|||
} else if (!strcmp (mimetype, "video/x-indeo")) {
|
||||
gint indeoversion = 0;
|
||||
|
||||
if (gst_structure_get_int (structure, "indeoversion", &indeoversion) &&
|
||||
indeoversion == 3) {
|
||||
id = CODEC_ID_INDEO3;
|
||||
video = TRUE;
|
||||
if (gst_structure_get_int (structure, "indeoversion", &indeoversion)) {
|
||||
switch (indeoversion) {
|
||||
case 3:
|
||||
id = CODEC_ID_INDEO3;
|
||||
break;
|
||||
case 2:
|
||||
id = CODEC_ID_INDEO2;
|
||||
break;
|
||||
}
|
||||
if (id != CODEC_ID_NONE)
|
||||
video = TRUE;
|
||||
}
|
||||
} else if (!strcmp (mimetype, "video/x-divx")) {
|
||||
gint divxversion = 0;
|
||||
|
@ -1657,6 +1704,8 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context)
|
|||
id = CODEC_ID_ADPCM_G726;
|
||||
} else if (!strcmp (layout, "ct")) {
|
||||
id = CODEC_ID_ADPCM_CT;
|
||||
} else if (!strcmp (layout, "swf")) {
|
||||
id = CODEC_ID_ADPCM_SWF;
|
||||
}
|
||||
if (id != CODEC_ID_NONE)
|
||||
audio = TRUE;
|
||||
|
@ -1683,6 +1732,12 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context)
|
|||
} else if (!strcmp (mimetype, "audio/x-flac")) {
|
||||
id = CODEC_ID_FLAC;
|
||||
audio = TRUE;
|
||||
} else if (!strcmp (mimetype, "audio/x-shorten")) {
|
||||
id = CODEC_ID_SHORTEN;
|
||||
audio = TRUE;
|
||||
} else if (!strcmp (mimetype, "audio/x-alac")) {
|
||||
id = CODEC_ID_ALAC;
|
||||
audio = TRUE;
|
||||
} else if (!strcmp (mimetype, "video/x-cinepak")) {
|
||||
id = CODEC_ID_CINEPAK;
|
||||
video = TRUE;
|
||||
|
@ -1854,6 +1909,12 @@ gst_ffmpeg_get_codecid_longname (enum CodecID codec_id)
|
|||
case CODEC_ID_WMV2:
|
||||
name = "Windows Media Video v8";
|
||||
break;
|
||||
case CODEC_ID_WMV3:
|
||||
name = "Windows Media Video v9";
|
||||
break;
|
||||
case CODEC_ID_VC9:
|
||||
name = "Microsoft Video Codec v1";
|
||||
break;
|
||||
case CODEC_ID_H263P:
|
||||
name = "H.263 (P) video";
|
||||
break;
|
||||
|
@ -1899,6 +1960,9 @@ gst_ffmpeg_get_codecid_longname (enum CodecID codec_id)
|
|||
case CODEC_ID_INDEO3:
|
||||
name = "Indeo-3 video";
|
||||
break;
|
||||
case CODEC_ID_INDEO2:
|
||||
name = "Indeo=2 video";
|
||||
break;
|
||||
case CODEC_ID_VP3:
|
||||
name = "VP3 video";
|
||||
break;
|
||||
|
@ -2035,6 +2099,24 @@ gst_ffmpeg_get_codecid_longname (enum CodecID codec_id)
|
|||
case CODEC_ID_FFVHUFF:
|
||||
name = "FFMPEG non-compliant Huffyuv video";
|
||||
break;
|
||||
case CODEC_ID_LOCO:
|
||||
name = "LOCO video";
|
||||
break;
|
||||
case CODEC_ID_WNV1:
|
||||
name = "Winnov video 1";
|
||||
break;
|
||||
case CODEC_ID_AASC:
|
||||
name = "Autodesk RLE video";
|
||||
break;
|
||||
case CODEC_ID_MP3ADU:
|
||||
name = "ADU-formatted MPEG-1 layer 3 audio";
|
||||
break;
|
||||
case CODEC_ID_MP3ON4:
|
||||
name = "MP3ON4";
|
||||
break;
|
||||
case CODEC_ID_WESTWOOD_SND1:
|
||||
name = "Westwood Sound-1";
|
||||
break;
|
||||
case CODEC_ID_PCM_MULAW:
|
||||
name = "Mu-law audio";
|
||||
break;
|
||||
|
@ -2080,6 +2162,9 @@ gst_ffmpeg_get_codecid_longname (enum CodecID codec_id)
|
|||
case CODEC_ID_ADPCM_CT:
|
||||
name = "CT ADPCM";
|
||||
break;
|
||||
case CODEC_ID_ADPCM_SWF:
|
||||
name = "Shockwave ADPCM";
|
||||
break;
|
||||
case CODEC_ID_RA_144:
|
||||
name = "Realaudio 14k4bps";
|
||||
break;
|
||||
|
@ -2101,6 +2186,12 @@ gst_ffmpeg_get_codecid_longname (enum CodecID codec_id)
|
|||
case CODEC_ID_FLAC:
|
||||
name = "FLAC lossless audio";
|
||||
break;
|
||||
case CODEC_ID_SHORTEN:
|
||||
name = "Shorten lossless audio";
|
||||
break;
|
||||
case CODEC_ID_ALAC:
|
||||
name = "Apple lossless audio";
|
||||
break;
|
||||
default:
|
||||
GST_WARNING ("Unknown codecID 0x%x", codec_id);
|
||||
break;
|
||||
|
|
|
@ -1043,8 +1043,11 @@ gst_ffmpegdec_register (GstPlugin * plugin)
|
|||
}
|
||||
|
||||
/* name */
|
||||
if (!gst_ffmpeg_get_codecid_longname (in_plugin->id))
|
||||
if (!gst_ffmpeg_get_codecid_longname (in_plugin->id)) {
|
||||
g_warning ("Add decoder %s (%d) please",
|
||||
in_plugin->name, in_plugin->id);
|
||||
goto next;
|
||||
}
|
||||
|
||||
/* first make sure we've got a supported type */
|
||||
sinkcaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL, FALSE);
|
||||
|
@ -1081,10 +1084,7 @@ gst_ffmpegdec_register (GstPlugin * plugin)
|
|||
/* (Ronald) MPEG-4 gets a higher priority because it has been well-
|
||||
* tested and by far outperforms divxdec/xviddec - so we prefer it.
|
||||
* msmpeg4v3 same, as it outperforms divxdec for divx3 playback.
|
||||
* H263 has the same mimetype as H263I and since H263 works for the
|
||||
* few streams that I've tried (see, e.g., #155163), I'll use that
|
||||
* and use rank=none for H263I for now, until I know what the diff
|
||||
* is. */
|
||||
* VC1/WMV3 are not working and thus unpreferred for now. */
|
||||
switch (in_plugin->id) {
|
||||
case CODEC_ID_MPEG4:
|
||||
case CODEC_ID_MSMPEG4V3:
|
||||
|
@ -1093,6 +1093,8 @@ gst_ffmpegdec_register (GstPlugin * plugin)
|
|||
default:
|
||||
rank = GST_RANK_MARGINAL;
|
||||
break;
|
||||
case CODEC_ID_WMV3:
|
||||
case CODEC_ID_VC9:
|
||||
/* what's that? */
|
||||
case CODEC_ID_SP5X:
|
||||
rank = GST_RANK_NONE;
|
||||
|
|
|
@ -704,8 +704,11 @@ gst_ffmpegenc_register (GstPlugin * plugin)
|
|||
}
|
||||
|
||||
/* name */
|
||||
if (!gst_ffmpeg_get_codecid_longname (in_plugin->id))
|
||||
if (!gst_ffmpeg_get_codecid_longname (in_plugin->id)) {
|
||||
g_warning ("Add encoder %s (%d) please",
|
||||
in_plugin->name, in_plugin->id);
|
||||
goto next;
|
||||
}
|
||||
|
||||
/* first make sure we've got a supported type */
|
||||
srccaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL, TRUE);
|
||||
|
|
Loading…
Reference in a new issue