mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
decodebin2: use new getcaps function to avoid copies
Use the gst_pad_get_caps_refed() to avoid some caps copy functions.
This commit is contained in:
parent
eb92aa282f
commit
89f02fb269
1 changed files with 6 additions and 6 deletions
|
@ -1624,7 +1624,7 @@ connect_element (GstDecodeBin * dbin, GstElement * element,
|
|||
GstPad *pad = GST_PAD_CAST (pads->data);
|
||||
GstCaps *caps;
|
||||
|
||||
caps = gst_pad_get_caps (pad);
|
||||
caps = gst_pad_get_caps_refed (pad);
|
||||
analyze_new_pad (dbin, element, pad, caps, chain);
|
||||
if (caps)
|
||||
gst_caps_unref (caps);
|
||||
|
@ -1728,7 +1728,7 @@ pad_added_cb (GstElement * element, GstPad * pad, GstDecodeChain * chain)
|
|||
|
||||
GST_DEBUG_OBJECT (pad, "pad added, chain:%p", chain);
|
||||
|
||||
caps = gst_pad_get_caps (pad);
|
||||
caps = gst_pad_get_caps_refed (pad);
|
||||
analyze_new_pad (dbin, element, pad, caps, chain);
|
||||
if (caps)
|
||||
gst_caps_unref (caps);
|
||||
|
@ -2215,7 +2215,7 @@ gst_decode_group_free (GstDecodeGroup * group)
|
|||
* and all signals are unconnected.
|
||||
*
|
||||
* No element is set to NULL state and completely
|
||||
* unreffed here.
|
||||
* unrefed here.
|
||||
*
|
||||
* Can be called from streaming threads.
|
||||
*
|
||||
|
@ -2604,8 +2604,8 @@ sort_end_pads (GstDecodePad * da, GstDecodePad * db)
|
|||
GstStructure *sa, *sb;
|
||||
const gchar *namea, *nameb;
|
||||
|
||||
capsa = gst_pad_get_caps (GST_PAD (da));
|
||||
capsb = gst_pad_get_caps (GST_PAD (db));
|
||||
capsa = gst_pad_get_caps_refed (GST_PAD (da));
|
||||
capsb = gst_pad_get_caps_refed (GST_PAD (db));
|
||||
|
||||
sa = gst_caps_get_structure ((const GstCaps *) capsa, 0);
|
||||
sb = gst_caps_get_structure ((const GstCaps *) capsb, 0);
|
||||
|
@ -2746,7 +2746,7 @@ gst_decode_chain_get_topology (GstDecodeChain * chain)
|
|||
/* Caps that resulted in this chain */
|
||||
caps = gst_pad_get_negotiated_caps (chain->pad);
|
||||
if (!caps) {
|
||||
caps = gst_pad_get_caps (chain->pad);
|
||||
caps = gst_pad_get_caps_refed (chain->pad);
|
||||
if (G_UNLIKELY (!gst_caps_is_fixed (caps))) {
|
||||
GST_ERROR_OBJECT (chain->pad,
|
||||
"Couldn't get fixed caps, got %" GST_PTR_FORMAT, caps);
|
||||
|
|
Loading…
Reference in a new issue