speed=0 means to pause. Your consumer go into an interruptible state after
processing this frame to stop using CPU. Your consumer can then require the
app to set refresh=1 on consumer properties to interrupt it, and that might
take it out of the speed=0 pause state. Obviously, you need to set the
producer back into some play mode before doing that. :-) Or, you can also
set refresh=1 if you only need to update the frame once because you changed
something in the processing pipeline and need to repaint it. This is all
conventions rather than anything imposed by the framework.
You just happened to look at the wrong consumers' code because they do not
provide this behavior. If you look at sdl_audio or rtaudio then you will
see what I describe. Shotcut is using an audio-only consumer and the
consumer-frame-show event with a mlt_frame as an argument to render the
video using Qt. qglsl is really just intended to be a wrapper around the
avformat consumer to provide an OpenGL context for the opengl module - not
really a display-oriented consumer. I hope that helps.
On Tue, Jul 26, 2016 at 12:00 PM Paweł Goliński <golp...@gmail.com> wrote:
> Hi,
>
> What is the policy for handling _speed == 0.0 on frames incoming to
> consumers from producers?
> Is that anyhow different than receiving frame with _speed == 1.0 from the
> consumer’s perspective?
>
> I think I’m doing it wrong, because my consumer uses same amount of CPU
> time whether _speed == 0 or not,
> and I noticed in „melt + sdl consumer” setup there is a noticeable
> decrease in CPU usage when I pause. In some
> apps, like Shotcut or kdenlive which use qglsl consumer (I think) CPU
> usage drops down to 0% on pause!
>
> The thing is, I do nothing special when „_speed == 0.0”. So, when _speed
> of incoming frame is 0.0, i just do
> get_image() and get_audio() on it, so it goes through usual resize+convert
> pipeline as if I was fetching a frame
> in play state (_speed == 1.0). So the CPU usage of my consumer is the same
> whether it is playing or in pause
> state. Obviously this is wrong.
>
> I was trying to detect in code what is being done, but it seems pause
> isn’t treated like special case in neither
> sdl consumer nor qglsl consumer when it comes to fetching image/audio from
> received frames. So there is something
> smart going on there, just under my nose, but I can’t detect what :(
>
>
> Best,
> Paweł
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and
> traffic
> patterns at an interface-level. Reveals which users, apps, and protocols
> are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning
> reports.http://sdm.link/zohodev2dev
> _______________________________________________
> Mlt-devel mailing list
> Mlt-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mlt-devel
>
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel