[Interest] Video Filters on Android

René Hansen renehh at gmail.com
Wed Apr 4 19:29:26 CEST 2018


I don't have a Pixel myself, but have you checked that OpenCL isn't rolled
up into */vendor/lib/egl/libEGL_adreno.so*. I know that is the case for
some phones with Mali chipsets at least. Here's a list of *cl* symbols from
one I pulled from a Samsung Galaxy S7:

$
~/Code/Android/android-ndk-r10e/toolchains/x86_64-4.9/prebuilt/darwin-x86_64/bin/x86_64-linux-android-nm
-D ~/Code/Android/samsunggalaxys7/lib/egl/libGLES_mali.so | ag '\bcl[A-Z]'
006823a0 T clBuildProgram
00682584 T clCompileProgram
006808d0 T clCreateBuffer
00688078 T clCreateBufferFromEGLImageARM
00680568 T clCreateCommandQueue
0067fe18 T clCreateContext
006801b4 T clCreateContextFromType
00687db4 T clCreateEventFromEGLSyncKHR
00687e94 T clCreateFromEGLImageKHR
00686f68 T clCreateFromGLBuffer
00687784 T clCreateFromGLRenderbuffer
00687140 T clCreateFromGLTexture
00687398 T clCreateFromGLTexture2D
0068758c T clCreateFromGLTexture3D
00680dc0 T clCreateImage
006816ac T clCreateImage2D
0068176c T clCreateImage3D
00682c24 T clCreateKernel
00682ce0 T clCreateKernelsInProgram
00682008 T clCreateProgramWithBinary
006821dc T clCreateProgramWithBuiltInKernels
00681ef8 T clCreateProgramWithSource
00681c8c T clCreateSampler
00680adc T clCreateSubBuffer
00680148 T clCreateSubDevices
00683334 T clCreateUserEvent
00688244 T clEnqueueAcquireEGLObjectsKHR
00687a04 T clEnqueueAcquireGLObjects
00686cbc T clEnqueueBarrier
00686ae8 T clEnqueueBarrierWithWaitList
006841d8 T clEnqueueCopyBuffer
00684414 T clEnqueueCopyBufferRect
00685828 T clEnqueueCopyBufferToImage
00685098 T clEnqueueCopyImage
006854e4 T clEnqueueCopyImageToBuffer
00683fec T clEnqueueFillBuffer
00684e7c T clEnqueueFillImage
00685b6c T clEnqueueMapBuffer
00685dfc T clEnqueueMapImage
00686b98 T clEnqueueMarker
00686a38 T clEnqueueMarkerWithWaitList
006862d0 T clEnqueueMigrateMemObjects
00686460 T clEnqueueNDRangeKernel
00686794 T clEnqueueNativeKernel
0068365c T clEnqueueReadBuffer
00683820 T clEnqueueReadBufferRect
0068476c T clEnqueueReadImage
00688414 T clEnqueueReleaseEGLObjectsKHR
00687bdc T clEnqueueReleaseGLObjects
00686688 T clEnqueueTask
006861c0 T clEnqueueUnmapMemObject
00686c00 T clEnqueueWaitForEvents
00683b20 T clEnqueueWriteBuffer
00683ce4 T clEnqueueWriteBufferRect
00684af4 T clEnqueueWriteImage
00683614 T clFinish
006835cc T clFlush
0068078c T clGetCommandQueueInfo
006804e4 T clGetContextInfo
0067fd04 T clGetDeviceIDs
0067fda8 T clGetDeviceInfo
006832ac T clGetEventInfo
00683548 T clGetEventProfilingInfo
00686d3c T clGetExtensionFunctionAddress
00686d14 T clGetExtensionFunctionAddressForPlatform
00686d4c T clGetGLContextInfoKHR
00687940 T clGetGLObjectInfo
00687988 T clGetGLTextureInfo
00681b20 T clGetImageInfo
006830bc T clGetKernelArgInfo
00683034 T clGetKernelInfo
00683140 T clGetKernelWorkGroupInfo
00681a9c T clGetMemObjectInfo
0067fc58 T clGetPlatformIDs
0067fca4 T clGetPlatformInfo
00682b64 T clGetProgramBuildInfo
00682adc T clGetProgramInfo
00681e70 T clGetSamplerInfo
006818bc T clGetSupportedImageFormats
0067fca0 T clIcdGetPlatformIDsKHR
006885e0 T clImportMemoryARM
00682834 T clLinkProgram
00680744 T clReleaseCommandQueue
0068049c T clReleaseContext
00680190 T clReleaseDevice
00683420 T clReleaseEvent
00682db0 T clReleaseKernel
00681874 T clReleaseMemObject
00682358 T clReleaseProgram
00681e28 T clReleaseSampler
006806fc T clRetainCommandQueue
00680454 T clRetainContext
0068016c T clRetainDevice
006833d8 T clRetainEvent
00682d68 T clRetainKernel
0068182c T clRetainMemObject
00682310 T clRetainProgram
00681de0 T clRetainSampler
00680814 T clSetCommandQueueProperty
006834cc T clSetEventCallback
00682df8 T clSetKernelArg
00681c28 T clSetMemObjectDestructorCallback
00683468 T clSetUserEventStatus
00682ad4 T clUnloadCompiler
00682ab8 T clUnloadPlatformCompiler
00683240 T clWaitForEvents

