mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
gst/gstpad.*: add gst_pad_new_from_static_template functions
Original commit message from CVS: * gst/gstpad.c: (gst_pad_new_from_static_template): * gst/gstpad.h: add gst_pad_new_from_static_template functions * gst/check/gstcheck.c: (gst_check_setup_src_pad), (gst_check_setup_sink_pad): * gst/elements/gsttee.c: (gst_tee_init): and use them
This commit is contained in:
parent
c96f128c88
commit
533a6eacb0
7 changed files with 46 additions and 23 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,7 +1,17 @@
|
|||
2005-11-16 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* gst/gstpad.c: (gst_pad_new_from_static_template):
|
||||
* gst/gstpad.h:
|
||||
add gst_pad_new_from_static_template functions
|
||||
* gst/check/gstcheck.c: (gst_check_setup_src_pad),
|
||||
(gst_check_setup_sink_pad):
|
||||
* gst/elements/gsttee.c: (gst_tee_init):
|
||||
and use them
|
||||
|
||||
2005-11-16 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst/gstpad.c: (gst_pad_pause_task):
|
||||
Removed warning, it's not realy an error either.
|
||||
Removed warning, it's not really an error either.
|
||||
|
||||
2005-11-16 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
|
|
|
@ -152,15 +152,13 @@ gst_check_teardown_element (GstElement * element)
|
|||
*/
|
||||
GstPad *
|
||||
gst_check_setup_src_pad (GstElement * element,
|
||||
GstStaticPadTemplate * srctemplate, GstCaps * caps)
|
||||
GstStaticPadTemplate * template, GstCaps * caps)
|
||||
{
|
||||
GstPad *srcpad, *sinkpad;
|
||||
|
||||
GST_DEBUG_OBJECT (element, "setting up sending pad");
|
||||
/* sending pad */
|
||||
srcpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (srctemplate),
|
||||
"src");
|
||||
srcpad = gst_pad_new_from_static_template (template, "src");
|
||||
fail_if (srcpad == NULL, "Could not create a srcpad");
|
||||
ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 1);
|
||||
|
||||
|
@ -211,9 +209,7 @@ gst_check_setup_sink_pad (GstElement * element, GstStaticPadTemplate * template,
|
|||
|
||||
GST_DEBUG_OBJECT (element, "setting up receiving pad");
|
||||
/* receiving pad */
|
||||
sinkpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (template),
|
||||
"sink");
|
||||
sinkpad = gst_pad_new_from_static_template (template, "sink");
|
||||
fail_if (sinkpad == NULL, "Could not create a sinkpad");
|
||||
|
||||
srcpad = gst_element_get_pad (element, "src");
|
||||
|
|
|
@ -140,10 +140,7 @@ gst_tee_class_init (GstTeeClass * klass)
|
|||
static void
|
||||
gst_tee_init (GstTee * tee, GstTeeClass * g_class)
|
||||
{
|
||||
GstPadTemplate *templ = gst_static_pad_template_get (&sinktemplate);
|
||||
|
||||
tee->sinkpad = gst_pad_new_from_template (templ, "sink");
|
||||
gst_object_unref (templ);
|
||||
tee->sinkpad = gst_pad_new_from_static_template (&sinktemplate, "sink");
|
||||
gst_pad_set_setcaps_function (tee->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_pad_proxy_setcaps));
|
||||
gst_pad_set_getcaps_function (tee->sinkpad,
|
||||
|
|
25
gst/gstpad.c
25
gst/gstpad.c
|
@ -491,6 +491,31 @@ gst_pad_new_from_template (GstPadTemplate * templ, const gchar * name)
|
|||
"name", name, "direction", templ->direction, "template", templ, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_pad_new_from_static_template:
|
||||
* @templ: the #GstStaticPadTemplate to use
|
||||
* @name: the name of the element
|
||||
*
|
||||
* Creates a new pad with the given name from the given static template.
|
||||
* If name is NULL, a guaranteed unique name (across all pads)
|
||||
* will be assigned.
|
||||
* This function makes a copy of the name so you can safely free the name.
|
||||
*
|
||||
* Returns: a new #GstPad, or NULL in case of an error.
|
||||
*/
|
||||
GstPad *
|
||||
gst_pad_new_from_static_template (GstStaticPadTemplate * templ,
|
||||
const gchar * name)
|
||||
{
|
||||
GstPad *pad;
|
||||
GstPadTemplate *template;
|
||||
|
||||
template = gst_static_pad_template_get (templ);
|
||||
pad = gst_pad_new_from_template (template, name);
|
||||
gst_object_unref (template);
|
||||
return pad;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_pad_get_direction:
|
||||
* @pad: a #GstPad to get the direction of.
|
||||
|
|
|
@ -498,6 +498,8 @@ GType gst_pad_get_type (void);
|
|||
/* creating pads */
|
||||
GstPad* gst_pad_new (const gchar *name, GstPadDirection direction);
|
||||
GstPad* gst_pad_new_from_template (GstPadTemplate *templ, const gchar *name);
|
||||
GstPad* gst_pad_new_from_static_template (GstStaticPadTemplate *templ, const gchar *name);
|
||||
|
||||
|
||||
/**
|
||||
* gst_pad_get_name:
|
||||
|
|
|
@ -152,15 +152,13 @@ gst_check_teardown_element (GstElement * element)
|
|||
*/
|
||||
GstPad *
|
||||
gst_check_setup_src_pad (GstElement * element,
|
||||
GstStaticPadTemplate * srctemplate, GstCaps * caps)
|
||||
GstStaticPadTemplate * template, GstCaps * caps)
|
||||
{
|
||||
GstPad *srcpad, *sinkpad;
|
||||
|
||||
GST_DEBUG_OBJECT (element, "setting up sending pad");
|
||||
/* sending pad */
|
||||
srcpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (srctemplate),
|
||||
"src");
|
||||
srcpad = gst_pad_new_from_static_template (template, "src");
|
||||
fail_if (srcpad == NULL, "Could not create a srcpad");
|
||||
ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 1);
|
||||
|
||||
|
@ -211,9 +209,7 @@ gst_check_setup_sink_pad (GstElement * element, GstStaticPadTemplate * template,
|
|||
|
||||
GST_DEBUG_OBJECT (element, "setting up receiving pad");
|
||||
/* receiving pad */
|
||||
sinkpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (template),
|
||||
"sink");
|
||||
sinkpad = gst_pad_new_from_static_template (template, "sink");
|
||||
fail_if (sinkpad == NULL, "Could not create a sinkpad");
|
||||
|
||||
srcpad = gst_element_get_pad (element, "src");
|
||||
|
|
|
@ -140,10 +140,7 @@ gst_tee_class_init (GstTeeClass * klass)
|
|||
static void
|
||||
gst_tee_init (GstTee * tee, GstTeeClass * g_class)
|
||||
{
|
||||
GstPadTemplate *templ = gst_static_pad_template_get (&sinktemplate);
|
||||
|
||||
tee->sinkpad = gst_pad_new_from_template (templ, "sink");
|
||||
gst_object_unref (templ);
|
||||
tee->sinkpad = gst_pad_new_from_static_template (&sinktemplate, "sink");
|
||||
gst_pad_set_setcaps_function (tee->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_pad_proxy_setcaps));
|
||||
gst_pad_set_getcaps_function (tee->sinkpad,
|
||||
|
|
Loading…
Reference in a new issue