diff options
author | Youness Alaoui <kakaroto@kakaroto.homelinux.net> | 2015-01-28 18:19:08 -0500 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2015-01-28 18:23:25 -0500 |
commit | b788ca15fae591a917de0ed77eeb632a919f7325 (patch) | |
tree | b5cd8c4234e28b797c8afd7996e806d369381f49 /tests | |
parent | f2c04851e27dc428153cb1520cb412fd8db2a144 (diff) | |
download | farstream-b788ca15fae591a917de0ed77eeb632a919f7325.tar.gz |
transmitter: Fix nice unit test for rtcp-muxing. Ignore component 2 ready.
Component 2 may become ready before component 1 in which case data
sent to that part of the pipeline will be dropped since cid 1 is not
yet ready, which causes the unit test to fail since data is missing.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/transmitter/nice.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/tests/check/transmitter/nice.c b/tests/check/transmitter/nice.c index 88a46395..f903a003 100644 --- a/tests/check/transmitter/nice.c +++ b/tests/check/transmitter/nice.c @@ -313,6 +313,23 @@ _known_source_packet_received (FsStreamTransmitter *st, guint component_id, } static void +_setup_fakesink_for_ready_component (FsTransmitter *trans, const gchar *prop, + FsStreamTransmitter *st, guint component) +{ + + if (g_object_get_data (G_OBJECT (trans), prop) == NULL) + { + GstElement *pipeline = GST_ELEMENT ( + g_object_get_data (G_OBJECT (trans), "pipeline")); + GST_DEBUG ("%p: Setting up fakesrc for component %u", st, component); + setup_fakesrc (trans, pipeline, component); + g_object_set_data (G_OBJECT (trans), prop, ""); + } + else + GST_DEBUG ("FAKESRC ALREADY SETUP for component %u", component); +} + +static void _stream_state_changed (FsStreamTransmitter *st, guint component, FsStreamState state, gpointer user_data) { @@ -349,21 +366,14 @@ _stream_state_changed (FsStreamTransmitter *st, guint component, if (state < FS_STREAM_STATE_READY) return; - if (component == 1) - prop = "src_setup_1"; - else if (component == 2) - prop = "src_setup_2"; - - if (g_object_get_data (G_OBJECT (trans), prop) == NULL) - { - GstElement *pipeline = GST_ELEMENT ( - g_object_get_data (G_OBJECT (trans), "pipeline")); - GST_DEBUG ("%p: Setting up fakesrc for component %u", st, component); - setup_fakesrc (trans, pipeline, component); - g_object_set_data (G_OBJECT (trans), prop, ""); + if (component == 1) { + _setup_fakesink_for_ready_component (trans, "src_setup_1", st, component); + if (is_muxed) + _setup_fakesink_for_ready_component (trans, "src_setup_2", st, 2); } - else - GST_DEBUG ("FAKESRC ALREADY SETUP for component %u", component); + if (!is_muxed && component == 2) + _setup_fakesink_for_ready_component (trans, "src_setup_2", st, component); + } |