编译运行gstreamer android tutorials

下载gst-docs代码

gst-docs: https://github.com/GStreamer/gst-docs.git

修改的点

修改examples/tutorials/android/local.properties

增加sdk、ndk目录

sdk.dir=/home/hui/Android/Sdk
ndk.dir=/home/hui/Android/Sdk/ndk/21.3.6528147

新建examples/tutorials/android/gradle.properties

增加gstAndroidRoot环境变量

gstAndroidRoot=/home/hui/disk4t/codes/gstreamer-gstplayer/gstreamer/gstreamer-1.0-android-universal-1.19.3

修改tutorial下的每一个build.gradle

 android {
-    compileSdkVersion 23
+    compileSdkVersion 30
     buildToolsVersion '27.0.3'
 
     defaultConfig {
         applicationId "org.freedesktop.gstreamer.tutorials.tutorial_3"
         minSdkVersion 15
-        targetSdkVersion 15
+        targetSdkVersion 30
         versionCode 1
         versionName "1.0"


-   throw new GradleException('GSTREAMER_ROOT_ANDROID must be set, or "gstAndroidRoot" must be defined in your gradle.properties in the top level directory of the unpacked universal GStreamer Android binaries')
+   throw GradleException('GSTREAMER_ROOT_ANDROID must be set, or "gstAndroidRoot" must be defined in your gradle.properties in the top level directory of the unpacked universal GStreamer Android binaries')
 

下载gstreamer-android libs

下载gstreamer-1.0-android-universal-1.19.3解压到/home/hui/disk4t/codes/gstreamer-gstplayer/gstreamer/gstreamer-1.0-android-universal-1.19.3,前面gstAndroidRoot用的地址就是这个目录

下载地址:

https://gstreamer.freedesktop.org/data/pkg/android/1.19.3/gstreamer-1.0-android-universal-1.19.3.tar.xz

import到android studio后编译OK。

使用官网cerbero提供的编译方式也可以生成gstreamer-1.0-android-universal-1.19.3.tar.xz


上一篇:安卓源码


下一篇:(todo)Linux 内核:设备驱动模型(0)sysfs与kobject基类