diff options
author | Mark Nauwelaerts <manauw@skynet.be> | 2007-04-12 11:06:46 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2007-04-12 11:06:46 +0000 |
commit | ed36eb0fc548edb334a9e6f2e9a6ebf6610f2f2c (patch) | |
tree | 097d3130340be6a706296491106750852332f57f | |
parent | eff0fefa3ec3111031a87bcf945fa49cf210df35 (diff) |
ext/ffmpeg/: Add the CODEC_FLAG_GLOBAL_HEADER to the exposed flags, and makes it as such configurable as a property. ...
Original commit message from CVS:
Patch by: Mark Nauwelaerts <manauw at skynet dot be> and
Thomas Vander Stichele <thomas at apestaart dot org>
* ext/ffmpeg/gstffmpegcfg.c: (gst_ffmpeg_flags_get_type):
* 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 the CODEC_FLAG_GLOBAL_HEADER to the exposed flags, and makes it as such
configurable as a property. Fixes #393187.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | ext/ffmpeg/gstffmpegcfg.c | 1 | ||||
-rw-r--r-- | ext/ffmpeg/gstffmpegcodecmap.c | 13 |
3 files changed, 25 insertions, 1 deletions
@@ -1,5 +1,17 @@ 2007-04-12 Wim Taymans <wim@fluendo.com> + Patch by: Mark Nauwelaerts <manauw at skynet dot be> and + Thomas Vander Stichele <thomas at apestaart dot org> + + * ext/ffmpeg/gstffmpegcfg.c: (gst_ffmpeg_flags_get_type): + * 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 the CODEC_FLAG_GLOBAL_HEADER to the exposed flags, and makes it as such + configurable as a property. Fixes #393187. + +2007-04-12 Wim Taymans <wim@fluendo.com> + Patch by: Yves Lefebvre <ivanohe at abacom dot com> * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_setcaps): diff --git a/ext/ffmpeg/gstffmpegcfg.c b/ext/ffmpeg/gstffmpegcfg.c index 070c505..7501875 100644 --- a/ext/ffmpeg/gstffmpegcfg.c +++ b/ext/ffmpeg/gstffmpegcfg.c @@ -267,6 +267,7 @@ gst_ffmpeg_flags_get_type (void) {CODEC_FLAG_GRAY, "Only decode/encode grayscale", "gray"}, {CODEC_FLAG_NORMALIZE_AQP, "Normalize Adaptive Quantization (masking, etc)", "aqp"}, {CODEC_FLAG_TRELLIS_QUANT, "Trellis Quantization", "trellis"}, + {CODEC_FLAG_GLOBAL_HEADER, "Global headers in extradata instead of every keyframe", "global-headers"}, {CODEC_FLAG_AC_PRED, "H263 Advanced Intra Coding / MPEG4 AC prediction", "aic"}, {CODEC_FLAG_H263P_UMV, "Unlimited Motion Vector", "umv"}, {CODEC_FLAG_CBP_RD, "Rate Distoration Optimization for CBP", "cbp-rd"}, diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c index 204b5cb..46b0241 100644 --- a/ext/ffmpeg/gstffmpegcodecmap.c +++ b/ext/ffmpeg/gstffmpegcodecmap.c @@ -534,6 +534,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, caps = gst_ff_vid_caps_new (context, codec_id, "video/x-vp3", NULL); break; +#ifdef CODEC_ID_VP5 case CODEC_ID_VP5: caps = gst_ff_vid_caps_new (context, codec_id, "video/x-vp5", NULL); break; @@ -545,6 +546,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, case CODEC_ID_VP6F: caps = gst_ff_vid_caps_new (context, codec_id, "video/x-vp6-flash", NULL); break; +#endif case CODEC_ID_THEORA: caps = gst_ff_vid_caps_new (context, codec_id, "video/x-theora", NULL); @@ -1493,6 +1495,7 @@ gst_ffmpeg_caps_with_codectype (enum CodecType type, /* * caps_with_codecid () transforms a GstCaps for a known codec * ID into a filled-in context. + * codec_data from caps will override possible extradata already in the context */ void @@ -1513,12 +1516,16 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id, buf = GST_BUFFER_CAST (gst_value_get_mini_object (value)); size = GST_BUFFER_SIZE (buf); + /* free the old one if it is there */ + if (context->extradata) + av_free (context->extradata); + /* allocate with enough padding */ context->extradata = av_mallocz (GST_ROUND_UP_16 (size + FF_INPUT_BUFFER_PADDING_SIZE)); memcpy (context->extradata, GST_BUFFER_DATA (buf), size); context->extradata_size = size; - } else { + } else if (context->extradata == NULL) { /* no extradata, alloc dummy with 0 sized, some codecs insist on reading * extradata anyway which makes then segfault. */ context->extradata = @@ -2128,6 +2135,7 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context) } else if (!strcmp (mimetype, "video/x-vp3")) { id = CODEC_ID_VP3; video = TRUE; +#ifdef CODEC_ID_VP5 } else if (!strcmp (mimetype, "video/x-vp5")) { id = CODEC_ID_VP5; video = TRUE; @@ -2137,6 +2145,7 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context) } else if (!strcmp (mimetype, "video/x-vp6-flash")) { id = CODEC_ID_VP6F; video = TRUE; +#endif } else if (!strcmp (mimetype, "video/x-flash-screen")) { id = CODEC_ID_FLASHSV; video = TRUE; @@ -2532,6 +2541,7 @@ gst_ffmpeg_get_codecid_longname (enum CodecID codec_id) case CODEC_ID_VP3: name = "VP3 video"; break; +#ifdef CODEC_ID_VP5 case CODEC_ID_VP5: name = "VP5 video"; break; @@ -2541,6 +2551,7 @@ gst_ffmpeg_get_codecid_longname (enum CodecID codec_id) case CODEC_ID_VP6F: name = "VP6 Flash video"; break; +#endif case CODEC_ID_FLASHSV: name = "Flash Screen Video"; break; |