mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
tests: more rtpbin checks
This commit is contained in:
parent
901b7f3b69
commit
02b34602c4
1 changed files with 55 additions and 40 deletions
|
@ -27,14 +27,22 @@ GST_START_TEST (test_cleanup_send)
|
|||
GstElement *rtpbin;
|
||||
GstPad *rtp_sink, *rtp_src, *rtcp_src;
|
||||
GObject *session;
|
||||
gint count = 2;
|
||||
|
||||
rtpbin = gst_element_factory_make ("gstrtpbin", "rtpbin");
|
||||
|
||||
while (count--) {
|
||||
/* request session 0 */
|
||||
rtp_sink = gst_element_get_request_pad (rtpbin, "send_rtp_sink_0");
|
||||
fail_unless (rtp_sink != NULL);
|
||||
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 */
|
||||
rtp_src = gst_element_get_static_pad (rtpbin, "send_rtp_src_0");
|
||||
fail_unless (rtp_src != NULL);
|
||||
|
@ -50,6 +58,12 @@ GST_START_TEST (test_cleanup_send)
|
|||
fail_unless (rtcp_src != NULL);
|
||||
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);
|
||||
/* we should only have our refs to the pads now */
|
||||
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_src);
|
||||
gst_object_unref (rtcp_src);
|
||||
}
|
||||
|
||||
gst_object_unref (rtpbin);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue