Skip to content

Commit

Permalink
Merge pull request #53 from RidgeRun/hotfix-sync-tests
Browse files Browse the repository at this point in the history
Hotfix sync tests
  • Loading branch information
jcaballeros authored Aug 13, 2020
2 parents 7e1079a + 8253ee4 commit 94dea52
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 162 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dnl please read gstreamer/docs/random/autotools before changing this file
dnl initialize autoconf
dnl releases only do -Wall, git and prerelease does -Werror too
dnl use a three digit version number for releases, and four for git/pre
AC_INIT([GstInterpipe],[1.1.1],
AC_INIT([GstInterpipe],[1.1.2],
[http://www.github.com/RidgeRun/gst-interpipe-1.0],
[gst-interpipe],
[http://developer.ridgerun.com/wiki/index.php?title=GstInterpipe])
Expand Down
10 changes: 10 additions & 0 deletions gst-interpipe.doap
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ GstInterpipe is a plug-in with two elements which allow the communication betwee
</GitRepository>
</repository>

<release>
<Version>
<revision>1.1.2</revision>
<branch>master</branch>
<name></name>
<created>2020-08-13</created>
<file-release rdf:resource="" />
</Version>
</release>

<release>
<Version>
<revision>1.1.1</revision>
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('gst-interpipes', 'c',
version : '1.0.4',
version : '1.1.2',
meson_version : '>= 0.50',)

gst_interpipes_version = meson.project_version()
Expand Down
3 changes: 1 addition & 2 deletions tests/check/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ check_PROGRAMS = gst/test_allow_renegotiation_property \
gst/test_block_switch \
gst/test_buffer_properties \
gst/test_caps_renegotiation \
gst/test_enable_sync \
gst/test_stream_sync \
gst/test_get_caps \
gst/test_hot_plug \
gst/test_in_bounds_events \
gst/test_interpipe_synchronization \
gst/test_invalid_caps \
gst/test_node_name_removed \
gst/test_out_of_bounds_events \
Expand Down
141 changes: 0 additions & 141 deletions tests/check/gst/test_enable_sync.c

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* GStreamer
* Copyright (C) 2016 Erick Arroyo <[email protected]>
* Copyright (C) 2016 Carlos Rodriguez <[email protected]>
* Copyright (C) 2020 Jennifer Caballero <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
Expand Down Expand Up @@ -27,16 +29,18 @@
#include <gst/app/gstappsink.h>

/*
* Given two pipelines, play the first one, wait and the play
* Given two pipelines, play the first one, wait and then play
* the other one, it should not be delay in the video when it is display
* only if the stream-sync property is set to compensate-ts (2)
*/
GST_START_TEST (interpipe_synchronization)
GST_START_TEST (interpipe_stream_sync_compensate_ts)
{
GstPipeline *sink1;
GstPipeline *sink2;
GstPipeline *src;
GstElement *vtsrc1;
GstElement *vtsrc2;

GstElement *intersrc;
GstElement *asink;
GstSample *outsample;
Expand All @@ -61,7 +65,9 @@ GST_START_TEST (interpipe_synchronization)
/* Create one source pipeline */
src =
GST_PIPELINE (gst_parse_launch
("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 ! "
("interpipesrc name=intersrc listen-to=intersink1 stream-sync=compensate-ts "
"block-switch=false allow-renegotiation=true format=3 ! capsfilter "
"caps=video/x-raw,width=[320,1920],height=[240,1080],framerate=(fraction)5/1 ! "
"appsink name=asink drop=true async=false sync=true", &error));
fail_if (error);
intersrc = gst_bin_get_by_name (GST_BIN (src), "intersrc");
Expand All @@ -73,38 +79,60 @@ GST_START_TEST (interpipe_synchronization)
* completed. It's used here to guarantee a secuential pipeline initialization
* and avoid concurrency errors.
*/
fail_if (GST_STATE_CHANGE_FAILURE == gst_element_set_state (GST_ELEMENT (src),
GST_STATE_PLAYING));
fail_if (GST_STATE_CHANGE_FAILURE == gst_element_get_state (GST_ELEMENT (src),
NULL, NULL, GST_CLOCK_TIME_NONE));
fail_if (GST_STATE_CHANGE_FAILURE ==
gst_element_set_state (GST_ELEMENT (sink1), GST_STATE_PLAYING));
fail_if (GST_STATE_CHANGE_FAILURE ==
gst_element_get_state (GST_ELEMENT (sink1), NULL, NULL,
GST_CLOCK_TIME_NONE));
fail_if (GST_STATE_CHANGE_FAILURE == gst_element_set_state (GST_ELEMENT (src),
GST_STATE_PLAYING));
fail_if (GST_STATE_CHANGE_FAILURE == gst_element_get_state (GST_ELEMENT (src),
NULL, NULL, GST_CLOCK_TIME_NONE));
fail_if (GST_STATE_CHANGE_FAILURE ==
gst_element_set_state (GST_ELEMENT (sink2), GST_STATE_PLAYING));
fail_if (GST_STATE_CHANGE_FAILURE ==
gst_element_get_state (GST_ELEMENT (sink1), NULL, NULL,
gst_element_get_state (GST_ELEMENT (sink2), NULL, NULL,
GST_CLOCK_TIME_NONE));

/* Verifies if the caps are set correctly to the listeners
*/
outsample = gst_app_sink_pull_sample (GST_APP_SINK (asink));
buffer = gst_sample_get_buffer (outsample);
fail_if (!buffer);
buffer_timestamp1 = GST_BUFFER_DTS (buffer);
GST_ERROR ("Buffer timestamp (dts): %" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_DTS (buffer)));
buffer_timestamp1 = GST_BUFFER_PTS (buffer);
fail_if (buffer_timestamp1 == 0);
gst_sample_unref (outsample);

/* Disconnect interpipesrc and flush old buffers */
g_object_set (G_OBJECT (intersrc), "listen-to", NULL, NULL);
fail_if (!gst_element_send_event(GST_ELEMENT(src), gst_event_new_flush_start()));
fail_if (!gst_element_send_event(GST_ELEMENT(src), gst_event_new_flush_stop(FALSE)));

/* Change to another video src */
g_object_set (G_OBJECT (intersrc), "listen-to", "intersink2", NULL);

outsample = gst_app_sink_pull_sample (GST_APP_SINK (asink));
buffer = gst_sample_get_buffer (outsample);
buffer_timestamp2 = GST_BUFFER_PTS (buffer);
fail_if (buffer_timestamp2 == 0);

fail_if (buffer_timestamp2 < buffer_timestamp1);
gst_sample_unref (outsample);

/* Disconnect interpipesrc and flush old buffers */
g_object_set (G_OBJECT (intersrc), "listen-to", NULL, NULL);
fail_if (!gst_element_send_event(GST_ELEMENT(src), gst_event_new_flush_start()));
fail_if (!gst_element_send_event(GST_ELEMENT(src), gst_event_new_flush_stop(FALSE)));

/* Now change to the first video src and pull another buffer */
g_object_set (G_OBJECT (intersrc), "listen-to", "intersink1", NULL);

outsample = gst_app_sink_pull_sample (GST_APP_SINK (asink));
buffer = gst_sample_get_buffer (outsample);
buffer_timestamp1 = GST_BUFFER_PTS (buffer);
fail_if (buffer_timestamp1 == 0);

fail_if (buffer_timestamp1 < buffer_timestamp2);

/* Stop pipelines */
fail_if (GST_STATE_CHANGE_FAILURE ==
Expand All @@ -131,11 +159,10 @@ static Suite *
gst_interpipe_suite (void)
{
Suite *suite = suite_create ("Interpipe");
TCase *tc = tcase_create ("interpipe_synchronization");
TCase *tc1 = tcase_create ("interpipe_stream_sync");

tcase_set_timeout (tc, 0);
suite_add_tcase (suite, tc);
tcase_add_test (tc, interpipe_synchronization);
suite_add_tcase (suite, tc1);
tcase_add_test (tc1, interpipe_stream_sync_compensate_ts);

return suite;
}
Expand Down
3 changes: 1 addition & 2 deletions tests/check/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ core_tests = [
[ 'gst/test_anonymous_connection.c' ],
[ 'gst/test_block_switch.c' ],
[ 'gst/test_caps_renegotiation.c' ],
[ 'gst/test_enable_sync.c' ],
[ 'gst/test_stream_sync.c' ],
[ 'gst/test_get_caps.c' ],
[ 'gst/test_hot_plug.c' ],
[ 'gst/test_in_bounds_events.c' ],
[ 'gst/test_interpipe_synchronization.c' ],
[ 'gst/test_invalid_caps.c' ],
[ 'gst/test_node_name_removed.c' ],
[ 'gst/test_out_of_bounds_events.c' ],
Expand Down

0 comments on commit 94dea52

Please sign in to comment.