<div dir="ltr"><div><div><div>quick answer:   <a href="https://github.com/voc/voctomix#contact">https://github.com/voc/voctomix#contact</a><br><br></div>Watch the 2 videos.<br><br></div>If I understand your question, it isn't an easy problem<br></div><div><div><div><div><br><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 21, 2016 at 10:46 AM, Dmitry Valento <span dir="ltr"><<a href="mailto:va.dimon@tut.by" target="_blank">va.dimon@tut.by</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello<br>
I couldn’t find out the easiest way for control mixing of two streams.<br>
Pipeline looks like:<br>
<br>
In most cases, audio flows from audiotestsrc and WAV-files are played<br>
periodically.<br>
There are three major moments during the pipeline work:<br>
1) start wav-file playing when audiotestsrc is already running<br>
2) stop wav-file playing manually<br>
3) normal wav-file playing finishing (EOS)<br>
4) play another wav-file when previous file isn’t finished yet<br>
<br>
I’ve already implemented next logic:<br>
0) on application start-up all elements are created, but elements related to<br>
WAV-playing aren’t added to BIN<br>
1) upon request of start wav-file playing, elements related to WAV-playing<br>
are added to BIN, linked with each other, probe is added to sink_1 (element<br>
adder) for catch EOS<br>
2) on manual stop, filesrc is set to NULL state, elements related to<br>
WAV-playing are moved outside BIN (not removed completely), pad sink_1 is<br>
removed (element adder)<br>
3) on EOS, the probe is removed from sink_1 and a EOS message sent to BUS -<br>
in another procedure (seems like in another thread) the message is caught<br>
and the step 2 is started<br>
4) on start playing another file when a previous isn’t finished yet, the<br>
filesrc is set to NULL state, location is changed and finally filesrc is set<br>
to PLAYING state.<br>
<br>
Advantages of this logic: settings of audiodynamic and equalizer (and<br>
another filters) aren’t lost.<br>
Disadvantages: it needs to store in private struct pointers to elements<br>
related to WAV-playing and it needs to move these elements to/outside BIN<br>
and relink all pads.<br>
<br>
I suppose, there is should be more elegant solution for realize these<br>
requirements, but I don’t know how. May be it is possible to create some<br>
“fake” source element which will replace filesrc when wav-files aren’t<br>
played. I’ve tried to use fakesrc element, but couldn’t find out how to<br>
configure it properly.<br>
Could you please give me suggestions about how to make logic more elegant?<br>
<br>
Thank you.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/What-the-best-way-for-mix-two-streams-when-they-may-start-stop-independent-from-each-other-tp4680810.html" rel="noreferrer" target="_blank">http://gstreamer-devel.966125.<wbr>n4.nabble.com/What-the-best-<wbr>way-for-mix-two-streams-when-<wbr>they-may-start-stop-<wbr>independent-from-each-other-<wbr>tp4680810.html</a><br>
Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.<wbr>freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-<wbr>devel</a><br>
</blockquote></div><br></div>