mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 11:40:38 +00:00
pad: make fixate caps behave like other functions
Install a default fixate caps function on pads like all the other pad functions.
This commit is contained in:
parent
28cf90b868
commit
d22192474a
1 changed files with 5 additions and 5 deletions
10
gst/gstpad.c
10
gst/gstpad.c
|
@ -142,6 +142,7 @@ static GstCaps *gst_pad_get_caps_unlocked (GstPad * pad, GstCaps * filter);
|
||||||
static void gst_pad_set_pad_template (GstPad * pad, GstPadTemplate * templ);
|
static void gst_pad_set_pad_template (GstPad * pad, GstPadTemplate * templ);
|
||||||
static gboolean gst_pad_activate_default (GstPad * pad);
|
static gboolean gst_pad_activate_default (GstPad * pad);
|
||||||
static gboolean gst_pad_acceptcaps_default (GstPad * pad, GstCaps * caps);
|
static gboolean gst_pad_acceptcaps_default (GstPad * pad, GstCaps * caps);
|
||||||
|
static void gst_pad_fixate_caps_default (GstPad * pad, GstCaps * caps);
|
||||||
static GstFlowReturn gst_pad_chain_list_default (GstPad * pad,
|
static GstFlowReturn gst_pad_chain_list_default (GstPad * pad,
|
||||||
GstBufferList * list);
|
GstBufferList * list);
|
||||||
|
|
||||||
|
@ -305,6 +306,7 @@ gst_pad_class_init (GstPadClass * klass)
|
||||||
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_iterate_internal_links_default);
|
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_iterate_internal_links_default);
|
||||||
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_acceptcaps_default);
|
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_acceptcaps_default);
|
||||||
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_chain_list_default);
|
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_chain_list_default);
|
||||||
|
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_fixate_caps_default);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -320,6 +322,7 @@ gst_pad_init (GstPad * pad)
|
||||||
GST_PAD_QUERYFUNC (pad) = gst_pad_query_default;
|
GST_PAD_QUERYFUNC (pad) = gst_pad_query_default;
|
||||||
GST_PAD_ITERINTLINKFUNC (pad) = gst_pad_iterate_internal_links_default;
|
GST_PAD_ITERINTLINKFUNC (pad) = gst_pad_iterate_internal_links_default;
|
||||||
GST_PAD_ACCEPTCAPSFUNC (pad) = gst_pad_acceptcaps_default;
|
GST_PAD_ACCEPTCAPSFUNC (pad) = gst_pad_acceptcaps_default;
|
||||||
|
GST_PAD_FIXATECAPSFUNC (pad) = gst_pad_fixate_caps_default;
|
||||||
GST_PAD_CHAINLISTFUNC (pad) = gst_pad_chain_list_default;
|
GST_PAD_CHAINLISTFUNC (pad) = gst_pad_chain_list_default;
|
||||||
|
|
||||||
GST_PAD_SET_FLUSHING (pad);
|
GST_PAD_SET_FLUSHING (pad);
|
||||||
|
@ -2489,7 +2492,7 @@ no_peer:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_pad_default_fixate (GstPad * pad, GstCaps * caps)
|
gst_pad_fixate_caps_default (GstPad * pad, GstCaps * caps)
|
||||||
{
|
{
|
||||||
/* default fixation */
|
/* default fixation */
|
||||||
gst_caps_fixate (caps);
|
gst_caps_fixate (caps);
|
||||||
|
@ -2518,11 +2521,8 @@ gst_pad_fixate_caps (GstPad * pad, GstCaps * caps)
|
||||||
|
|
||||||
g_return_if_fail (gst_caps_is_writable (caps));
|
g_return_if_fail (gst_caps_is_writable (caps));
|
||||||
|
|
||||||
fixatefunc = GST_PAD_FIXATECAPSFUNC (pad);
|
if (G_LIKELY ((fixatefunc = GST_PAD_FIXATECAPSFUNC (pad))))
|
||||||
if (fixatefunc) {
|
|
||||||
fixatefunc (pad, caps);
|
fixatefunc (pad, caps);
|
||||||
}
|
|
||||||
gst_pad_default_fixate (pad, caps);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Default accept caps implementation just checks against
|
/* Default accept caps implementation just checks against
|
||||||
|
|
Loading…
Reference in a new issue