From c3d69815590e6e09434466ed0892e3a3a90d3713 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 9 Oct 2006 13:31:55 +0000 Subject: [PATCH] ext/ffmpeg/gstffmpegcodecmap.c: Added proper mime types for mxf and gxf formats. Original commit message from CVS: * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_formatid_to_caps), (gst_ffmpeg_formatid_get_codecids): Added proper mime types for mxf and gxf formats. Added known configuration for asf muxer. Implies allowing the ffmpeg asf muxer to take WMV and WMA. * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_chain): Most demuxers/formats don't give keyframe information on encoded audio streams. We therefore don't discard them, and use the clipping functionnality to drop the decoded buffers we didn't need. --- ChangeLog | 12 ++++++++++++ ext/ffmpeg/gstffmpegcodecmap.c | 10 ++++++++++ ext/ffmpeg/gstffmpegdec.c | 7 ++++--- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ac3a59989..2b2f87db68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2006-10-09 Edward Hervey + + * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_formatid_to_caps), + (gst_ffmpeg_formatid_get_codecids): + Added proper mime types for mxf and gxf formats. + Added known configuration for asf muxer. Implies allowing the ffmpeg asf + muxer to take WMV and WMA. + * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_chain): + Most demuxers/formats don't give keyframe information on encoded + audio streams. We therefore don't discard them, and use the clipping + functionnality to drop the decoded buffers we didn't need. + 2006-10-09 Edward Hervey * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register): diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c index 63d5a3db5c..19f35a96ac 100644 --- a/ext/ffmpeg/gstffmpegcodecmap.c +++ b/ext/ffmpeg/gstffmpegcodecmap.c @@ -1620,6 +1620,10 @@ gst_ffmpeg_formatid_to_caps (const gchar * format_name) caps = gst_caps_from_string ("image/gif"); } else if (!strcmp (format_name, "ogg")) { caps = gst_caps_from_string ("application/ogg"); + } else if (!strcmp (format_name, "mxf")) { + caps = gst_caps_from_string ("application/mxf"); + } else if (!strcmp (format_name, "gxf")) { + caps = gst_caps_from_string ("application/gxf"); } else if (!strcmp (format_name, "yuv4mpegpipe")) { caps = gst_caps_new_simple ("application/x-yuv4mpeg", "y4mversion", G_TYPE_INT, 1, @@ -1687,6 +1691,12 @@ gst_ffmpeg_formatid_get_codecids (const gchar *format_name, *video_codec_list = flv_video_list; *audio_codec_list = flv_audio_list; + } else if (!strcmp (format_name, "asf")) { + static enum CodecID asf_video_list[] = { CODEC_ID_WMV1, CODEC_ID_WMV2, CODEC_ID_NONE }; + static enum CodecID asf_audio_list[] = { CODEC_ID_WMAV1, CODEC_ID_WMAV2, CODEC_ID_NONE }; + + *video_codec_list = asf_video_list; + *audio_codec_list = asf_audio_list; } else { GST_LOG ("Format %s not found", format_name); return FALSE; diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index 410213259f..4747948f36 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -1791,10 +1791,13 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) ffmpegdec->next_ts = GST_CLOCK_TIME_NONE; } + oclass = (GstFFMpegDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec)); + /* do early keyframe check pretty bad to rely on the keyframe flag in the * source for this as it might not even be parsed (UDP/file/..). */ if (G_UNLIKELY (ffmpegdec->waiting_for_key)) { - if (GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_DELTA_UNIT)) + if (GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_DELTA_UNIT) && + oclass->in_plugin->type != CODEC_TYPE_AUDIO) goto skip_keyframe; GST_DEBUG_OBJECT (ffmpegdec, "got keyframe"); @@ -1808,8 +1811,6 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) "Received new data of size %d, ts:%" GST_TIME_FORMAT ", dur:%"GST_TIME_FORMAT, GST_BUFFER_SIZE (inbuf), GST_TIME_ARGS (pending_timestamp), GST_TIME_ARGS (pending_duration)); - oclass = (GstFFMpegDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec)); - /* parse cache joining. If there is cached data, its timestamp will be what we * send to the parse. */ if (ffmpegdec->pcache) {