From 0a903cdd35b35662463eb289e5c46f0a0121056c Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 14 Mar 2014 18:48:44 +0100 Subject: [PATCH] pipeline: Always set the encoding profile presence to 1 We currenty do not support multiple tracks with same type in GESPipeline and we actually need to set the presence field to avoid a scenario where we have only video in a video track, and no audio in the audio track. So audiotestsrc is used and we end up encoding the whole audio stream but no decoded video frame as reached the decodebin src pad, so the pad has not been created and thus it will not be linked to the encodebin. On the audio part, the EOS will be emitted so fast that the resulting stream will not have any video in it as the muxer will not even have a video pad created. Setting the presence will ensure that the muxer does have a video pad (because of how encodebin behaves) and thus will create a pad for it and wait for its EOS. --- ges/ges-pipeline.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ges/ges-pipeline.c b/ges/ges-pipeline.c index 226867e..ae65a84 100644 --- a/ges/ges-pipeline.c +++ b/ges/ges-pipeline.c @@ -852,6 +852,21 @@ ges_pipeline_set_render_settings (GESPipeline * pipeline, g_return_val_if_fail (GES_IS_PIPELINE (pipeline), FALSE); + /* FIXME Properly handle multi track, for now GESPipeline + * only hanles single track per type, so we should just set the + * presence to 1. + */ + if (GST_IS_ENCODING_CONTAINER_PROFILE (profile)) { + const GList *tmpprofiles = + gst_encoding_container_profile_get_profiles + (GST_ENCODING_CONTAINER_PROFILE (profile)); + + for (; tmpprofiles; tmpprofiles = tmpprofiles->next) { + GST_DEBUG_OBJECT (pipeline, "Setting presence to 1!"); + gst_encoding_profile_set_presence (tmpprofiles->data, 1); + } + } + /* Clear previous URI sink if it existed */ /* FIXME : We should figure out if it was added to the pipeline, * and if so, remove it. */ -- 2.7.4