[Interest] Performance Issues with vlc and QImage painting inside QML

Mark markg85 at gmail.com
Mon Jul 16 17:20:38 CEST 2012

On Mon, Jul 16, 2012 at 2:21 PM, Daniel Kreuter
<daniel.kreuter85 at googlemail.com> wrote:
> Thanks for this link.
> When I understand the article right, then I can't move my
> QDeclarativeItem class into a new Thread, because the paint method can
> only be used inside of the GUI Thread.
> So how can I improve the performance of the video playback inside of
> QML? Using QWidget or the normal VLC player and the video seems to run
> as fast as it should, but not inside QML (you see that the FPS is much
> lower than the one inside of VLC player). One way could be to start
> the vlc player from inside my program as a new process and give him
> the video file, but it would be much nicer if it would look more
> native inside my program.
> Any suggestions?
> So long
> Daniel
> On Mon, Jul 16, 2012 at 1:21 PM,  <kai.koehne at nokia.com> wrote:
>>> My first thought was, to subclass QThread as well and let the video
>>> player run in an own thread, but you can't subclass QDeclarativeItem
>>> and QThread in the same class.
>> I can't comment on your original problem, but you don't have to (and don't need to) subclass QThread:
>> http://qt-project.org/wiki/Threads_Events_QObjects
>> (This time with the link ;)
>> Anyhow, why do you think adding another thread would speed up things?
>> Regards
>> Kai
> --
> Mit freundlichen Grüßen
> Greetings
> Daniel Kreuter
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

Note: The QThread documentation is _wrong_ (again) as it has been for
years in the documentation and as i have reported:
https://bugreports.qt-project.org/browse/QTBUG-23635 I am specifically
talking about: http://qt-project.org/wiki/Threads_Events_QObjects#be502ae00ff1867ebe29398c0c9ec833

Strangely it also has the right way of using threads:
(under signals and slots..., last section there)

I logged in on the wiki, but apparently i'm not allowed to make edits.

Please add a big fat notice that subclassing QThread it not the
intended way of using QThread if you just want to have something
living it it's own thread. moveToThread should be used instead.

QThread worker;
MyClass data; // MyClass must inherit from QObject

(just out of my head, could contain typos and is obviously not working
but you get the idea)

More information about the Interest mailing list