QMediaPlayer with QVideoProbe android
Unsolved
Mobile and Embedded
-
Hi, I have a problem with grab frames from QMediaPlayer with QVideoProbe
Look, I have MediaPlayer in QML:MediaPlayer { id: player objectName: "qmlPlayer" source: "qrc:/imgs/ebalo.mp4" } VideoOutput { id: output source: player x: 0 y: 0 anchors.fill : parent width: parent.width height: parent.height }
And i'm cast this into QMediaPlayer in qt side:
QQmlEngine * engin = QQmlEngine::contextForObject(this)->engine(); QQmlApplicationEngine *engine = qobject_cast<QQmlApplicationEngine*>(engin); QObject *qmlMedia = engine->rootObjects().at(0)->findChild<QObject*>("qmlPlayer"); player = qvariant_cast<QMediaPlayer *>(qmlMedia->property("mediaObject")); connect(&probe,&QVideoProbe::videoFrameProbed,this,&ClassBuilder::handleFrame); qDebug()<<probe.setSource(player)<<"player"<<player<<player->errorString(); probe.setSource(player);
QDebug output is: false player QMediaPlayer(0xbe1ac010) ""
why is setSource returns false?
Replacing the MediaPlayer with the QCamera everything works as it should, maybe grabbing frames via QVideoProbe from QMediaPlayer is not supported on android?