playback/android: Update the sample application for GStreamer 1.14

Gradle was also updated to a more recent version. The x86_64 abi
is disabled temporarily due to build failures reported in:
https://bugzilla.gnome.org/show_bug.cgi?id=795454

https://bugzilla.gnome.org/show_bug.cgi?id=795456
This commit is contained in:
Philippe Normand 2018-04-22 11:48:24 +01:00
parent 3f29b46283
commit d6c033bf92
7 changed files with 37 additions and 10 deletions

View file

@ -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)'
```

View file

@ -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
}
}
}

View file

@ -7,7 +7,7 @@
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-feature android:glEsVersion="0x00020000"/>
<application android:label="@string/app_name">
<application android:theme="@style/Theme.AppCompat.Light" android:label="@string/app_name">
<activity android:name=".Play"
android:label="@string/app_name">
<!-- Files whose MIME type is known to Android -->

View file

@ -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;

View file

@ -25,7 +25,8 @@
#include <android/native_window.h>
#include <android/native_window_jni.h>
#include <gst/player/player.h>
#include <gst/player/gstplayer.h>
#include <gst/player/gstplayer-video-overlay-video-renderer.h>
GST_DEBUG_CATEGORY_STATIC (debug_category);
#define GST_CAT_DEFAULT debug_category

View file

@ -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

View file

@ -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