ext/ffmpeg/: Add mappings for RealVideo 4.0, AMR-WB, AMR-NB and DTS to silence warnings when registering.

Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_get_codecids),
(gst_ffmpeg_caps_to_codecid), (gst_ffmpeg_get_codecid_longname):
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_class_init):
Add mappings for RealVideo 4.0, AMR-WB, AMR-NB and DTS to silence
warnings when registering.
Only register the 1/2,1/4 size decode and frame-skipping properties
on video decoders.
* gst-libs/ext/ffmpeg/configure.ac:
* gst-libs/ext/ffmpeg/libavformat/Makefile.am:
* gst-libs/ext/ffmpeg/patches/autotools.patch:
Merge patch by Sam Morris to allow disabling of decoders.
Fixes #324366
This commit is contained in:
Sam Morris 2006-05-07 01:18:46 +00:00 committed by Jan Schmidt
parent 4049137cc6
commit a3cf8e1888
3 changed files with 66 additions and 10 deletions

View file

@ -1,3 +1,20 @@
2006-05-07 Jan Schmidt <thaytan@mad.scientist.com>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_caps_with_codecid), (gst_ffmpeg_formatid_get_codecids),
(gst_ffmpeg_caps_to_codecid), (gst_ffmpeg_get_codecid_longname):
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_class_init):
Add mappings for RealVideo 4.0, AMR-WB, AMR-NB and DTS to silence
warnings when registering.
Only register the 1/2,1/4 size decode and frame-skipping properties
on video decoders.
* gst-libs/ext/ffmpeg/configure.ac:
* gst-libs/ext/ffmpeg/libavformat/Makefile.am:
* gst-libs/ext/ffmpeg/patches/autotools.patch:
Merge patch by Sam Morris to allow disabling of decoders.
Fixes #324366
2006-05-07 Jan Schmidt <thaytan@mad.scientist.com> 2006-05-07 Jan Schmidt <thaytan@mad.scientist.com>
* gst-libs/ext/ffmpeg/patches/autotools.patch: * gst-libs/ext/ffmpeg/patches/autotools.patch:

View file

