diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2016-01-27 10:48:53 -0300 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2016-02-04 14:20:16 -0300 |
commit | 2bf87ad84cd0158f766bbac5ce240c51852d567f (patch) | |
tree | fbd3e1613174e8c671c7ac69973081b50cb2d8ec | |
parent | 40faf9e09b4180b77858a873d51e977da8dc9360 (diff) | |
download | gstreamer-plugins-bad-2bf87ad84cd0158f766bbac5ce240c51852d567f.tar.gz |
tests: dashdemux: add tests for snap flags seeking
Similar to HLS but DASH has the extra issue that it can have
multiple streams so snapping can be tricky as streams usually
won't be aligned.
For now, those tests handle the case of only having a single
stream.
https://bugzilla.gnome.org/show_bug.cgi?id=759158
-rw-r--r-- | tests/check/elements/dash_demux.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/check/elements/dash_demux.c b/tests/check/elements/dash_demux.c index e49230d20..b3efe7a62 100644 --- a/tests/check/elements/dash_demux.c +++ b/tests/check/elements/dash_demux.c @@ -619,6 +619,49 @@ GST_START_TEST (testSeekPosition) GST_END_TEST; +GST_START_TEST (testSeekSnapBeforePosition) +{ + /* Seek to 1.5s, snap before, it go to 1s */ + run_seek_position_test (1.0, GST_SEEK_TYPE_SET, 1500 * GST_MSECOND, + GST_SEEK_TYPE_NONE, 0, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_BEFORE, + 1000 * GST_MSECOND, -1, 3); +} + +GST_END_TEST; + + +GST_START_TEST (testSeekSnapAfterPosition) +{ + /* Seek to 1.5s with snap after, it should move to 2s */ + run_seek_position_test (1.0, GST_SEEK_TYPE_SET, 1500 * GST_MSECOND, + GST_SEEK_TYPE_NONE, 0, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_AFTER, + 2000 * GST_MSECOND, -1, 2); +} + +GST_END_TEST; + + +GST_START_TEST (testReverseSeekSnapBeforePosition) +{ + run_seek_position_test (-1.0, GST_SEEK_TYPE_SET, 1000 * GST_MSECOND, + GST_SEEK_TYPE_SET, 2500 * GST_MSECOND, + GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_BEFORE, 1000 * GST_MSECOND, + 3000 * GST_MSECOND, 2); +} + +GST_END_TEST; + + +GST_START_TEST (testReverseSeekSnapAfterPosition) +{ + run_seek_position_test (-1.0, GST_SEEK_TYPE_SET, 1000 * GST_MSECOND, + GST_SEEK_TYPE_SET, 2500 * GST_MSECOND, + GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_AFTER, 1000 * GST_MSECOND, + 2000 * GST_MSECOND, 1); +} + +GST_END_TEST; + static void testDownloadErrorMessageCallback (GstAdaptiveDemuxTestEngine * engine, GstMessage * msg, gpointer user_data) @@ -945,6 +988,10 @@ dash_demux_suite (void) tcase_add_test (tc_basicTest, testSeekKeyUnitPosition); tcase_add_test (tc_basicTest, testSeekPosition); tcase_add_test (tc_basicTest, testSeekUpdateStopPosition); + tcase_add_test (tc_basicTest, testSeekSnapBeforePosition); + tcase_add_test (tc_basicTest, testSeekSnapAfterPosition); + tcase_add_test (tc_basicTest, testReverseSeekSnapBeforePosition); + tcase_add_test (tc_basicTest, testReverseSeekSnapAfterPosition); tcase_add_test (tc_basicTest, testDownloadError); tcase_add_test (tc_basicTest, testFragmentDownloadError); tcase_add_test (tc_basicTest, testQuery); |