Create vp8 on Android

I am trying to create a vp8 codec for Android. I ran the configure.sh script and makefile for armv6 with sourcery g ++, which successfully created libvpx.so. After that, I wrote a JNI wrapper and compiled it using ndk-build. When I run this on a Gingerbread smartphone, I got UnsatisfiedLinkError "libpthread.so.0 not found". How can I get rid of this error?

+6
source share
2 answers

From http://git.chromium.org/gitweb/?p=webm/bindings.git;a=blob_plain;f=JNI/README.Android with some settings for readability.

  • Create the folder {project} / jni.

  • Get JNI bindings.

    git clone https://chromium.googlesource.com/webm/bindings

  • Get libvpx.

    git clone https://chromium.googlesource.com/webm/libvpx

  • Configuring libvpx for Android

    ./libvpx/configure --target = armv7-android-gcc -disable-examples -sdk-path = {path to NDK}

    --sdk-path MUST be absolute.

  • Get libwebm.

    cd / jni bindings

    git clone https://chromium.googlesource.com/webm/libwebm

  • Get libogg.

    Download the ogg code from http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz

    Extract to Bindings / JNI.

  • We need to run configure to create config_types.h.

    cd libogg-1.3.0 & &. / configure && & cd ..

  • Get libvorbis

    Download vorbis code from http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz

    Extract to Bindings / JNI.

  • Get libyuv

    svn checkout http://libyuv.googlecode.com/svn/trunk/ libyuv-read-only

  • Create {project} /jni/Application.mk with the following data:

     APP_ABI := armeabi-v7a APP_OPTIM := release APP_STL := gnustl_static APP_CPPFLAGS := -frtti 
  • Create {project} /jni/Android.mk with the data below:

     WORKING_DIR := $(call my-dir) BINDINGS_DIR := $(WORKING_DIR)/bindings/JNI include $(BINDINGS_DIR)/Android.mk 
  • Create the JNI code.

    {path to NDK} / ndk-build

  • Copy the Java code.

    cp -R bindings / JNI / com / google ../ src / com /

  • Add code to check bindings.

     int[] major = new int[2]; int[] minor = new int[2]; int[] build = new int[2]; int[] revision = new int[2]; MkvMuxer.getVersion(major, minor, build, revision); String outStr = "libwebm:" + Integer.toString(major[0]) + "." + Integer.toString(minor[0]) + "." + Integer.toString(build[0]) + "." + Integer.toString(revision[0]); System.out.println(outStr); 
  • Launch the app. You should see the release of the libwebm version.

  • Underline as necessary. VP8 wrappers are in the com.google.libvpx namespace.

+9
source

Sometimes this can be a problem with SONAME in the shared library, take a look at this article.

http://groups.google.com/group/android-ndk/browse_thread/thread/fd484da512650359

You can disable pthreads if you really don't need them.

Iv had problems with .so files in the past and avoided all these problems using .a static libraries instead of .so shared libraries

0
source

Source: https://habr.com/ru/post/898511/


All Articles