RSATom / QmlVlc

[ABANDONED] libvlc wrapper for Qt Quick 2/Qml
Other
139 stars 56 forks source link

Executed as a standalone qml file by qmlscene.exe failed #69

Open zsun14 opened 7 years ago

zsun14 commented 7 years ago

I try to use the qmlvlc plugin in standalone qml or pyqt project, but failed.

Environment: win10 + qt5.6 + mingw4.9-32 Build step: cd QmlVlc qmake , make , make install The QmlVlcPlugin.dll and qmldir are installed at "C:\Qt\Qt5.6.2\5.6\mingw49_32\qml\RSATom\QmlVlc"

Use the basic_2.qml in QmlVlcDemo, modify import QmlVlc 0.1 to import RSATom.QmlVlc 0.1

Run 'qmlscene.exe basic_2.qml'

We got the following output: file:///F:/workspace/QmlVlcDemo/skin/basic_2.qml:29 plugin cannot be loaded for module "RSATom.QmlVlc": Cannot install element 'VlcMediaListPlayer' into unregistered namespace 'QmlVlc' :-1 Cannot install element 'VlcPlayer' into unregistered namespace 'QmlVlc' :-1 Cannot install element 'VlcVideoSurface' into unregistered namespace 'QmlVlc' :-1 Cannot install element 'VlcMediaDesc' into unregistered namespace 'QmlVlc' :-1 Cannot install element 'VlcDeinterlace' into unregistered namespace 'QmlVlc' :-1 Cannot install element 'VlcLogo' into unregistered namespace 'QmlVlc' :-1 Cannot install element 'VlcMarquee' into unregistered namespace 'QmlVlc' :-1 Cannot install element 'VlcPlaylist' into unregistered namespace 'QmlVlc' :-1 Cannot install element 'VlcSubtitle' into unregistered namespace 'QmlVlc' :-1 Cannot install element 'VlcAudio' into unregistered namespace 'QmlVlc' :-1 Cannot install element 'VlcVideo' into unregistered namespace 'QmlVlc' :-1 Cannot install element 'VlcInput' into unregistered namespace 'QmlVlc' :-1 Cannot install element 'QmlVlcVideoSource' into unregistered namespace 'QmlVlc'

Any suggestion ? Thanks

RSATom commented 7 years ago

Using QmlVlc as plugin is not tested well. So very possible it's just a bug.

zsun14 commented 7 years ago

@RSATom Thanks for your quick reply. Since my goal it to play the rtsp video in pyqt+QML, so the key is to render the yuv on QQuickItme in python code. So I just translate the xxxMaterial, xxxShader, xxxNode class to python code based on pyqt and pyopengl, and it worked!

This QmlVlc plugin bug, it should be easy to add some log in the qqmlmetatype.cpp to see what happend of the namespace, but compiling will take some time. I will post it later.

zsun14 commented 7 years ago

@RSATom As pytqt 5.8 documented , the C++ plugin can be used in pyqt project, but seems no one cares ...

Qt allows plugins that implement QML modules to be written that can be dynamically loaded by a C++ application (e.g. qmlscene). These plugins are sub-classes of QQmlExtensionPlugin. PyQt5 supports exactly the same thing and allows those plugin to be written in Python. In other words it is possible to provide QML extensions written in Python to a C++ application, and to provide QML extensions written in C++ to a Python application.

RSATom commented 7 years ago

Yes, you just the first person who tried use it as plugin for long time...