<div dir="ltr">Hi Oliver.<br><div><div class="gmail_extra"><br></div><div class="gmail_extra">See answer inline after your question.<br><br></div><div class="gmail_extra"><div class="gmail_quote">On Thu, Sep 19, 2013 at 8:05 PM, Olivier Crête <span dir="ltr"><<a href="mailto:olivier.crete@collabora.com" target="_blank">olivier.crete@collabora.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> BTW2. A neat feature of shmsink, especially when used by external<br><div class="im">
> programs, would be if it had 2 extra commands added. These should be:<br>
><br>
><br>
>   1) Stop handing out more buffers upstream.<br>
>   2) Start handing out more buffers upstream.<br>
>   3) Drop all buffers handed out upstream until now, but not yet sent.<br>
><br>
><br>
> A video mixer application like Snowmix could then much better do<br>
> resource control. Imagine you have a video mixer with 10-20 gstreamer<br>
> pipeline inputs, it can really save a lot of CPU and memmove<br>
> bandwidth, if the mixer can temporarily halt pipeline not currently<br>
> being mixed. Now that is already possible, but not  before the shmsink<br>
> has used up all available shm area. Just a thought. Limiting the<br>
> amount of unnecessary memmove becomes important when doing many<br>
> pipelines of 1920x1080 @60fps.<br>
<br>
</div>Can't your just halt it directly ? Why do you wait for all of the buffer<br>
space to be used up ?<br></blockquote><div><br></div><div>No I can not halt it directly.<br><br>One of the standard use scenario for shmsink is when you have a GStreamer pipeline in one process (process 1) sending buffers to another process (process 2) running whatever that process runs. There is no easy way for process 2 to tell process 1 to halt unless it keeps all the buffers sent by process 1. Please note that halt is bit unclear. In my scenario halt means stop sending buffers (and hopefully stop using so many ressources, CPU, disk, memmove bandwidth, network etc.). It does NOT mean terminate.<br>
<br></div><div>Now if process 2 keeps all the buffers it receive, process 1 will eventually reach a state, where it temporarily halts or alternatively leaks buffers in a queue. However there is a lag and as we have seen, the lag has to  be of a certain size due to the freeze thing we discussed in another thread.<br>
<br>Hmmmmmm that give rise to a problem. Assume you have the following:<br><br></div><div>  somesrc ! queue leaky=2 ! shsmsink  ----------- process 2<br><br></div><div>Then how can the queue leak if process 2 keeps all the buffers ? In that case, somsrc will freeze too. How can that be fixed?<br>
<br></div><div> best regards<br></div><div><br><br></div><div><br><br><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"></span><br></blockquote></div></div></div></div>