mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
test: rtpbin_buffer_list: check if the chain_list function has been called
Make the test more useful to verify that the chain list function has actually been called.
This commit is contained in:
parent
623d3b930e
commit
6ab13c19b6
1 changed files with 14 additions and 0 deletions
|
@ -223,12 +223,23 @@ check_packet (GstBufferList * list, guint index)
|
||||||
check_payload (buffer, index);
|
check_payload (buffer, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Used to verify that the chain_list function is actually implemented by the
|
||||||
|
* element and called when executing the pipeline. This is needed because pads
|
||||||
|
* always have a default chain_list handler which handle buffers in a buffer
|
||||||
|
* list individually, and pushing a list to a pad can succeed even if no
|
||||||
|
* chain_list handler has been set.
|
||||||
|
*/
|
||||||
|
static gboolean chain_list_func_called;
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
sink_chain_list (GstPad * pad, GstObject * parent, GstBufferList * list)
|
sink_chain_list (GstPad * pad, GstObject * parent, GstBufferList * list)
|
||||||
{
|
{
|
||||||
GstCaps *current_caps;
|
GstCaps *current_caps;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
|
||||||
|
chain_list_func_called = TRUE;
|
||||||
|
|
||||||
current_caps = gst_pad_get_current_caps (pad);
|
current_caps = gst_pad_get_current_caps (pad);
|
||||||
fail_unless (current_caps != NULL);
|
fail_unless (current_caps != NULL);
|
||||||
|
|
||||||
|
@ -291,7 +302,10 @@ GST_START_TEST (test_bufferlist)
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
gst_element_set_state (rtpbin, GST_STATE_PLAYING);
|
gst_element_set_state (rtpbin, GST_STATE_PLAYING);
|
||||||
|
|
||||||
|
chain_list_func_called = FALSE;
|
||||||
fail_unless (gst_pad_push_list (srcpad, list) == GST_FLOW_OK);
|
fail_unless (gst_pad_push_list (srcpad, list) == GST_FLOW_OK);
|
||||||
|
fail_if (chain_list_func_called == FALSE);
|
||||||
|
|
||||||
gst_pad_set_active (sinkpad, FALSE);
|
gst_pad_set_active (sinkpad, FALSE);
|
||||||
gst_pad_set_active (srcpad, FALSE);
|
gst_pad_set_active (srcpad, FALSE);
|
||||||
|
|
Loading…
Reference in a new issue