I haven't actually found out how to properly link against the _<chipset>
named libs yet however, because it seems when running a Qt based app,
Dalvik only provides /system/lib and /vendor/lib as library load paths and
not /vendor/lib/egl. I sent another mail to the list regarding this
specific issue a couple of days ago, but no-one has answered it yet.


/René Hansen

On Wed, 4 Apr 2018 at 19:21 Jason H <jhihn at gmx.com> wrote:

>  I should find it there yes. But the irony is that I can't find it
> anywhere. Meanwhile the Samsung has it where you would expect. I'm looking
> for an OpenGL for it, but the Adreno SDK doesn't have it. Any idea where I
> mght find it?
>
> Many thanks.
>
> taimen:/ $ find . -name *CL*  2> /dev/null
> ./system/usr/srec/en-US/CLG.prewalk.fst
>
> 1|taimen:/ $ find . -name *GL*  2> /dev/null
> ./sys/bus/platform/drivers/GLINK_CTRL
> ./system/lib/libGLESv1_CM.so
> ./system/lib/libGLESv3.so
> ./system/lib/libGLESv2.so
> ./system/lib/libEGL.so
> ./system/lib64/libGLESv1_CM.so
> ./system/lib64/libGLESv3.so
> ./system/lib64/libGLESv2.so
> ./system/lib64/libEGL.so
> ./vendor/lib/egl/libGLESv2_adreno.so
> ./vendor/lib/egl/libEGL_adreno.so
> ./vendor/lib/egl/libGLESv1_CM_adreno.so
> ./vendor/lib64/egl/libGLESv2_adreno.so
> ./vendor/lib64/egl/libEGL_adreno.so
> ./vendor/lib64/egl/libGLESv1_CM_adreno.so
>
> Vs. Samsung:
>
> 1|dream2lte:/ $ find . -name *GL*  2> /dev/null
> ./system/lib/egl/libGLES_android.so
> ./system/lib/libEGL.so
> ./system/lib/libGLESv1_CM.so
> ./system/lib/libGLESv2.so
> ./system/lib/libGLESv3.so
> ./system/lib/libSEC_EGL.so
> ./system/lib64/egl/libGLES_android.so
> ./system/lib64/libEGL.so
> ./system/lib64/libGLESv1_CM.so
> ./system/lib64/libGLESv2.so
> ./system/lib64/libGLESv3.so
> ./system/lib64/libSEC_EGL.so
> ./system/vendor/lib/egl/libGLES_mali.so
>
> ./system/vendor/lib64/egl/libGLES_mali.so
> 1|dream2lte:/ $ find . -name *enCL*  2> /dev/null
> ./system/vendor/lib/libOpenCL.so.1.1
> ./system/vendor/lib/libOpenCL.so
> ./system/vendor/lib/libOpenCL.so.1
> ./system/vendor/lib64/libOpenCL.so.1.1
> ./system/vendor/lib64/libOpenCL.so
> ./system/vendor/lib64/libOpenCL.so.1
>
> *Sent:* Wednesday, April 04, 2018 at 12:07 PM
>
> *From:* "René Hansen" <renehh at gmail.com>
> *To:* "Jason H" <jhihn at gmx.com>
> *Cc:* "interestqt-project.org" <interest at qt-project.org>
> *Subject:* Re: [Interest] Video Filters on Android
> You'll probably find it at */vendor/lib/libOpenCL.so.*
>
> I'm not sure which version of OpenGL ES you need, but you have both
> versions available to link against using the NDK at least.
>
> I've been wanting to do a writeup on the whole QML videofilter -> OpenCL
> pipeline through shared GL context, but haven't really found the time.
> There's not that many great examples to go by out there for Android and it
> seems to me at least, that it's a bit of a greenfield effort, even though
> the Qt guys have put in some great initial building blocks.
>
>
> /René
>
>
>
> On Wed, 4 Apr 2018 at 17:30 Jason H <jhihn at gmx.com> wrote:
>
>> Thanks! I'm trying to do this on a Pixel 2 XL, but there is no
>> libOpenCL.so on it! (directory listing included later)
>>
>> I'm searching for it. I'm looking at the Aredno SDK,
>>
>> I'm sort of at a loss for what all I need to include for android. You
>> mention GLESv2, but you also mention v3.
>>
>> taimen:/system/lib $ ls -1 lib*
>> lib-imsvideocodec.so
>> lib-imsvt.so
>> lib-imsvtextutils.so
>> lib-imsvtutils.so
>> libEGL.so
>> libETC1.so
>> libFFTEm.so
>> libGLESv1_CM.so
>> libGLESv2.so
>> libGLESv3.so
>> libOpenMAXAL.so
>> libOpenSLES.so
>> libRS.so
>> libRSCacheDir.so
>> libRSCpuRef.so
>> libRSDriver.so
>> libRS_internal.so
>> libRScpp.so
>> libaaudio.so
>> libaaudioservice.so
>> libandroid.so
>> libandroid_net.so
>> libandroid_runtime.so
>> libandroid_servers.so
>> libandroidfw.so
>> libappfuse.so
>> libart-compiler.so
>> libart-dexlayout.so
>> libart.so
>> libaudio-resampler.so
>> libaudioclient.so
>> libaudioeffect_jni.so
>> libaudioflinger.so
>> libaudiohal.so
>> libaudiomanager.so
>> libaudiopolicyenginedefault.so
>> libaudiopolicymanager.so
>> libaudiopolicymanagerdefault.so
>> libaudiopolicyservice.so
>> libaudioprocessing.so
>> libaudiospdif.so
>> libaudioutils.so
>> libbacktrace.so
>> libbase.so
>> libbcinfo.so
>> libbinder.so
>> libblas.so
>> libc++.so
>> libc.so
>> libc_malloc_debug.so
>> libcamera2ndk.so
>> libcamera_client.so
>> libcamera_metadata.so
>> libcameraservice.so
>> libchrome.so
>> libclcore.bc
>> libclcore_debug.bc
>> libclcore_debug_g.bc
>> libclcore_g.bc
>> libclcore_neon.bc
>> libcompiler_rt.so
>> libcrypto.so
>> libcutils.so
>> libdebuggerd_client.so
>> libdiag_system.so
>> libdl.so
>> libdmengine.so
>> libdmjavaplugin.so
>> libdng_sdk.so
>> libdrmframework.so
>> libdrmframework_jni.so
>> libdvr.so
>> libdvr_loader.so
>> libeaselcomm.so
>> libeffectsconfig.so
>> libevent.so
>> libexif.so
>> libexpat.so
>> libfilterfw.so
>> libfilterpack_facedetect.so
>> libfilterpack_imageproc.so
>> libfmq.so
>> libfrsdk.so
>> libft2.so
>> libgatekeeper.so
>> libgraphicsenv.so
>> libgui.so
>> libhardware.so
>> libhardware_legacy.so
>> libharfbuzz_ng.so
>> libheif.so
>> libhidlbase.so
>> libhidlmemory.so
>> libhidltransport.so
>> libhwbinder.so
>> libhwui.so
>> libicui18n.so
>> libicuuc.so
>> libimg_utils.so
>> libimscamera_jni.so
>> libimsmedia_jni.so
>> libinput.so
>> libinputflinger.so
>> libinputservice.so
>> libiprouteutil.so
>> libjavacore.so
>> libjavacrypto.so
>> libjnigraphics.so
>> libjpeg.so
>> libkeystore_binder.so
>> libldacBT_abr.so
>> libldacBT_enc.so
>> liblog.so
>> liblz4.so
>> liblzma.so
>> libm.so
>> libmdnssd.so
>> libmedia.so
>> libmedia_helper.so
>> libmedia_jni.so
>> libmedia_omx.so
>> libmediadrm.so
>> libmedialogservice.so
>> libmediametrics.so
>> libmediandk.so
>> libmediaplayerservice.so
>> libmediautils.so
>> libmemtrack.so
>> libmemunreachable.so
>> libmidi.so
>> libminikin.so
>> libmtp.so
>> libnativebridge.so
>> libnativehelper.so
>> libnativeloader.so
>> libnativewindow.so
>> libnbaio.so
>> libnetd_client.so
>> libnetlink.so
>> libnetutils.so
>> libneuralnetworks.so
>> libnl.so
>> libopenjdk.so
>> libopenjdkjvm.so
>> libopenjdkjvmti.so
>> libopus.so
>> libpac.so
>> libpackagelistparser.so
>> libpcre2.so
>> libpdfium.so
>> libpiex.so
>> libpixelflinger.so
>> libpng.so
>> libpower.so
>> libpowermanager.so
>> libprocessgroup.so
>> libprocinfo.so
>> libprotobuf-cpp-full.so
>> libprotobuf-cpp-lite.so
>> libradio_metadata.so
>> librcc.so
>> libresourcemanagerservice.so
>> librs_jni.so
>> librtp_jni.so
>> libschedulerservicehidl.so
>> libselinux.so
>> libsensor.so
>> libsensorservice.so
>> libsensorservicehidl.so
>> libserviceutility.so
>> libsigchain.so
>> libskia.so
>> libsoftkeymaster.so
>> libsonic.so
>> libsonivox.so
>> libsoundpool.so
>> libsoundtrigger.so
>> libsoundtriggerservice.so
>> libspeexresampler.so
>> libsqlite.so
>> libssl.so
>> libstagefright.so
>> libstagefright_amrnb_common.so
>> libstagefright_enc_common.so
>> libstagefright_flacdec.so
>> libstagefright_foundation.so
>> libstagefright_http_support.so
>> libstagefright_httplive.so
>> libstagefright_omx.so
>> libstagefright_omx_utils.so
>> libstagefright_soft_aacdec.so
>> libstagefright_soft_aacenc.so
>> libstagefright_soft_amrdec.so
>> libstagefright_soft_amrnbenc.so
>> libstagefright_soft_amrwbenc.so
>> libstagefright_soft_avcdec.so
>> libstagefright_soft_avcenc.so
>> libstagefright_soft_flacdec.so
>> libstagefright_soft_flacenc.so
>> libstagefright_soft_g711dec.so
>> libstagefright_soft_gsmdec.so
>> libstagefright_soft_hevcdec.so
>> libstagefright_soft_mp3dec.so
>> libstagefright_soft_mpeg2dec.so
>> libstagefright_soft_mpeg4dec.so
>> libstagefright_soft_mpeg4enc.so
>> libstagefright_soft_opusdec.so
>> libstagefright_soft_rawdec.so
>> libstagefright_soft_vorbisdec.so
>> libstagefright_soft_vpxdec.so
>> libstagefright_soft_vpxenc.so
>> libstagefright_wfd.so
>> libstagefright_xmlparser.so
>> libstdc++.so
>> libsurfaceflinger.so
>> libsurfaceflinger_ddmconnection.so
>> libsuspend.so
>> libsync.so
>> libsysutils.so
>> libtextclassifier.so
>> libtextclassifier_hash.so
>> libtinyxml2.so
>> libtombstoned_client.so
>> libui.so
>> libunwind.so
>> libusbhost.so
>> libutils.so
>> libvintf.so
>> libvixl-arm.so
>> libvixl-arm64.so
>> libvndksupport.so
>> libvorbisidec.so
>> libvulkan.so
>> libwebviewchromium_loader.so
>> libwebviewchromium_plat_support.so
>> libwifi-service.so
>> libwilhelm.so
>> libxml2.so
>> libz.so
>> libziparchive.so
>>
>>
>> *Sent:* Wednesday, April 04, 2018 at 4:54 AM
>> *From:* "René Hansen" <renehh at gmail.com>
>> *To:* "Jason H" <jhihn at gmx.com>
>> *Cc:* "interestqt-project.org" <interest at qt-project.org>
>> *Subject:* Re: [Interest] Video Filters on Android
>> I never got that specific example to work, but assuming you're building
>> with the Android NDK, you can include:
>>
>> #include <GLES2/gl2.h>
>> #include <EGL/egl.h>
>>
>> Which will give you access to *eglGetCurrentContext()*.
>>
>> I'm using the r10e ndk, since that's what works with Qt at the moment.
>> GLES v3 is available in toolchain v21:
>>
>> $ ls
>> ~/Code/Android/android-ndk-r10e//platforms/android-21/arch-arm/usr/lib/
>> crtbegin_dynamic.o      libGLESv2.so            libdl.so
>> libstdc++.a
>> crtbegin_so.o           libGLESv3.so            libjnigraphics.so
>>  libstdc++.so
>> crtbegin_static.o       libOpenMAXAL.so         liblog.so
>>  libthread_db.so
>> crtend_android.o        libOpenSLES.so          libm.a
>> libz.a
>> crtend_so.o             libandroid.so           libm.so
>>  libz.so
>> libEGL.so               libc.a                  libm_hard.a             rs
>> libGLESv1_CM.so         libc.so                 libmediandk.so
>>
>> If you want to link against OpenCL, you still need to pull a
>> *libOpenCL.so* from an actual device though.
>>
>>
>> /René
>>
>> On Wed, 4 Apr 2018 at 01:52 Jason H <jhihn at gmx.com> wrote:
>>
>>>
>>> http://blog.qt.io/blog/2015/03/20/introducing-video-filters-in-qt-multimedia/
>>> announced video filter support, and hardware accelerated too!
>>>
>>> Code:
>>> http://code.qt.io/cgit/qt/qtmultimedia.git/tree/examples/multimedia/video/qmlvideofilter_opencl
>>>
>>> I'm trying to get it running on Android, but I'm going down a rabbit
>>> hole with OpenCL 2.0 and EGL 3.2. I have been hacking on it but I don't
>>> know where EGLContext is declared.
>>>
>>> Had anyone gotten this running in Android?
>>>
>>> Thanks!
>>> _______________________________________________
>>> Interest mailing list
>>> Interest at qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180404/a8e819a7/attachment.html>


More information about the Interest mailing list