mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
check: Use consistencycheck on basesrc
This commit is contained in:
parent
617eba488a
commit
0efc42aac7
1 changed files with 11 additions and 0 deletions
|
@ -25,6 +25,7 @@
|
||||||
#endif
|
#endif
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/check/gstcheck.h>
|
#include <gst/check/gstcheck.h>
|
||||||
|
#include <gst/check/gstconsistencychecker.h>
|
||||||
#include <gst/base/gstbasesrc.h>
|
#include <gst/base/gstbasesrc.h>
|
||||||
|
|
||||||
static GstPadProbeReturn
|
static GstPadProbeReturn
|
||||||
|
@ -54,6 +55,7 @@ GST_START_TEST (basesrc_eos_events_push_live_op)
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GstPad *srcpad;
|
GstPad *srcpad;
|
||||||
guint probe, num_eos = 0;
|
guint probe, num_eos = 0;
|
||||||
|
GstStreamConsistency *consistency;
|
||||||
|
|
||||||
pipe = gst_pipeline_new ("pipeline");
|
pipe = gst_pipeline_new ("pipeline");
|
||||||
sink = gst_element_factory_make ("fakesink", "sink");
|
sink = gst_element_factory_make ("fakesink", "sink");
|
||||||
|
@ -78,6 +80,8 @@ GST_START_TEST (basesrc_eos_events_push_live_op)
|
||||||
srcpad = gst_element_get_static_pad (src, "src");
|
srcpad = gst_element_get_static_pad (src, "src");
|
||||||
fail_unless (srcpad != NULL);
|
fail_unless (srcpad != NULL);
|
||||||
|
|
||||||
|
consistency = gst_consistency_checker_new (srcpad);
|
||||||
|
|
||||||
probe = gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT_BOTH,
|
probe = gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT_BOTH,
|
||||||
(GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
|
(GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
|
||||||
|
|
||||||
|
@ -108,6 +112,8 @@ GST_START_TEST (basesrc_eos_events_push_live_op)
|
||||||
/* make sure source hasn't sent a second one when going PAUSED => READY */
|
/* make sure source hasn't sent a second one when going PAUSED => READY */
|
||||||
fail_unless (num_eos == 1);
|
fail_unless (num_eos == 1);
|
||||||
|
|
||||||
|
gst_consistency_checker_free (consistency);
|
||||||
|
|
||||||
gst_pad_remove_probe (srcpad, probe);
|
gst_pad_remove_probe (srcpad, probe);
|
||||||
gst_object_unref (srcpad);
|
gst_object_unref (srcpad);
|
||||||
gst_message_unref (msg);
|
gst_message_unref (msg);
|
||||||
|
@ -131,6 +137,7 @@ GST_START_TEST (basesrc_eos_events_push)
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GstPad *srcpad;
|
GstPad *srcpad;
|
||||||
guint probe, num_eos = 0;
|
guint probe, num_eos = 0;
|
||||||
|
GstStreamConsistency *consistency;
|
||||||
|
|
||||||
pipe = gst_pipeline_new ("pipeline");
|
pipe = gst_pipeline_new ("pipeline");
|
||||||
sink = gst_element_factory_make ("fakesink", "sink");
|
sink = gst_element_factory_make ("fakesink", "sink");
|
||||||
|
@ -156,6 +163,8 @@ GST_START_TEST (basesrc_eos_events_push)
|
||||||
srcpad = gst_element_get_static_pad (src, "src");
|
srcpad = gst_element_get_static_pad (src, "src");
|
||||||
fail_unless (srcpad != NULL);
|
fail_unless (srcpad != NULL);
|
||||||
|
|
||||||
|
consistency = gst_consistency_checker_new (srcpad);
|
||||||
|
|
||||||
probe = gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT_BOTH,
|
probe = gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT_BOTH,
|
||||||
(GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
|
(GstPadProbeCallback) eos_event_counter, &num_eos, NULL);
|
||||||
|
|
||||||
|
@ -179,6 +188,8 @@ GST_START_TEST (basesrc_eos_events_push)
|
||||||
/* make sure source hasn't sent a second one when going PAUSED => READY */
|
/* make sure source hasn't sent a second one when going PAUSED => READY */
|
||||||
fail_unless (num_eos == 1);
|
fail_unless (num_eos == 1);
|
||||||
|
|
||||||
|
gst_consistency_checker_free (consistency);
|
||||||
|
|
||||||
gst_pad_remove_probe (srcpad, probe);
|
gst_pad_remove_probe (srcpad, probe);
|
||||||
gst_object_unref (srcpad);
|
gst_object_unref (srcpad);
|
||||||
gst_message_unref (msg);
|
gst_message_unref (msg);
|
||||||
|
|
Loading…
Reference in a new issue