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.
parent 3096674f
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> 2005-10-03 Thomas Vander Stichele <thomas at apestaart dot org>
* configure.ac: * configure.ac:
......
...@@ -782,7 +782,6 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -782,7 +782,6 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
} }
if (caps != NULL) { if (caps != NULL) {
char *str;
/* set private data */ /* set private data */
if (context && context->extradata_size > 0) { if (context && context->extradata_size > 0) {
...@@ -800,9 +799,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -800,9 +799,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
gst_ffmpeg_set_palette (caps, context); gst_ffmpeg_set_palette (caps, context);
} }
str = gst_caps_to_string (caps); GST_DEBUG ("caps for codec_id=%d: %" GST_PTR_FORMAT, codec_id, caps);
GST_DEBUG ("caps for codec_id=%d: %s", codec_id, str);
g_free (str);
} else { } else {
GST_WARNING ("No caps found for codec_id=%d", codec_id); GST_WARNING ("No caps found for codec_id=%d", codec_id);
......
...@@ -421,9 +421,13 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps) ...@@ -421,9 +421,13 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps)
GST_DEBUG_OBJECT (ffmpegenc, "picking an output format ..."); GST_DEBUG_OBJECT (ffmpegenc, "picking an output format ...");
allowed_caps = gst_pad_get_allowed_caps (ffmpegenc->srcpad); allowed_caps = gst_pad_get_allowed_caps (ffmpegenc->srcpad);
if (!allowed_caps) { if (!allowed_caps) {
GST_DEBUG_OBJECT (ffmpegenc, "... but no peer, no caps"); GST_DEBUG_OBJECT (ffmpegenc, "... but no peer, using template caps");
allowed_caps = gst_pad_get_pad_template_caps (ffmpegenc->srcpad); /* 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, gst_ffmpeg_caps_with_codecid (oclass->in_plugin->id,
oclass->in_plugin->type, allowed_caps, ffmpegenc->context); oclass->in_plugin->type, allowed_caps, ffmpegenc->context);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment