mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +00:00
testsuite/: s/gst_pad_new/&_from_template/ prepare deprecation of gst_pad_new
Original commit message from CVS: * testsuite/bytestream/gstbstest.c: (gst_bstest_init): * testsuite/dynparams/dparamstest.c: (gst_dptest_init): * testsuite/refcounting/pad.c: (main): * testsuite/refcounting/thread.c: (create_thread_ghostpads): s/gst_pad_new/&_from_template/ prepare deprecation of gst_pad_new
This commit is contained in:
parent
a290cc1e5c
commit
e1ef5586cd
9 changed files with 181 additions and 94 deletions
|
@ -1,3 +1,12 @@
|
|||
2004-08-17 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
||||
|
||||
* testsuite/bytestream/gstbstest.c: (gst_bstest_init):
|
||||
* testsuite/dynparams/dparamstest.c: (gst_dptest_init):
|
||||
* testsuite/refcounting/pad.c: (main):
|
||||
* testsuite/refcounting/thread.c: (create_thread_ghostpads):
|
||||
s/gst_pad_new/&_from_template/
|
||||
prepare deprecation of gst_pad_new
|
||||
|
||||
2004-08-17 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
patch by: Luca Ognibene <skaboy81@virgilio.it>
|
||||
|
|
|
@ -181,14 +181,28 @@ gst_bstest_getcaps (GstPad * pad)
|
|||
return gst_pad_get_allowed_caps (otherpad);
|
||||
}
|
||||
|
||||
GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS_ANY);
|
||||
|
||||
GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS_ANY);
|
||||
|
||||
static void
|
||||
gst_bstest_init (GstBsTest * bstest)
|
||||
{
|
||||
bstest->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
|
||||
bstest->sinkpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
|
||||
"sink");
|
||||
gst_element_add_pad (GST_ELEMENT (bstest), bstest->sinkpad);
|
||||
gst_pad_set_getcaps_function (bstest->sinkpad, gst_bstest_getcaps);
|
||||
|
||||
bstest->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
||||
bstest->srcpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
|
||||
"src");
|
||||
gst_element_add_pad (GST_ELEMENT (bstest), bstest->srcpad);
|
||||
gst_pad_set_getcaps_function (bstest->srcpad, gst_bstest_getcaps);
|
||||
|
||||
|
|
|
@ -64,6 +64,16 @@ enum
|
|||
ARG_0,
|
||||
};
|
||||
|
||||
GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS_ANY);
|
||||
|
||||
GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS_ANY);
|
||||
|
||||
|
||||
static void gst_dptest_base_init (gpointer g_class);
|
||||
static void gst_dptest_class_init (GstDpTestClass * klass);
|
||||
|
@ -134,11 +144,15 @@ static void
|
|||
gst_dptest_init (GstDpTest * dptest)
|
||||
{
|
||||
|
||||
dptest->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
|
||||
dptest->sinkpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
|
||||
"sink");
|
||||
gst_element_add_pad (GST_ELEMENT (dptest), dptest->sinkpad);
|
||||
gst_pad_set_chain_function (dptest->sinkpad, gst_dptest_chain);
|
||||
|
||||
dptest->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
||||
dptest->srcpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
|
||||
"src");
|
||||
gst_element_add_pad (GST_ELEMENT (dptest), dptest->srcpad);
|
||||
|
||||
dptest->dpman = gst_dpman_new ("dptest_dpman", GST_ELEMENT (dptest));
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
#include <stdlib.h>
|
||||
#include "mem.h"
|
||||
|
||||
GstStaticPadTemplate templ = GST_STATIC_PAD_TEMPLATE ("default",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS_ANY);
|
||||
|
||||
int
|
||||
main (int argc, gchar * argv[])
|
||||
{
|
||||
|
@ -29,18 +34,24 @@ main (int argc, gchar * argv[])
|
|||
usage1 = vmsize ();
|
||||
|
||||
g_print ("DEBUG: creating new pad with name padname\n");
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
g_print ("DEBUG: unreffing new pad with name padname\n");
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
g_print ("create/unref new pad %ld\n", vmsize () - usage1);
|
||||
|
||||
for (i = 0; i < iters; i++) {
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
}
|
||||
g_print ("create/unref %d pads %ld\n", iters, vmsize () - usage1);
|
||||
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
g_assert (GST_OBJECT_FLOATING (pad));
|
||||
gst_object_ref (GST_OBJECT (pad));
|
||||
gst_object_sink (GST_OBJECT (pad));
|
||||
|
@ -49,81 +60,67 @@ main (int argc, gchar * argv[])
|
|||
g_print ("create/ref/sink/unref new pad %ld\n", vmsize () - usage1);
|
||||
|
||||
for (i = 0; i < iters; i++) {
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
gst_object_ref (GST_OBJECT (pad));
|
||||
gst_object_sink (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
}
|
||||
g_print ("create/ref/sink/unref %d pads %ld\n", iters, vmsize () - usage1);
|
||||
|
||||
#if 0
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
g_assert (!GST_OBJECT_DESTROYED (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
g_assert (GST_OBJECT_DESTROYED (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
g_print ("create/destroy/unref pad %ld\n", vmsize () - usage1);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
for (i = 0; i < iters; i++) {
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
}
|
||||
g_print ("create/destroy/unref %d pads %ld\n", iters, vmsize () - usage1);
|
||||
#endif
|
||||
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
gst_object_ref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
g_print ("create/ref/unref/unref pad %ld\n", vmsize () - usage1);
|
||||
|
||||
for (i = 0; i < iters; i++) {
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
gst_object_ref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
}
|
||||
g_print ("create/ref/unref/unref %d pads %ld\n", iters, vmsize () - usage1);
|
||||
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
gst_object_ref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
#if 0
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
#endif
|
||||
g_print ("create/ref/destroy/unref/unref pad %ld\n", vmsize () - usage1);
|
||||
g_print ("create/ref/unref/unref pad %ld\n", vmsize () - usage1);
|
||||
|
||||
#if 0
|
||||
for (i = 0; i < iters; i++) {
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
gst_object_ref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
//gst_object_unref (GST_OBJECT (pad));
|
||||
}
|
||||
g_print ("create/ref/destroy/unref/unref %d pads %ld\n", iters,
|
||||
vmsize () - usage1);
|
||||
#endif
|
||||
g_print ("create/ref/unref/unref %d pads %ld\n", iters, vmsize () - usage1);
|
||||
|
||||
#if 0
|
||||
for (i = 0; i < iters; i++) {
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
gst_object_ref (GST_OBJECT (pad));
|
||||
gst_pad_set_name (pad, "testing123");
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
gst_pad_set_name (pad, "testing123");
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
}
|
||||
g_print ("create/ref/destroy/unref/unref %d pads %ld with name\n", iters,
|
||||
g_print ("create/ref/unref/unref %d pads %ld with name\n", iters,
|
||||
vmsize () - usage1);
|
||||
#endif
|
||||
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
for (i = 0; i < iters; i++) {
|
||||
gst_pad_set_name (pad, "testing");
|
||||
}
|
||||
|
|
|
@ -4,6 +4,16 @@
|
|||
#include <stdlib.h>
|
||||
#include "mem.h"
|
||||
|
||||
GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS_ANY);
|
||||
|
||||
GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS_ANY);
|
||||
|
||||
static GstElement *
|
||||
create_thread (void)
|
||||
{
|
||||
|
@ -30,11 +40,15 @@ create_thread_ghostpads (void)
|
|||
thread = gst_thread_new ("testthread");
|
||||
element1 = gst_element_new ();
|
||||
gst_element_set_name (element1, "test1");
|
||||
gst_element_add_pad (element1, gst_pad_new ("src1", GST_PAD_SRC));
|
||||
gst_element_add_pad (element1,
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
|
||||
"src1"));
|
||||
gst_bin_add (GST_BIN (thread), element1);
|
||||
element2 = gst_element_new ();
|
||||
gst_element_set_name (element2, "test2");
|
||||
gst_element_add_pad (element2, gst_pad_new ("sink1", GST_PAD_SINK));
|
||||
gst_element_add_pad (element1,
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
|
||||
"sink1"));
|
||||
gst_bin_add (GST_BIN (thread), element2);
|
||||
gst_element_link (element1, "src1", element2, "sink1");
|
||||
gst_element_add_ghost_pad (thread, gst_element_get_pad (element2, "sink1"),
|
||||
|
|
|
@ -181,14 +181,28 @@ gst_bstest_getcaps (GstPad * pad)
|
|||
return gst_pad_get_allowed_caps (otherpad);
|
||||
}
|
||||
|
||||
GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS_ANY);
|
||||
|
||||
GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS_ANY);
|
||||
|
||||
static void
|
||||
gst_bstest_init (GstBsTest * bstest)
|
||||
{
|
||||
bstest->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
|
||||
bstest->sinkpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
|
||||
"sink");
|
||||
gst_element_add_pad (GST_ELEMENT (bstest), bstest->sinkpad);
|
||||
gst_pad_set_getcaps_function (bstest->sinkpad, gst_bstest_getcaps);
|
||||
|
||||
bstest->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
||||
bstest->srcpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
|
||||
"src");
|
||||
gst_element_add_pad (GST_ELEMENT (bstest), bstest->srcpad);
|
||||
gst_pad_set_getcaps_function (bstest->srcpad, gst_bstest_getcaps);
|
||||
|
||||
|
|
|
@ -64,6 +64,16 @@ enum
|
|||
ARG_0,
|
||||
};
|
||||
|
||||
GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS_ANY);
|
||||
|
||||
GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS_ANY);
|
||||
|
||||
|
||||
static void gst_dptest_base_init (gpointer g_class);
|
||||
static void gst_dptest_class_init (GstDpTestClass * klass);
|
||||
|
@ -134,11 +144,15 @@ static void
|
|||
gst_dptest_init (GstDpTest * dptest)
|
||||
{
|
||||
|
||||
dptest->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
|
||||
dptest->sinkpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
|
||||
"sink");
|
||||
gst_element_add_pad (GST_ELEMENT (dptest), dptest->sinkpad);
|
||||
gst_pad_set_chain_function (dptest->sinkpad, gst_dptest_chain);
|
||||
|
||||
dptest->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
||||
dptest->srcpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
|
||||
"src");
|
||||
gst_element_add_pad (GST_ELEMENT (dptest), dptest->srcpad);
|
||||
|
||||
dptest->dpman = gst_dpman_new ("dptest_dpman", GST_ELEMENT (dptest));
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
#include <stdlib.h>
|
||||
#include "mem.h"
|
||||
|
||||
GstStaticPadTemplate templ = GST_STATIC_PAD_TEMPLATE ("default",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS_ANY);
|
||||
|
||||
int
|
||||
main (int argc, gchar * argv[])
|
||||
{
|
||||
|
@ -29,18 +34,24 @@ main (int argc, gchar * argv[])
|
|||
usage1 = vmsize ();
|
||||
|
||||
g_print ("DEBUG: creating new pad with name padname\n");
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
g_print ("DEBUG: unreffing new pad with name padname\n");
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
g_print ("create/unref new pad %ld\n", vmsize () - usage1);
|
||||
|
||||
for (i = 0; i < iters; i++) {
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
}
|
||||
g_print ("create/unref %d pads %ld\n", iters, vmsize () - usage1);
|
||||
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
g_assert (GST_OBJECT_FLOATING (pad));
|
||||
gst_object_ref (GST_OBJECT (pad));
|
||||
gst_object_sink (GST_OBJECT (pad));
|
||||
|
@ -49,81 +60,67 @@ main (int argc, gchar * argv[])
|
|||
g_print ("create/ref/sink/unref new pad %ld\n", vmsize () - usage1);
|
||||
|
||||
for (i = 0; i < iters; i++) {
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
gst_object_ref (GST_OBJECT (pad));
|
||||
gst_object_sink (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
}
|
||||
g_print ("create/ref/sink/unref %d pads %ld\n", iters, vmsize () - usage1);
|
||||
|
||||
#if 0
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
g_assert (!GST_OBJECT_DESTROYED (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
g_assert (GST_OBJECT_DESTROYED (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
g_print ("create/destroy/unref pad %ld\n", vmsize () - usage1);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
for (i = 0; i < iters; i++) {
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
}
|
||||
g_print ("create/destroy/unref %d pads %ld\n", iters, vmsize () - usage1);
|
||||
#endif
|
||||
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
gst_object_ref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
g_print ("create/ref/unref/unref pad %ld\n", vmsize () - usage1);
|
||||
|
||||
for (i = 0; i < iters; i++) {
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
gst_object_ref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
}
|
||||
g_print ("create/ref/unref/unref %d pads %ld\n", iters, vmsize () - usage1);
|
||||
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
gst_object_ref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
#if 0
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
#endif
|
||||
g_print ("create/ref/destroy/unref/unref pad %ld\n", vmsize () - usage1);
|
||||
g_print ("create/ref/unref/unref pad %ld\n", vmsize () - usage1);
|
||||
|
||||
#if 0
|
||||
for (i = 0; i < iters; i++) {
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
gst_object_ref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
//gst_object_unref (GST_OBJECT (pad));
|
||||
}
|
||||
g_print ("create/ref/destroy/unref/unref %d pads %ld\n", iters,
|
||||
vmsize () - usage1);
|
||||
#endif
|
||||
g_print ("create/ref/unref/unref %d pads %ld\n", iters, vmsize () - usage1);
|
||||
|
||||
#if 0
|
||||
for (i = 0; i < iters; i++) {
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
gst_object_ref (GST_OBJECT (pad));
|
||||
gst_pad_set_name (pad, "testing123");
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
gst_pad_set_name (pad, "testing123");
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
gst_object_unref (GST_OBJECT (pad));
|
||||
}
|
||||
g_print ("create/ref/destroy/unref/unref %d pads %ld with name\n", iters,
|
||||
g_print ("create/ref/unref/unref %d pads %ld with name\n", iters,
|
||||
vmsize () - usage1);
|
||||
#endif
|
||||
|
||||
pad = gst_pad_new ("padname", GST_PAD_SINK);
|
||||
pad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&templ),
|
||||
"padname");
|
||||
for (i = 0; i < iters; i++) {
|
||||
gst_pad_set_name (pad, "testing");
|
||||
}
|
||||
|
|
|
@ -4,6 +4,16 @@
|
|||
#include <stdlib.h>
|
||||
#include "mem.h"
|
||||
|
||||
GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS_ANY);
|
||||
|
||||
GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS_ANY);
|
||||
|
||||
static GstElement *
|
||||
create_thread (void)
|
||||
{
|
||||
|
@ -30,11 +40,15 @@ create_thread_ghostpads (void)
|
|||
thread = gst_thread_new ("testthread");
|
||||
element1 = gst_element_new ();
|
||||
gst_element_set_name (element1, "test1");
|
||||
gst_element_add_pad (element1, gst_pad_new ("src1", GST_PAD_SRC));
|
||||
gst_element_add_pad (element1,
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
|
||||
"src1"));
|
||||
gst_bin_add (GST_BIN (thread), element1);
|
||||
element2 = gst_element_new ();
|
||||
gst_element_set_name (element2, "test2");
|
||||
gst_element_add_pad (element2, gst_pad_new ("sink1", GST_PAD_SINK));
|
||||
gst_element_add_pad (element1,
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
|
||||
"sink1"));
|
||||
gst_bin_add (GST_BIN (thread), element2);
|
||||
gst_element_link (element1, "src1", element2, "sink1");
|
||||
gst_element_add_ghost_pad (thread, gst_element_get_pad (element2, "sink1"),
|
||||
|
|
Loading…
Reference in a new issue