Search code examples
androidqtvideo-captureartoolkit

How to use ARTOOLKIT LIBRARY ON ANDROID on Qt 5.6 ?


I would like to get videocapture with artoolkit library in order to do image processing on android. I do it on Qt5.6. So i would use native (c++) part for processing and java part to get videocapture( get frames).
In the official website they sais :

Android does not currently permit camera access from native code. Instead, only Java code can open the camera and capture frames. Additionally, a live camera preview must be included in the current Activity’s view for frames to be captured. This means that ARToolKit itself cannot initiate video capture, but must instead wait on the Java application to pass video information and frames using JNI.

I found no documentation about it even in the official website.

I'am ready to take any advice or links. Thanks guys,


Solution

  • I have successfully integrate the library (artoolkit) on qt and add libNative in the projet ( /android/libs/arm-v7a). This is my pro file on Qt.

    #-------------------------------------------------
    #
    # Project created by QtCreator 2016-06-28T11:45:46
    #   Ismaila Diallo ARTOOLKIT LIBRARY FOR ANDROID
    #-------------------------------------------------
    
    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = ArtoolkitCamera
    TEMPLATE = app
    
    
    SOURCES += main.cpp\
          ARNative.cpp
    
    HEADERS  += ARNative.h
    
    FORMS    += mainwindow.ui
    
     CONFIG += mobility
     MOBILITY = 
    
    INCLUDEPATH += "/home/diallo/ArTool/include"
      android {
       LIBS += \
        -L"/home/diallo/ArTool/android/obj/local/armeabi-v7a"\
        -lar\
        -lar2\
        -largsub_es\
        -largsub_es2\
        -laricp\
        -larmulti\
        -larosg\
        -larvideo\
        -lcpufeatures\
        -leden\
        -lft2\
        -lgif\
        -ljpeg\
        -lkpm\
        -lOpenThreads\
        -losg\
        -losgAnimation\
        -losgDB\
        -losgdb_3dc\
        -losgdb_ac\
        -losgdb_bmp\
        -losgdb_bsp\
        -losgdb_bvh\
        -losgdb_cfg\
        -losgdb_curl\
        -losgdb_dds\
        -losgdb_deprecated_osg\
        -losgdb_deprecated_osganimation\
        -losgdb_deprecated_osgfx\
        -losgdb_deprecated_osgparticle\
        -losgdb_deprecated_osgshadow\
        -losgdb_deprecated_osgsim\
        -losgdb_deprecated_osgterrain\
        -losgdb_deprecated_osgtext\
        -losgdb_deprecated_osgviewer\
        -losgdb_deprecated_osgvolume\
        -losgdb_deprecated_osgwidget\
        -losgdb_dot\
        -losgdb_dw\
        -losgdb_dxf\
        -losgdb_freetype\
        -losgdb_gif\
        -losgdb_glsl\
        -losgdb_hdr\
        -losgdb_ive\
        -losgdb_jpeg\
        -losgdb_ktx\
        -losgdb_logo\
        -losgdb_lwo\
        -losgdb_lws\
        -losgdb_md2\
        -losgdb_mdl\
        -losgdb_normals\
        -losgdb_obj\
        -losgdb_openflight\
        -losgdb_osc\
        -losgdb_osg\
        -losgdb_osga\
        -losgdb_osgshadow\
        -losgdb_osgterrain\
        -losgdb_osgtgz\
        -losgdb_osgviewer\
        -losgdb_p3d\
        -losgdb_pic\
        -losgdb_ply\
        -losgdb_png\
        -losgdb_pnm\
        -losgdb_pov\
        -losgdb_pvr\
        -losgdb_revisions\
        -losgdb_rgb\
        -losgdb_rot\
        -losgdb_scale\
        -losgdb_serializers_osg\
        -losgdb_serializers_osganimation\
        -losgdb_serializers_osgfx\
        -losgdb_serializers_osgga\
        -losgdb_serializers_osgmanipulator\
        -losgdb_serializers_osgparticle\
        -losgdb_serializers_osgshadow\
        -losgdb_serializers_osgsim\
        -losgdb_serializers_osgterrain\
        -losgdb_serializers_osgtext\
        -losgdb_serializers_osgviewer\
        -losgdb_serializers_osgvolume\
        -losgdb_shp\
        -losgdb_stl\
        -losgdb_tga\
        -losgdb_tgz\
        -losgdb_tiff\
        -losgdb_trans\
        -losgdb_trk\
        -losgdb_txf\
        -losgdb_txp\
        -losgdb_vtf\
        -losgdb_x\
        -losgFX\
        -losgGA\
        -losgManipulator\
        -losgParticle\
        -losgPresentation\
        -losgShadow\
        -losgSim\
        -losgTerrain\
        -losgText\
        -losgUtil\
        -losgViewer\
        -losgVolume\
        -losgWidget\
        -lpng\
        -ltiff\
        -lutil
    
           }
    
    DISTFILES += \
    android/AndroidManifest.xml \
    android/gradle/wrapper/gradle-wrapper.jar \
    android/gradlew \
    android/res/values/s.xml \
    android/build.gradle \
    android/gradle/wrapper/gradle-wrapper.properties \
    android/gradlew.bat \
    
    android/libs/libARNative.so
    

    ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android

    I have already Java files for video capturing ( 4 java files ). As i said in the last post, Android capture videoframe in the java part and pass information about frames by using JNI on Qt.

    My question ? How to add Java files on Qt project and make them working ? I already try but i have package problem cause my application does not use the same. How can i solve it ?