@ -179,8 +179,21 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
case CODEC_ID_RV10: case CODEC_ID_RV10:
case CODEC_ID_RV20: case CODEC_ID_RV20:
case CODEC_ID_RV40:
{ {
gint version = (codec_id == CODEC_ID_RV10) ? 1 : 2; gint version;
switch (codec_id) {
case CODEC_ID_RV40:
version = 4;
break;
case CODEC_ID_RV20:
version = 2;
break;
default:
version = 1;
break;
}
/* FIXME: context->sub_id must be filled in during decoding */ /* FIXME: context->sub_id must be filled in during decoding */
caps = GST_FF_VID_CAPS_NEW ("video/x-pn-realvideo", caps = GST_FF_VID_CAPS_NEW ("video/x-pn-realvideo",
@ -236,6 +249,9 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
caps = GST_FF_AUD_CAPS_NEW ("audio/x-ac3", NULL); caps = GST_FF_AUD_CAPS_NEW ("audio/x-ac3", NULL);
} }
break; break;
case CODEC_ID_DTS:
caps = GST_FF_AUD_CAPS_NEW ("audio/x-dts", NULL);
break;
/* MJPEG is normal JPEG, Motion-JPEG and Quicktime MJPEG-A. MJPEGB /* MJPEG is normal JPEG, Motion-JPEG and Quicktime MJPEG-A. MJPEGB
* is Quicktime's MJPEG-B. LJPEG is lossless JPEG. I don't know what * is Quicktime's MJPEG-B. LJPEG is lossless JPEG. I don't know what
@ -1416,6 +1432,7 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id,
case CODEC_ID_RV10: case CODEC_ID_RV10:
case CODEC_ID_RV20: case CODEC_ID_RV20:
case CODEC_ID_RV40:
{ {
guint32 fourcc; guint32 fourcc;
@ -1575,6 +1592,7 @@ gst_ffmpeg_formatid_get_codecids (const gchar *format_name,
static enum CodecID mpegts_audio_list[] = { CODEC_ID_MP2, static enum CodecID mpegts_audio_list[] = { CODEC_ID_MP2,
CODEC_ID_MP3, CODEC_ID_MP3,
CODEC_ID_AC3, CODEC_ID_AC3,
CODEC_ID_DTS,
CODEC_ID_AAC, CODEC_ID_AAC,
CODEC_ID_NONE }; CODEC_ID_NONE };
@ -1582,7 +1600,8 @@ gst_ffmpeg_formatid_get_codecids (const gchar *format_name,
*audio_codec_list = mpegts_audio_list; *audio_codec_list = mpegts_audio_list;
} else if (!strcmp (format_name, "vob")) { } else if (!strcmp (format_name, "vob")) {
static enum CodecID vob_video_list[] = { CODEC_ID_MPEG2VIDEO, CODEC_ID_NONE }; static enum CodecID vob_video_list[] = { CODEC_ID_MPEG2VIDEO, CODEC_ID_NONE };
static enum CodecID vob_audio_list[] = { CODEC_ID_MP2, CODEC_ID_AC3, CODEC_ID_NONE }; static enum CodecID vob_audio_list[] = { CODEC_ID_MP2, CODEC_ID_AC3,
CODEC_ID_DTS, CODEC_ID_NONE };
*video_codec_list = vob_video_list; *video_codec_list = vob_video_list;
*audio_codec_list = vob_audio_list; *audio_codec_list = vob_audio_list;
@ -1785,6 +1804,9 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context)
} else if (!strcmp (mimetype, "audio/x-ac3")) { } else if (!strcmp (mimetype, "audio/x-ac3")) {
id = CODEC_ID_AC3; id = CODEC_ID_AC3;
audio = TRUE; audio = TRUE;
} else if (!strcmp (mimetype, "audio/x-dts")) {
id = CODEC_ID_DTS;
audio = TRUE;
} else if (!strcmp (mimetype, "video/x-msmpeg")) { } else if (!strcmp (mimetype, "video/x-msmpeg")) {
gint msmpegversion = 0; gint msmpegversion = 0;
@ -1975,6 +1997,9 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context)
case 2: case 2:
id = CODEC_ID_RV20; id = CODEC_ID_RV20;
break; break;
case 4:
id = CODEC_ID_RV40;
break;
} }
} }
if (id != CODEC_ID_NONE) if (id != CODEC_ID_NONE)
@ -2102,6 +2127,9 @@ gst_ffmpeg_get_codecid_longname (enum CodecID codec_id)
case CODEC_ID_RV20: case CODEC_ID_RV20:
name = "Realvideo 2.0"; name = "Realvideo 2.0";
break; break;
case CODEC_ID_RV40:
name = "Realvideo 4.0";
break;
case CODEC_ID_MP2: case CODEC_ID_MP2:
name = "MPEG-1 layer 2 audio"; name = "MPEG-1 layer 2 audio";
break; break;
@ -2117,6 +2145,9 @@ gst_ffmpeg_get_codecid_longname (enum CodecID codec_id)
case CODEC_ID_AC3: case CODEC_ID_AC3:
name = "AC-3 audio"; name = "AC-3 audio";
break; break;
case CODEC_ID_DTS:
name = "DTS Audio";
break;
case CODEC_ID_MJPEG: case CODEC_ID_MJPEG:
name = "Motion-JPEG"; name = "Motion-JPEG";
break; break;
@ -2478,6 +2509,12 @@ gst_ffmpeg_get_codecid_longname (enum CodecID codec_id)
case CODEC_ID_TRUESPEECH: case CODEC_ID_TRUESPEECH:
name = "DSP Group TrueSpeech Audio"; name = "DSP Group TrueSpeech Audio";
break; break;
case CODEC_ID_AMR_NB:
name = "3GPP AMR NarrowBand speech audio codec";
break;
case CODEC_ID_AMR_WB:
name = "3GPP AMR WideBand speech audio codec";
break;
default: default:
GST_WARNING ("Unknown codecID 0x%x", codec_id); GST_WARNING ("Unknown codecID 0x%x", codec_id);
break; break;

View file

@ -256,14 +256,16 @@ gst_ffmpegdec_class_init (GstFFMpegDecClass * klass)
gobject_class->get_property = gst_ffmpegdec_get_property; gobject_class->get_property = gst_ffmpegdec_get_property;
gstelement_class->change_state = gst_ffmpegdec_change_state; gstelement_class->change_state = gst_ffmpegdec_change_state;
g_object_class_install_property (gobject_class, ARG_SKIPFRAME, if (klass->in_plugin->type == CODEC_TYPE_VIDEO) {
g_param_spec_enum ("skip-frame", "Skip frames", g_object_class_install_property (gobject_class, ARG_SKIPFRAME,
"Which types of frames to skip during decoding", g_param_spec_enum ("skip-frame", "Skip frames",
GST_FFMPEGDEC_TYPE_SKIPFRAME, 0, G_PARAM_READWRITE)); "Which types of frames to skip during decoding",
g_object_class_install_property (gobject_class, ARG_LOWRES, GST_FFMPEGDEC_TYPE_SKIPFRAME, 0, G_PARAM_READWRITE));
g_param_spec_enum ("lowres", "Low resolution", g_object_class_install_property (gobject_class, ARG_LOWRES,
"At which resolution to decode images", g_param_spec_enum ("lowres", "Low resolution",
GST_FFMPEGDEC_TYPE_LOWRES, 0, G_PARAM_READWRITE)); "At which resolution to decode images",
GST_FFMPEGDEC_TYPE_LOWRES, 0, G_PARAM_READWRITE));
}
} }
static void static void