Hello
I couldn’t find out the easiest way for control mixing of two streams. Pipeline looks like: -------------- -------------- ----------- ----------- | audiotestsrc |------------>| audiodynamic |-->| equalizer |-->| sink_0 | -------------- -------------- ----------- | | | adder |--> --------- ---------- -------------- ----------- | | | filesrc |-->| wavparse |-->| audiodynamic |-->| equalizer |-->| sink_1 | --------- ---------- -------------- ----------- -----------In most cases, audio flows from audiotestsrc and WAV-files are played periodically. There are three major moments during the pipeline work: 1) start wav-file playing when audiotestsrc is already running 2) stop wav-file playing manually 3) normal wav-file playing finishing (EOS) 4) play another wav-file when previous file isn’t finished yet I’ve already implemented next logic: 0) on application start-up all elements are created, but elements related to WAV-playing aren’t added to BIN 1) upon request of start wav-file playing, elements related to WAV-playing are added to BIN, linked with each other, probe is added to sink_1 (element adder) for catch EOS 2) on manual stop, filesrc is set to NULL state, elements related to WAV-playing are moved outside BIN (not removed completely), pad sink_1 is removed (element adder) 3) on EOS, the probe is removed from sink_1 and a EOS message sent to BUS - in another procedure (seems like in another thread) the message is caught and the step 2 is started 4) on start playing another file when a previous isn’t finished yet, the filesrc is set to NULL state, location is changed and finally filesrc is set to PLAYING state. Advantages of this logic: settings of audiodynamic and equalizer (and another filters) aren’t lost. Disadvantages: it needs to store in private struct pointers to elements related to WAV-playing and it needs to move these elements to/outside BIN and relink all pads. I suppose, there is should be more elegant solution for realize these requirements, but I don’t know how. May be it is possible to create some “fake” source element which will replace filesrc when wav-files aren’t played. I’ve tried to use fakesrc element, but couldn’t find out how to configure it properly. Could you please give me suggestions about how to make logic more elegant? Thank you. |
If I understand your question, it isn't an easy problem On Mon, Nov 21, 2016 at 10:46 AM, Dmitry Valento <[hidden email]> wrote: Hello _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Thank you for your advise. Seems like the "voctomix" is use another approach to mix several streams: - if needs to change a pipeline structure, the pipeline removes all elements and recreate entire pipeline from scratch. - a pipeline isn't often changed - in most cases it is created at application start after scanning of sources. Then pipeline runs without changes (if no one error occurs) till the end of application. Unfortunately, according to requirements for my application, there is couldn't be delays in audio streaming during sources changing. Therefore entire pipeline recreation isn't allowed at all. |
Free forum by Nabble | Edit this page |