summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFlorin Apostol <florin.apostol@oregan.net>2016-02-16 14:25:04 +0000
committerThiago Santos <thiagoss@osg.samsung.com>2016-04-22 17:33:15 -0300
commitf89fe6cb45578a21bdf54107bf5e92ccb4b97be7 (patch)
tree7f21498b930d4a6bd4029508a7dfa0814f89b305 /tests
parenta7f1eb234f390a1f03a50e410c5d5cf39b4af5ed (diff)
downloadgstreamer-plugins-bad-f89fe6cb45578a21bdf54107bf5e92ccb4b97be7.tar.gz
dashdemux: tests: tested latency query
Updated query test to also check if dash responds correctly to a latency query. https://bugzilla.gnome.org/show_bug.cgi?id=762144
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/dash_demux.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/check/elements/dash_demux.c b/tests/check/elements/dash_demux.c
index 87ab7efea..0c7bb902b 100644
--- a/tests/check/elements/dash_demux.c
+++ b/tests/check/elements/dash_demux.c
@@ -1037,6 +1037,9 @@ testQueryCheckDataReceived (GstAdaptiveDemuxTestEngine * engine,
gboolean seekable;
gint64 segment_start;
gint64 segment_end;
+ gboolean live;
+ GstClockTime min_latency;
+ GstClockTime max_latency;
gchar *uri;
gchar *redirect_uri;
gboolean redirect_permanent;
@@ -1048,13 +1051,16 @@ testQueryCheckDataReceived (GstAdaptiveDemuxTestEngine * engine,
fail_unless (g_list_length (pads) == 1);
pad = GST_PAD (pads->data);
+ /* duration query */
query = gst_query_new_duration (GST_FORMAT_TIME);
ret = gst_pad_peer_query (pad, query);
fail_unless (ret == TRUE);
gst_query_parse_duration (query, NULL, &duration);
+ /* mediaPresentationDuration=\"PT135.743S\" */
fail_unless (duration == 135743 * GST_MSECOND);
gst_query_unref (query);
+ /* seek query */
query = gst_query_new_seeking (GST_FORMAT_TIME);
ret = gst_pad_peer_query (pad, query);
fail_unless (ret == TRUE);
@@ -1065,13 +1071,24 @@ testQueryCheckDataReceived (GstAdaptiveDemuxTestEngine * engine,
fail_unless (segment_end == duration);
gst_query_unref (query);
+ /* latency query */
+ query = gst_query_new_latency ();
+ ret = gst_pad_peer_query (pad, query);
+ fail_unless (ret == TRUE);
+ gst_query_parse_latency (query, &live, &min_latency, &max_latency);
+ fail_unless (live == FALSE);
+ fail_unless (min_latency == 0);
+ fail_unless (max_latency == -1);
+ gst_query_unref (query);
+
+ /* uri query */
query = gst_query_new_uri ();
ret = gst_pad_peer_query (pad, query);
fail_unless (ret == TRUE);
gst_query_parse_uri (query, &uri);
gst_query_parse_uri_redirection (query, &redirect_uri);
gst_query_parse_uri_redirection_permanent (query, &redirect_permanent);
- fail_unless (strcmp (uri, "http://unit.test/test.mpd") == 0);
+ fail_unless (g_strcmp0 (uri, "http://unit.test/test.mpd") == 0);
/* adaptive demux does not reply with redirect information */
fail_unless (redirect_uri == NULL);
fail_unless (redirect_permanent == FALSE);