tests: more rtpbin checks

This commit is contained in:
Wim Taymans 2009-05-22 15:37:29 +02:00 committed by Tim-Philipp Müller
parent 901b7f3b69
commit 02b34602c4

View file

@ -27,14 +27,22 @@ GST_START_TEST (test_cleanup_send)
GstElement *rtpbin; GstElement *rtpbin;
GstPad *rtp_sink, *rtp_src, *rtcp_src; GstPad *rtp_sink, *rtp_src, *rtcp_src;
GObject *session; GObject *session;
gint count = 2;
rtpbin = gst_element_factory_make ("gstrtpbin", "rtpbin"); rtpbin = gst_element_factory_make ("gstrtpbin", "rtpbin");
while (count--) {
/* request session 0 */ /* request session 0 */
rtp_sink = gst_element_get_request_pad (rtpbin, "send_rtp_sink_0"); rtp_sink = gst_element_get_request_pad (rtpbin, "send_rtp_sink_0");
fail_unless (rtp_sink != NULL); fail_unless (rtp_sink != NULL);
ASSERT_OBJECT_REFCOUNT (rtp_sink, "rtp_sink", 2); ASSERT_OBJECT_REFCOUNT (rtp_sink, "rtp_sink", 2);
/* request again */
rtp_sink = gst_element_get_request_pad (rtpbin, "send_rtp_sink_0");
fail_unless (rtp_sink != NULL);
ASSERT_OBJECT_REFCOUNT (rtp_sink, "rtp_sink", 3);
gst_object_unref (rtp_sink);
/* this static pad should be created automatically now */ /* this static pad should be created automatically now */
rtp_src = gst_element_get_static_pad (rtpbin, "send_rtp_src_0"); rtp_src = gst_element_get_static_pad (rtpbin, "send_rtp_src_0");
fail_unless (rtp_src != NULL); fail_unless (rtp_src != NULL);
@ -50,6 +58,12 @@ GST_START_TEST (test_cleanup_send)
fail_unless (rtcp_src != NULL); fail_unless (rtcp_src != NULL);
ASSERT_OBJECT_REFCOUNT (rtcp_src, "rtcp_src", 2); ASSERT_OBJECT_REFCOUNT (rtcp_src, "rtcp_src", 2);
/* second time */
rtcp_src = gst_element_get_request_pad (rtpbin, "send_rtcp_src_0");
fail_unless (rtcp_src != NULL);
ASSERT_OBJECT_REFCOUNT (rtcp_src, "rtcp_src", 3);
gst_object_unref (rtcp_src);
gst_element_release_request_pad (rtpbin, rtp_sink); gst_element_release_request_pad (rtpbin, rtp_sink);
/* we should only have our refs to the pads now */ /* we should only have our refs to the pads now */
ASSERT_OBJECT_REFCOUNT (rtp_sink, "rtp_sink", 1); ASSERT_OBJECT_REFCOUNT (rtp_sink, "rtp_sink", 1);
@ -79,6 +93,7 @@ GST_START_TEST (test_cleanup_send)
gst_object_unref (rtp_sink); gst_object_unref (rtp_sink);
gst_object_unref (rtp_src); gst_object_unref (rtp_src);
gst_object_unref (rtcp_src); gst_object_unref (rtcp_src);
}
gst_object_unref (rtpbin); gst_object_unref (rtpbin);
} }