mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
tests: Update for caps/pad template related API changes
This commit is contained in:
parent
5f2cd2b0a3
commit
eee515e5ad
4 changed files with 21 additions and 14 deletions
|
@ -554,6 +554,7 @@ GST_START_TEST (test_output_selector_getcaps_active);
|
|||
|
||||
g_assert (gst_caps_is_equal (caps, expected));
|
||||
gst_caps_unref (caps);
|
||||
gst_caps_unref (expected);
|
||||
gst_object_unref (pad);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ GST_START_TEST (test_valve_basic)
|
|||
GstElement *valve;
|
||||
GstPad *sink;
|
||||
GstPad *src;
|
||||
GstCaps *caps;
|
||||
GstCaps *caps, *templ_caps;
|
||||
|
||||
valve = gst_check_setup_element ("valve");
|
||||
|
||||
|
@ -71,8 +71,9 @@ GST_START_TEST (test_valve_basic)
|
|||
fail_unless (gst_pad_push (src, gst_buffer_new ()) == GST_FLOW_OK);
|
||||
fail_unless (g_list_length (buffers) == 2);
|
||||
caps = gst_pad_get_caps (src, NULL);
|
||||
fail_unless (caps && gst_caps_is_equal (caps,
|
||||
gst_pad_get_pad_template_caps (src)));
|
||||
templ_caps = gst_pad_get_pad_template_caps (src);
|
||||
fail_unless (caps && gst_caps_is_equal (caps, templ_caps));
|
||||
gst_caps_unref (templ_caps);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
gst_check_drop_buffers ();
|
||||
|
@ -85,8 +86,9 @@ GST_START_TEST (test_valve_basic)
|
|||
fail_unless (gst_pad_push (src, gst_buffer_new ()) == GST_FLOW_OK);
|
||||
fail_unless (buffers == NULL);
|
||||
caps = gst_pad_get_caps (src, NULL);
|
||||
fail_unless (caps && gst_caps_is_equal (caps,
|
||||
gst_pad_get_pad_template_caps (src)));
|
||||
templ_caps = gst_pad_get_pad_template_caps (src);
|
||||
fail_unless (caps && gst_caps_is_equal (caps, templ_caps));
|
||||
gst_caps_unref (templ_caps);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
gst_pad_set_active (src, FALSE);
|
||||
|
|
|
@ -576,16 +576,14 @@ GST_START_TEST (test_ghost_pads_new_from_template)
|
|||
GstPad *sinkpad, *ghostpad;
|
||||
GstPadTemplate *padtempl, *ghosttempl;
|
||||
GstCaps *padcaps, *ghostcaps, *newcaps;
|
||||
GstCaps *copypadcaps;
|
||||
|
||||
padcaps = gst_caps_from_string ("some/caps");
|
||||
fail_unless (padcaps != NULL);
|
||||
ghostcaps = gst_caps_from_string ("some/caps;some/other-caps");
|
||||
fail_unless (ghostcaps != NULL);
|
||||
|
||||
copypadcaps = gst_caps_copy (padcaps);
|
||||
padtempl = gst_pad_template_new ("padtempl", GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS, copypadcaps);
|
||||
GST_PAD_ALWAYS, padcaps);
|
||||
fail_unless (padtempl != NULL);
|
||||
ghosttempl = gst_pad_template_new ("ghosttempl", GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS, ghostcaps);
|
||||
|
@ -605,6 +603,7 @@ GST_START_TEST (test_ghost_pads_new_from_template)
|
|||
fail_unless (gst_caps_is_equal (newcaps, padcaps));
|
||||
gst_caps_unref (newcaps);
|
||||
gst_caps_unref (padcaps);
|
||||
gst_caps_unref (ghostcaps);
|
||||
|
||||
gst_object_unref (sinkpad);
|
||||
gst_object_unref (ghostpad);
|
||||
|
@ -620,21 +619,17 @@ GST_START_TEST (test_ghost_pads_new_no_target_from_template)
|
|||
GstPad *sinkpad, *ghostpad;
|
||||
GstPadTemplate *padtempl, *ghosttempl;
|
||||
GstCaps *padcaps, *ghostcaps, *newcaps;
|
||||
GstCaps *copypadcaps, *copyghostcaps;
|
||||
|
||||
padcaps = gst_caps_from_string ("some/caps");
|
||||
fail_unless (padcaps != NULL);
|
||||
ghostcaps = gst_caps_from_string ("some/caps;some/other-caps");
|
||||
fail_unless (ghostcaps != NULL);
|
||||
|
||||
copypadcaps = gst_caps_copy (padcaps);
|
||||
copyghostcaps = gst_caps_copy (ghostcaps);
|
||||
|
||||
padtempl = gst_pad_template_new ("padtempl", GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS, copypadcaps);
|
||||
GST_PAD_ALWAYS, padcaps);
|
||||
fail_unless (padtempl != NULL);
|
||||
ghosttempl = gst_pad_template_new ("ghosttempl", GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS, copyghostcaps);
|
||||
GST_PAD_ALWAYS, ghostcaps);
|
||||
|
||||
sinkpad = gst_pad_new_from_template (padtempl, "sinkpad");
|
||||
fail_unless (sinkpad != NULL);
|
||||
|
@ -688,10 +683,12 @@ GST_START_TEST (test_ghost_pads_forward_setcaps)
|
|||
templ_caps = gst_caps_from_string ("meh; muh");
|
||||
src_template = gst_pad_template_new ("src", GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS, templ_caps);
|
||||
gst_caps_unref (templ_caps);
|
||||
|
||||
templ_caps = gst_caps_from_string ("muh; meh");
|
||||
sink_template = gst_pad_template_new ("sink", GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS, templ_caps);
|
||||
gst_caps_unref (templ_caps);
|
||||
|
||||
src = gst_pad_new_from_template (src_template, "src");
|
||||
sink = gst_pad_new_from_template (sink_template, "sink");
|
||||
|
@ -828,11 +825,13 @@ GST_START_TEST (test_ghost_pads_sink_link_unlink)
|
|||
fail_unless (padcaps != NULL);
|
||||
srctempl = gst_pad_template_new ("srctempl", GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS, padcaps);
|
||||
gst_caps_unref (padcaps);
|
||||
|
||||
padcaps = gst_caps_from_string ("some/caps");
|
||||
fail_unless (padcaps != NULL);
|
||||
sinktempl = gst_pad_template_new ("sinktempl", GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS, padcaps);
|
||||
gst_caps_unref (padcaps);
|
||||
|
||||
srcpad = gst_pad_new_from_template (srctempl, "src");
|
||||
fail_unless (srcpad != NULL);
|
||||
|
@ -900,11 +899,13 @@ GST_START_TEST (test_ghost_pads_src_link_unlink)
|
|||
fail_unless (padcaps != NULL);
|
||||
srctempl = gst_pad_template_new ("srctempl", GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS, padcaps);
|
||||
gst_caps_unref (padcaps);
|
||||
|
||||
padcaps = gst_caps_from_string ("some/caps");
|
||||
fail_unless (padcaps != NULL);
|
||||
sinktempl = gst_pad_template_new ("sinktempl", GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS, padcaps);
|
||||
gst_caps_unref (padcaps);
|
||||
|
||||
srcpad = gst_pad_new_from_template (srctempl, "src");
|
||||
fail_unless (srcpad != NULL);
|
||||
|
|
|
@ -52,6 +52,7 @@ GST_START_TEST (test_link)
|
|||
srct = gst_pad_get_pad_template (src);
|
||||
fail_unless (srct == NULL);
|
||||
ASSERT_OBJECT_REFCOUNT (src, "source pad", 1);
|
||||
gst_object_unref (srct);
|
||||
|
||||
/* clean up */
|
||||
ASSERT_OBJECT_REFCOUNT (src, "source pad", 1);
|
||||
|
@ -571,6 +572,8 @@ GST_START_TEST (test_push_negotiation)
|
|||
GST_PAD_ALWAYS, srccaps);
|
||||
sink_template = gst_pad_template_new ("sink", GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS, sinkcaps);
|
||||
gst_caps_unref (srccaps);
|
||||
gst_caps_unref (sinkcaps);
|
||||
|
||||
sink = gst_pad_new_from_template (sink_template, "sink");
|
||||
fail_if (sink == NULL);
|
||||
|
|
Loading…
Reference in a new issue