[Interest] QVideoProbe Woes

Jason H scorp1us at yahoo.com
Fri Feb 7 15:30:44 CET 2014

Well I am please, and confused at the same time. It works, but I have concerns.

1. I'm trying to work with video here. you keep mentioning audio, but how does QVideoProbe work with audio-derived classes?
2. When:
2a. using a Video element I try the code you supplied player is null after the cast. 
2b. using a MediaPlayer element, it works and i get frames!
2c. using (passing) a Camera element as sourceObj, what will happen?

 From: Lopes Yoann <Yoann.Lopes at digia.com>
To: Jason H <scorp1us at yahoo.com> 
Cc: Interests Qt <interest at qt-project.org> 
Sent: Friday, February 7, 2014 7:05 AM
Subject: Re: [Interest] QVideoProbe Woes

On Feb 6, 2014, at 10:07 PM, Jason H wrote:

So I made a basic wrapper class (included below) for QVideoProbe to expose it to QML. I can set the source property, but when I do it reports it gets a QDeclaritiveAudio class instance, ans the setSource() call fails. How can I get the video part of it?

The reason is that both the MediaPlayer and Audio QML types are backed by the QDeclarativeAudio C++ class...
What you need is the QMediaPlayer instance, you can get it with the 'mediaObject' property of QDeclarativeAudio:

VideoProbe::setSource(QObject* sourceObj)
QMediaPlayer *player = qvariant_cast<QMediaPlayer*>(sourceObj->property("mediaObject"));

Yoann Lopes
Senior Software Engineer - Digia, Qt
Visit us on: http://qt.digia.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140207/a5ed63bc/attachment.html>

More information about the Interest mailing list