diff --git a/playback/player/android/README.md b/playback/player/android/README.md new file mode 100644 index 0000000000..ba71782289 --- /dev/null +++ b/playback/player/android/README.md @@ -0,0 +1,24 @@ +# Android GStreamer sample player application + +## Build and deploy + +First of all you need to replace the gold linker with bfd in the `gst-android-1.14/armv7/share/gst-android/ndk-build/gstreamer-1.0.mk` +See also this [NDK issue](https://github.com/android-ndk/ndk/issues/337) + +Then to build and deploy the player app to your device, use a command similar to: + +```bash +$ GSTREAMER_ROOT_ANDROID=/path/to/gst-android-1.14/ PATH=~/dev/android/tools/bin:~/dev/android/ndk-bundle:$PATH ANDROID_HOME="$HOME/dev/android/" ./gradlew installDebug +``` + +## Run the application on the device + +```bash +$ adb shell am start -n org.freedesktop.gstreamer.play/.Play http://ftp.nluug.nl/pub/graphics/blender/demo/movies/Sintel.2010.720p.mkv +``` + +To see the GStreamer logs at runtime: + +```bash +$ adb logcat | egrep '(gst)' +``` diff --git a/playback/player/android/app/build.gradle b/playback/player/android/app/build.gradle index 48b718d6b2..c48b4073c7 100644 --- a/playback/player/android/app/build.gradle +++ b/playback/player/android/app/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 23 - buildToolsVersion "23.0.3" + buildToolsVersion '27.0.3' defaultConfig { applicationId "org.freedesktop.gstreamer.play" @@ -26,10 +26,11 @@ android { arguments "NDK_APPLICATION_MK=src/main/jni/Application.mk", "GSTREAMER_JAVA_SRC_DIR=src/main/java", "GSTREAMER_ROOT_ANDROID=$gstRoot", "GSTREAMER_ASSETS_DIR=src/main/assets" - targets "gstplayer", "gstreamer_android" + targets "gstplayer" // All archs except MIPS and MIPS64 are supported - abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' + abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86' + // x86_64 abis disabled because of https://bugzilla.gnome.org/show_bug.cgi?id=795454 } } } diff --git a/playback/player/android/app/src/main/AndroidManifest.xml b/playback/player/android/app/src/main/AndroidManifest.xml index 9823f22709..02966720d7 100644 --- a/playback/player/android/app/src/main/AndroidManifest.xml +++ b/playback/player/android/app/src/main/AndroidManifest.xml @@ -7,7 +7,7 @@ - + diff --git a/playback/player/android/app/src/main/java/org/freedesktop/gstreamer/player/Play.java b/playback/player/android/app/src/main/java/org/freedesktop/gstreamer/player/Play.java index ec6e5cfc17..10ba4b2eaf 100644 --- a/playback/player/android/app/src/main/java/org/freedesktop/gstreamer/player/Play.java +++ b/playback/player/android/app/src/main/java/org/freedesktop/gstreamer/player/Play.java @@ -24,7 +24,6 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; -import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; @@ -39,10 +38,11 @@ import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.TextView; import android.widget.Toast; +import android.support.v7.app.AppCompatActivity; import org.freedesktop.gstreamer.Player; -public class Play extends Activity implements SurfaceHolder.Callback, OnSeekBarChangeListener { +public class Play extends AppCompatActivity implements SurfaceHolder.Callback, OnSeekBarChangeListener { private PowerManager.WakeLock wake_lock; private Player player; diff --git a/playback/player/android/app/src/main/jni/player.c b/playback/player/android/app/src/main/jni/player.c index 769c75c96e..b1d78b2ee1 100644 --- a/playback/player/android/app/src/main/jni/player.c +++ b/playback/player/android/app/src/main/jni/player.c @@ -25,7 +25,8 @@ #include #include -#include +#include +#include GST_DEBUG_CATEGORY_STATIC (debug_category); #define GST_CAT_DEFAULT debug_category diff --git a/playback/player/android/build.gradle b/playback/player/android/build.gradle index a3330d4857..268076aa6d 100644 --- a/playback/player/android/build.gradle +++ b/playback/player/android/build.gradle @@ -3,9 +3,10 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.1.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/playback/player/android/gradle/wrapper/gradle-wrapper.properties b/playback/player/android/gradle/wrapper/gradle-wrapper.properties index fc500fd545..205e07cbee 100644 --- a/playback/player/android/gradle/wrapper/gradle-wrapper.properties +++ b/playback/player/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Aug 23 11:07:06 IST 2016 +#Sat Apr 21 19:58:19 WEST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip