RSATom / QmlVlc

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

Build-Problem with Android #42

Closed sk2212 closed 9 years ago

sk2212 commented 9 years ago

Hello RSATom,

QmlVLCDemo is running fine on my desktop system. So I try to compile it for Android ARM device. In build step I get following error message:

/home/s.frenzel/Downloads/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/home/s.frenzel/Downloads/android-ndk-r10e/platforms/android-9/arch-arm/ -Wl,-soname,libQmlVlcDemo.so -Wl,-rpath=/home/s.frenzel/Programs/Qt/Qt5.4.1/5.4/android_armv7/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -o libQmlVlcDemo.so QmlVlc.o QmlVlcConfig.o QmlVlcAudio.o QmlVlcDeinterlace.o QmlVlcInput.o QmlVlcLogo.o QmlVlcMarquee.o QmlVlcMedia.o QmlVlcPlayerProxy.o QmlVlcSurfacePlayerProxy.o QmlVlcPlayer.o QmlVlcPlaylist.o QmlVlcPositions.o QmlVlcSubtitle.o QmlVlcVideo.o QmlVlcVideoFrame.o QmlVlcVideoOutput.o QmlVlcVideoSurface.o SGVlcVideoNode.o QmlVlcMmVideoOutput.o QmlVlcMmPlayer.o vlc_vmem.o vlc_audio.o vlc_basic_player.o vlc_helpers.o vlc_player.o vlc_subtitles.o vlc_video.o vlc_media.o main.o qrc_main.o moc_QmlVlcConfig.o moc_QmlVlcAudio.o moc_QmlVlcDeinterlace.o moc_QmlVlcInput.o moc_QmlVlcLogo.o moc_QmlVlcMarquee.o moc_QmlVlcMedia.o moc_QmlVlcPlayerProxy.o moc_QmlVlcSurfacePlayerProxy.o moc_QmlVlcPlayer.o moc_QmlVlcPlaylist.o moc_QmlVlcSubtitle.o moc_QmlVlcVideo.o moc_QmlVlcVideoOutput.o moc_QmlVlcVideoSurface.o moc_QmlVlcMmVideoOutput.o moc_QmlVlcMmPlayer.o -L/home/s.frenzel/Downloads/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -L/home/s.frenzel/Downloads/android-ndk-r10e/platforms/android-9/arch-arm//usr/lib -lvlc -L/home/s.frenzel/Programs/Qt/Qt5.4.1/5.4/android_armv7/lib -lQt5Quick -L/opt/android/ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a -L/opt/android/ndk/platforms/android-9/arch-arm//usr/lib -lQt5Multimedia -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGLESv2 -lgnustl_shared -llog -lz -lm -ldl -lc -lgcc /home/s.frenzel/Downloads/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lvlc QmlVlcConfig.o:QmlVlcConfig.cpp:function QmlVlcConfig::releaseLibvlcInstance(libvlc_instance_t*): error: undefined reference to 'libvlc_release' QmlVlcConfig.o:QmlVlcConfig.cpp:function QmlVlcConfig::createLibvlcInstance(): error: undefined reference to 'libvlc_new' QmlVlcAudio.o:QmlVlcAudio.cpp:function QmlVlcAudio::description(unsigned int): error: undefined reference to 'libvlc_audio_get_track_description'

I think it is "only" a linker problem, right? What is missing?

Regards

RSATom commented 9 years ago

It seems It missing libvlc. I didn't try use it on Android, since I don't have it.

And read this please: https://github.com/RSATom/QmlVlc/issues/29

sk2212 commented 9 years ago

Okay...compiling :-). Will let you hear about my findings.

sk2212 commented 9 years ago

Finally I got it working!

What I have done:

I did not know whether that is the correct way but it seems that "ant" is not necessary to download if you have it already installed on your system "apt-get install ant". However the script stops when it cannot download "ant". So we simply remove the check:

After that we have a compiled "libvlcjni.so" file in "vlc-sdk/libs/armeabi-v7a". This is our "libvlc" file which we can use to compile "QmlVlcDemo" on an Android Device.

After that it shoud be possible to build and run the project "QmlVlcDemo".

Maybe you can add this steps to a Wiki or README Page, RSATom? I have double check the steps which I have descriped here. It should work!

The performance is very good! NO stutter, NO sync problems. I run "Live TV" from an Set Up Box over UPNP.

