mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
tests: qtdemux: Add checking exposed segment event
https://bugzilla.gnome.org/show_bug.cgi?id=796480
This commit is contained in:
parent
6b29a4507e
commit
aecc17251d
1 changed files with 29 additions and 6 deletions
|
@ -33,19 +33,42 @@ typedef struct
|
||||||
static GstPadProbeReturn
|
static GstPadProbeReturn
|
||||||
qtdemux_probe (GstPad * pad, GstPadProbeInfo * info, CommonTestData * data)
|
qtdemux_probe (GstPad * pad, GstPadProbeInfo * info, CommonTestData * data)
|
||||||
{
|
{
|
||||||
GstBuffer *buf = GST_PAD_PROBE_INFO_BUFFER (info);
|
if (GST_IS_EVENT (GST_PAD_PROBE_INFO_DATA (info))) {
|
||||||
|
GstEvent *ev = GST_PAD_PROBE_INFO_EVENT (info);
|
||||||
|
|
||||||
fail_unless_equals_int (gst_buffer_get_size (buf), data->expected_size);
|
switch (GST_EVENT_TYPE (ev)) {
|
||||||
fail_unless_equals_uint64 (GST_BUFFER_PTS (buf), data->expected_time);
|
case GST_EVENT_SEGMENT:
|
||||||
gst_buffer_unref (buf);
|
{
|
||||||
return GST_PAD_PROBE_HANDLED;
|
const GstSegment *segment;
|
||||||
|
gst_event_parse_segment (ev, &segment);
|
||||||
|
fail_unless (GST_CLOCK_TIME_IS_VALID (segment->format));
|
||||||
|
fail_unless (GST_CLOCK_TIME_IS_VALID (segment->start));
|
||||||
|
fail_unless (GST_CLOCK_TIME_IS_VALID (segment->base));
|
||||||
|
fail_unless (GST_CLOCK_TIME_IS_VALID (segment->time));
|
||||||
|
fail_unless (GST_CLOCK_TIME_IS_VALID (segment->position));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return GST_PAD_PROBE_OK;
|
||||||
|
} else if (GST_IS_BUFFER (GST_PAD_PROBE_INFO_DATA (info))) {
|
||||||
|
GstBuffer *buf = GST_PAD_PROBE_INFO_BUFFER (info);
|
||||||
|
|
||||||
|
fail_unless_equals_int (gst_buffer_get_size (buf), data->expected_size);
|
||||||
|
fail_unless_equals_uint64 (GST_BUFFER_PTS (buf), data->expected_time);
|
||||||
|
}
|
||||||
|
|
||||||
|
return GST_PAD_PROBE_DROP;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
qtdemux_pad_added_cb (GstElement * element, GstPad * pad, CommonTestData * data)
|
qtdemux_pad_added_cb (GstElement * element, GstPad * pad, CommonTestData * data)
|
||||||
{
|
{
|
||||||
data->srcpad = pad;
|
data->srcpad = pad;
|
||||||
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BUFFER,
|
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM,
|
||||||
(GstPadProbeCallback) qtdemux_probe, data, NULL);
|
(GstPadProbeCallback) qtdemux_probe, data, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue