Skip to content

Commit 94dea52

Browse files
authored
Merge pull request #53 from RidgeRun/hotfix-sync-tests
Hotfix sync tests
2 parents 7e1079a + 8253ee4 commit 94dea52

File tree

7 files changed

+56
-162
lines changed

7 files changed

+56
-162
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dnl please read gstreamer/docs/random/autotools before changing this file
66
dnl initialize autoconf
77
dnl releases only do -Wall, git and prerelease does -Werror too
88
dnl use a three digit version number for releases, and four for git/pre
9-
AC_INIT([GstInterpipe],[1.1.1],
9+
AC_INIT([GstInterpipe],[1.1.2],
1010
[http://www.github.com/RidgeRun/gst-interpipe-1.0],
1111
[gst-interpipe],
1212
[http://developer.ridgerun.com/wiki/index.php?title=GstInterpipe])

gst-interpipe.doap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ GstInterpipe is a plug-in with two elements which allow the communication betwee
3030
</GitRepository>
3131
</repository>
3232

33+
<release>
34+
<Version>
35+
<revision>1.1.2</revision>
36+
<branch>master</branch>
37+
<name></name>
38+
<created>2020-08-13</created>
39+
<file-release rdf:resource="" />
40+
</Version>
41+
</release>
42+
3343
<release>
3444
<Version>
3545
<revision>1.1.1</revision>

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project('gst-interpipes', 'c',
2-
version : '1.0.4',
2+
version : '1.1.2',
33
meson_version : '>= 0.50',)
44

55
gst_interpipes_version = meson.project_version()

tests/check/Makefile.am

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ check_PROGRAMS = gst/test_allow_renegotiation_property \
2727
gst/test_block_switch \
2828
gst/test_buffer_properties \
2929
gst/test_caps_renegotiation \
30-
gst/test_enable_sync \
30+
gst/test_stream_sync \
3131
gst/test_get_caps \
3232
gst/test_hot_plug \
3333
gst/test_in_bounds_events \
34-
gst/test_interpipe_synchronization \
3534
gst/test_invalid_caps \
3635
gst/test_node_name_removed \
3736
gst/test_out_of_bounds_events \

tests/check/gst/test_enable_sync.c

Lines changed: 0 additions & 141 deletions
This file was deleted.

tests/check/gst/test_interpipe_synchronization.c renamed to tests/check/gst/test_stream_sync.c

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* GStreamer
2+
* Copyright (C) 2016 Erick Arroyo <erick.arroyo@ridgerun.com>
23
* Copyright (C) 2016 Carlos Rodriguez <carlos.rodriguez@ridgerun.com>
4+
* Copyright (C) 2020 Jennifer Caballero <jennifer.caballero@ridgerun.com>
35
*
46
* This library is free software; you can redistribute it and/or
57
* modify it under the terms of the GNU Library General Public
@@ -27,16 +29,18 @@
2729
#include <gst/app/gstappsink.h>
2830

2931
/*
30-
* Given two pipelines, play the first one, wait and the play
32+
* Given two pipelines, play the first one, wait and then play
3133
* the other one, it should not be delay in the video when it is display
34+
* only if the stream-sync property is set to compensate-ts (2)
3235
*/
33-
GST_START_TEST (interpipe_synchronization)
36+
GST_START_TEST (interpipe_stream_sync_compensate_ts)
3437
{
3538
GstPipeline *sink1;
3639
GstPipeline *sink2;
3740
GstPipeline *src;
3841
GstElement *vtsrc1;
3942
GstElement *vtsrc2;
43+
4044
GstElement *intersrc;
4145
GstElement *asink;
4246
GstSample *outsample;
@@ -61,7 +65,9 @@ GST_START_TEST (interpipe_synchronization)
6165
/* Create one source pipeline */
6266
src =
6367
GST_PIPELINE (gst_parse_launch
64-
("interpipesrc name=intersrc listen-to=intersink1 block-switch=false allow-renegotiation=true format=3 ! capsfilter caps=video/x-raw,width=[320,1920],height=[240,1080],framerate=(fraction)5/1 ! "
68+
("interpipesrc name=intersrc listen-to=intersink1 stream-sync=compensate-ts "
69+
"block-switch=false allow-renegotiation=true format=3 ! capsfilter "
70+
"caps=video/x-raw,width=[320,1920],height=[240,1080],framerate=(fraction)5/1 ! "
6571
"appsink name=asink drop=true async=false sync=true", &error));
6672
fail_if (error);
6773
intersrc = gst_bin_get_by_name (GST_BIN (src), "intersrc");
@@ -73,38 +79,60 @@ GST_START_TEST (interpipe_synchronization)
7379
* completed. It's used here to guarantee a secuential pipeline initialization
7480
* and avoid concurrency errors.
7581
*/
76-
fail_if (GST_STATE_CHANGE_FAILURE == gst_element_set_state (GST_ELEMENT (src),
77-
GST_STATE_PLAYING));
78-
fail_if (GST_STATE_CHANGE_FAILURE == gst_element_get_state (GST_ELEMENT (src),
79-
NULL, NULL, GST_CLOCK_TIME_NONE));
8082
fail_if (GST_STATE_CHANGE_FAILURE ==
8183
gst_element_set_state (GST_ELEMENT (sink1), GST_STATE_PLAYING));
8284
fail_if (GST_STATE_CHANGE_FAILURE ==
8385
gst_element_get_state (GST_ELEMENT (sink1), NULL, NULL,
8486
GST_CLOCK_TIME_NONE));
87+
fail_if (GST_STATE_CHANGE_FAILURE == gst_element_set_state (GST_ELEMENT (src),
88+
GST_STATE_PLAYING));
89+
fail_if (GST_STATE_CHANGE_FAILURE == gst_element_get_state (GST_ELEMENT (src),
90+
NULL, NULL, GST_CLOCK_TIME_NONE));
8591
fail_if (GST_STATE_CHANGE_FAILURE ==
8692
gst_element_set_state (GST_ELEMENT (sink2), GST_STATE_PLAYING));
8793
fail_if (GST_STATE_CHANGE_FAILURE ==
88-
gst_element_get_state (GST_ELEMENT (sink1), NULL, NULL,
94+
gst_element_get_state (GST_ELEMENT (sink2), NULL, NULL,
8995
GST_CLOCK_TIME_NONE));
9096

9197
/* Verifies if the caps are set correctly to the listeners
9298
*/
9399
outsample = gst_app_sink_pull_sample (GST_APP_SINK (asink));
94100
buffer = gst_sample_get_buffer (outsample);
95101
fail_if (!buffer);
96-
buffer_timestamp1 = GST_BUFFER_DTS (buffer);
97-
GST_ERROR ("Buffer timestamp (dts): %" GST_TIME_FORMAT,
98-
GST_TIME_ARGS (GST_BUFFER_DTS (buffer)));
102+
buffer_timestamp1 = GST_BUFFER_PTS (buffer);
99103
fail_if (buffer_timestamp1 == 0);
104+
gst_sample_unref (outsample);
105+
106+
/* Disconnect interpipesrc and flush old buffers */
107+
g_object_set (G_OBJECT (intersrc), "listen-to", NULL, NULL);
108+
fail_if (!gst_element_send_event(GST_ELEMENT(src), gst_event_new_flush_start()));
109+
fail_if (!gst_element_send_event(GST_ELEMENT(src), gst_event_new_flush_stop(FALSE)));
100110

101111
/* Change to another video src */
102112
g_object_set (G_OBJECT (intersrc), "listen-to", "intersink2", NULL);
113+
103114
outsample = gst_app_sink_pull_sample (GST_APP_SINK (asink));
104115
buffer = gst_sample_get_buffer (outsample);
105116
buffer_timestamp2 = GST_BUFFER_PTS (buffer);
106117
fail_if (buffer_timestamp2 == 0);
118+
107119
fail_if (buffer_timestamp2 < buffer_timestamp1);
120+
gst_sample_unref (outsample);
121+
122+
/* Disconnect interpipesrc and flush old buffers */
123+
g_object_set (G_OBJECT (intersrc), "listen-to", NULL, NULL);
124+
fail_if (!gst_element_send_event(GST_ELEMENT(src), gst_event_new_flush_start()));
125+
fail_if (!gst_element_send_event(GST_ELEMENT(src), gst_event_new_flush_stop(FALSE)));
126+
127+
/* Now change to the first video src and pull another buffer */
128+
g_object_set (G_OBJECT (intersrc), "listen-to", "intersink1", NULL);
129+
130+
outsample = gst_app_sink_pull_sample (GST_APP_SINK (asink));
131+
buffer = gst_sample_get_buffer (outsample);
132+
buffer_timestamp1 = GST_BUFFER_PTS (buffer);
133+
fail_if (buffer_timestamp1 == 0);
134+
135+
fail_if (buffer_timestamp1 < buffer_timestamp2);
108136

109137
/* Stop pipelines */
110138
fail_if (GST_STATE_CHANGE_FAILURE ==
@@ -131,11 +159,10 @@ static Suite *
131159
gst_interpipe_suite (void)
132160
{
133161
Suite *suite = suite_create ("Interpipe");
134-
TCase *tc = tcase_create ("interpipe_synchronization");
162+
TCase *tc1 = tcase_create ("interpipe_stream_sync");
135163

136-
tcase_set_timeout (tc, 0);
137-
suite_add_tcase (suite, tc);
138-
tcase_add_test (tc, interpipe_synchronization);
164+
suite_add_tcase (suite, tc1);
165+
tcase_add_test (tc1, interpipe_stream_sync_compensate_ts);
139166

140167
return suite;
141168
}

tests/check/meson.build

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ core_tests = [
44
[ 'gst/test_anonymous_connection.c' ],
55
[ 'gst/test_block_switch.c' ],
66
[ 'gst/test_caps_renegotiation.c' ],
7-
[ 'gst/test_enable_sync.c' ],
7+
[ 'gst/test_stream_sync.c' ],
88
[ 'gst/test_get_caps.c' ],
99
[ 'gst/test_hot_plug.c' ],
1010
[ 'gst/test_in_bounds_events.c' ],
11-
[ 'gst/test_interpipe_synchronization.c' ],
1211
[ 'gst/test_invalid_caps.c' ],
1312
[ 'gst/test_node_name_removed.c' ],
1413
[ 'gst/test_out_of_bounds_events.c' ],

0 commit comments

Comments
 (0)