On Fri, Jun 21, 2013 at 11:31 AM, Dan Dennedy <d...@dennedy.org> wrote: > On Tue, Jun 18, 2013 at 6:10 AM, j-b-m <j-...@users.sourceforge.net> wrote: >> I still have a problem when trying to use these producers in Kdenlive because >> in EffectsImpl::render(double time, Image* renderImage), the >> QMetaObject::invokeMethod(this, "renderInvokable" (...) sometimes freezes. > > What I have noticed while trying to integrate the webvfx filter into > Shotcut is that if I call Consumer::stop() then it deadlocks because > it it called on the main Qt thread, inside mlt_consumer_close() it > waits for the render thread to finish, but the webvfx renderInvokable > call is waiting on the main Qt thread to process the slot via blocking > queued connection. I have been tinkering with workarounds that I am > not so happy with thus far. What I discovered is that if I disable the > filter, wait a little for the currently blocked render to complete, > then I can call stop because the consumer render thread is not asking > webvfx to render anything anymore. I have successfully performed that > wait using nanosleep() or a QTimer::singleShot() within a method that > I have split into 2 parts around the call to singleShot. However, I > would rather have something that works within MLT. I am thinking the > call to renderInvokable should not be a blocking queued connection. > Rather, perhaps it should wait on a condition after the invocation - > one that can be signaled from the actual render or from mlt_consumer > prior to joining the render thread. >
JB, I have committed changes to MLT and my WebVfx fork that implements the last sentence above. I have successfully tested it in my working copy of Shotcut. It does, however, require that the app sets a "consumer" data property on the webvfx server to the mlt_consumer because webvfx uses this to setup an event listener on a stop event in order to cancel a pending render. I might be a very awkward traversal for the service to discover the end consumer itself and perhaps impossible with things like multi consumer. Indeed, I just discovered I still have a problem with sdl_preview. :-\ -- +-DRD-+ ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Mlt-devel mailing list Mlt-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mlt-devel