[Question][Android] How to compile GStreamer in debug mode?
Hello,
In an Android project, in order to display a RTSP video stream, I am using GStreamer.
From the precompiled package available here, I produce shared object files using the following Android.mk file :
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := gstreamernative
LOCAL_SRC_FILES := gstreamernative.c
LOCAL_SHARED_LIBRARIES := gstreamer_android
LOCAL_LDLIBS := -llog -landroid
include $(BUILD_SHARED_LIBRARY)
ifndef GSTREAMER_ROOT_ANDROID
$(error GSTREAMER_ROOT_ANDROID is not defined!)
endif
ifeq ($(TARGET_ARCH_ABI),armeabi)
GSTREAMER_ROOT := $(GSTREAMER_ROOT_ANDROID)/arm
else ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
GSTREAMER_ROOT := $(GSTREAMER_ROOT_ANDROID)/armv7
else ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
GSTREAMER_ROOT := $(GSTREAMER_ROOT_ANDROID)/arm64
else ifeq ($(TARGET_ARCH_ABI),x86)
GSTREAMER_ROOT := $(GSTREAMER_ROOT_ANDROID)/x86
else ifeq ($(TARGET_ARCH_ABI),x86_64)
GSTREAMER_ROOT := $(GSTREAMER_ROOT_ANDROID)/x86_64
else
$(error Target arch ABI not supported: $(TARGET_ARCH_ABI))
endif
GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_ROOT)/share/gst-android/ndk-build/
include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_PLAYBACK) $(GSTREAMER_PLUGINS_CODECS) $(GSTREAMER_PLUGINS_NET) $(GSTREAMER_PLUGINS_SYS)
G_IO_MODULES := openssl
GSTREAMER_EXTRA_DEPS := gstreamer-video-1.0
include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk
and the following Application.mk file :
APP_ABI = armeabi-v7a arm64-v8a
APP_STL = c++_shared
RSTP streams work correctly on all Android versions. But when I want to read a specific HTTP video stream, it works on Android < 10 and crashes and Android 10+.
The stacktrace is not very explicit:
Fatal signal 11 (SIGSEV), code 1 (SEGV_MAPPER), fault addr 0xaaaaaaaaaaaaaaa in tid 2458 (souphttpsrc0:sr), pid 2334 (application.id)
#5 pc 00000000000e24a4 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: ceedf0f98da575de138b0c631aceca44)
#6 pc 0000000000083d98 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: ceedf0f98da575de138b0c631aceca44)
It is possible to modify the Android.mk or the Application.mk file in order to produce "debug" binaries of GStreamer and display more logs when the app stops working?
Thank you in advance for your help!