ext/ffmpeg/gstffmpegcodecmap.c: we have better ways of debugging caps

Original commit message from CVS:

* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps):
we have better ways of debugging caps
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_setcaps):
ye gods.  get_template_caps doesn't return a ref, so when the
pad was not linked, crashes would ensue.  Serves me right.
This commit is contained in:
Thomas Vander Stichele 2005-10-05 17:53:00 +00:00
parent 3096674f61
commit a2f57c7b3f
3 changed files with 15 additions and 6 deletions

View file

@ -1,3 +1,11 @@
2005-10-05 Thomas Vander Stichele <thomas at apestaart dot org>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps):
we have better ways of debugging caps
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_setcaps):
ye gods. get_template_caps doesn't return a ref, so when the
pad was not linked, crashes would ensue. Serves me right.
2005-10-03 Thomas Vander Stichele <thomas at apestaart dot org>
* configure.ac:

View file

@ -782,7 +782,6 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
}
if (caps != NULL) {
char *str;
/* set private data */
if (context && context->extradata_size > 0) {
@ -800,9 +799,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
gst_ffmpeg_set_palette (caps, context);
}
str = gst_caps_to_string (caps);
GST_DEBUG ("caps for codec_id=%d: %s", codec_id, str);
g_free (str);
GST_DEBUG ("caps for codec_id=%d: %" GST_PTR_FORMAT, codec_id, caps);
} else {
GST_WARNING ("No caps found for codec_id=%d", codec_id);

View file

@ -421,9 +421,13 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps)
GST_DEBUG_OBJECT (ffmpegenc, "picking an output format ...");
allowed_caps = gst_pad_get_allowed_caps (ffmpegenc->srcpad);
if (!allowed_caps) {
GST_DEBUG_OBJECT (ffmpegenc, "... but no peer, no caps");
allowed_caps = gst_pad_get_pad_template_caps (ffmpegenc->srcpad);
GST_DEBUG_OBJECT (ffmpegenc, "... but no peer, using template caps");
/* we need to copy because get_allowed_caps returns a ref, and
* get_pad_template_caps doesn't */
allowed_caps = gst_caps_copy (
gst_pad_get_pad_template_caps (ffmpegenc->srcpad));
}
GST_DEBUG_OBJECT (ffmpegenc, "chose caps %" GST_PTR_FORMAT, allowed_caps);
gst_ffmpeg_caps_with_codecid (oclass->in_plugin->id,
oclass->in_plugin->type, allowed_caps, ffmpegenc->context);