Regards, Sandro

RSATom commented 9 years ago

It's great! Thank you very much Sandro!

Maybe you can add this steps to a Wiki or README Page, RSATom?

You could do it yourself :) Wiki for this project is open to edit by anyone. So fill free to do it - just please do it as separate article.

The performance is very good! NO stutter, NO sync problems.

Hm... This sounds very strange to me. What hardware do you use?

sk2212 commented 9 years ago

Alright :-).

Strange? Why?

I tested it on an "old" Rockchip RK30 based Tablet with a 1,8GHz Quadcore processor using Android 4.2.2 and on a Nexus 4 with Android 5.1.1

On both devices - no problems.

RSATom commented 9 years ago

Just because guys at https://github.com/RSATom/QmlVlc/issues/29 complained on performance of QmlVlc on Android, and if take in to account I never event try it run on Android, so I really surprised it works well :) Maybe it's just some difference between tablets vs phones in performance, don't know.

RSATom commented 9 years ago

Anyway, thank you for your effort!

sk2212 commented 9 years ago

The Nexus 4 is a phone ;-).

However it seems that there are performance issues when running 1080p content. So the guy from #29 is right.

Maybe it is because of the old libvlc version for Android. There must be a way to compile it without going back to "git checkout b01969a4bfe1b2fa4580f5e8df08dc29566d7a16".

Anyway...for a prove of concept that THERE IS a way to get it working on an Android device I will create a Wiki-Page.

RSATom commented 9 years ago

The Nexus 4 is a phone ;-)

Yes, I know :) but it's not low level phone. It's pretty powerful.

Anyway...for a prove of concept that THERE IS a way to get it working on an Android device I will create a Wiki-Page.

Or course, please do it. It will be useful.

sk2212 commented 9 years ago

Hmmm...just tried it with latest revision from android-vlc git repository. I was able to compile it. No idea what was wrong last time. However building is fine but trying to start app leads to following error:

D/dalvikvm(16780): GC_CONCURRENT freed 250K, 7% free 4241K/4520K, paused 3ms+2ms, total 18ms D/dalvikvm(16780): Trying to load lib /data/data/org.qtproject.example.QmlVlcDemo/lib/libgnustl_shared.so 0x41100218 D/dalvikvm(16780): Added shared lib /data/data/org.qtproject.example.QmlVlcDemo/lib/libgnustl_shared.so 0x41100218 D/dalvikvm(16780): No JNI_OnLoad found in /data/data/org.qtproject.example.QmlVlcDemo/lib/libgnustl_shared.so 0x41100218, skipping init D/dalvikvm(16780): Trying to load lib /data/data/org.qtproject.example.QmlVlcDemo/lib/libvlcjni.so 0x41100218 D/dalvikvm(16780): Added shared lib /data/data/org.qtproject.example.QmlVlcDemo/lib/libvlcjni.so 0x41100218 E/VLC/JNI/VLCObject(16780): FindClass(org/videolan/libvlc/LibVLC) failed W/dalvikvm(16780): JNI_OnLoad returned bad version (-1) in /data/data/org.qtproject.example.QmlVlcDemo/lib/libvlcjni.so 0x41100218 W/System.err(16780): java.lang.reflect.InvocationTargetException

RSATom commented 9 years ago

for me it's like it can't load libvlc module.

sk2212 commented 9 years ago

Hmm...I did not get it to work. However the guy from #29 already points out that there is a problem in

void QSGVlcVideoFrameMaterial::bindPlane( GLenum texUnit, GLuint texId, const void* plane, quint16 width, quint16 height )

of QmlVlc.

I have not so good C++ knowledges but it must be possible to use another method than "glTexImage2D".

https://vec.io/posts/faster-alternatives-to-glreadpixels-and-glteximage2d-in-opengl-es

Maybe you have time to implement it?

RSATom commented 9 years ago

Maybe you have time to implement it?

I've already mentioned it's will be good to implement support of PBO or EGLImage inside QmlVlc. And I want do it long time. The problem is - I don't have any android device to test it on.

sk2212 commented 9 years ago

Well...I can help you with this "problem" :-). But maybe we can clarify this about direct mail contact?

RSATom commented 9 years ago

hm... interesting :) My mail is not secret, and you are free write me directly if it has a meaning: rsatom at gmail dot com

RSATom commented 9 years ago

it was fixed some time ago