Commit 4231dbd8 authored by David Schleef's avatar David Schleef
Browse files

Convert elements to use gst_pad_use_explicit_caps() where appropriate.

Original commit message from CVS:
Convert elements to use gst_pad_use_explicit_caps() where appropriate.
parent e1c922ec
...@@ -179,6 +179,7 @@ gst_ffmpegdec_init (GstFFMpegDec *ffmpegdec) ...@@ -179,6 +179,7 @@ gst_ffmpegdec_init (GstFFMpegDec *ffmpegdec)
gst_pad_set_link_function (ffmpegdec->sinkpad, gst_ffmpegdec_connect); gst_pad_set_link_function (ffmpegdec->sinkpad, gst_ffmpegdec_connect);
gst_pad_set_chain_function (ffmpegdec->sinkpad, gst_ffmpegdec_chain); gst_pad_set_chain_function (ffmpegdec->sinkpad, gst_ffmpegdec_chain);
ffmpegdec->srcpad = gst_pad_new_from_template (oclass->srctempl, "src"); ffmpegdec->srcpad = gst_pad_new_from_template (oclass->srctempl, "src");
gst_pad_use_explicit_caps (ffmpegdec->srcpad);
gst_element_add_pad (GST_ELEMENT (ffmpegdec), ffmpegdec->sinkpad); gst_element_add_pad (GST_ELEMENT (ffmpegdec), ffmpegdec->sinkpad);
gst_element_add_pad (GST_ELEMENT (ffmpegdec), ffmpegdec->srcpad); gst_element_add_pad (GST_ELEMENT (ffmpegdec), ffmpegdec->srcpad);
...@@ -410,7 +411,7 @@ gst_ffmpegdec_chain (GstPad *pad, ...@@ -410,7 +411,7 @@ gst_ffmpegdec_chain (GstPad *pad,
caps = gst_ffmpeg_codectype_to_caps (oclass->in_plugin->type, caps = gst_ffmpeg_codectype_to_caps (oclass->in_plugin->type,
ffmpegdec->context); ffmpegdec->context);
if (caps == NULL || if (caps == NULL ||
gst_pad_try_set_caps (ffmpegdec->srcpad, caps) <= 0) { !gst_pad_set_explicit_caps (ffmpegdec->srcpad, caps)) {
gst_element_error (GST_ELEMENT (ffmpegdec), gst_element_error (GST_ELEMENT (ffmpegdec),
"Failed to link ffmpeg decoder (%s) to next element", "Failed to link ffmpeg decoder (%s) to next element",
oclass->in_plugin->name); oclass->in_plugin->name);
......
...@@ -316,6 +316,7 @@ gst_ffmpegdemux_loop (GstElement *element) ...@@ -316,6 +316,7 @@ gst_ffmpegdemux_loop (GstElement *element)
pad = gst_pad_new_from_template (templ, padname); pad = gst_pad_new_from_template (templ, padname);
g_free (padname); g_free (padname);
gst_pad_use_explicit_caps (pad);
/* FIXME: convert() and query() functions for pad */ /* FIXME: convert() and query() functions for pad */
/* store pad internally */ /* store pad internally */
...@@ -325,12 +326,9 @@ gst_ffmpegdemux_loop (GstElement *element) ...@@ -325,12 +326,9 @@ gst_ffmpegdemux_loop (GstElement *element)
/* get caps that belongs to this stream */ /* get caps that belongs to this stream */
caps = gst_ffmpeg_codecid_to_caps (st->codec.codec_id, caps = gst_ffmpeg_codecid_to_caps (st->codec.codec_id,
&st->codec); &st->codec);
if (gst_pad_try_set_caps (pad, caps) <= 0) { gst_pad_set_explicit_caps (pad, caps);
GST_DEBUG ( /* we continue here, in the next pad-is-usable check,
"Failed to set caps from ffdemuxer on next element"); * we'll return nonetheless */
/* we continue here, in the next pad-is-usable check,
* we'll return nonetheless */
}
} }
/* shortcut to pad belonging to this stream */ /* shortcut to pad belonging to this stream */
......
Supports Markdown
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