``Hi ,
Thank you for trying. I'm working on it. Now I have some problems. Can we discuss them together?
I am currently building with the following versions
NDK: 21.4.7075529
Gstreamer: 1.22.7
SDK: 32
During this build, I ran into problems with “undefined reference to gst_photography_get_type' and ”undefined reference togst_photography_set_autofocus' in function `gst_native_set_auto_focus'。
I'm stuck here and don't know how to proceed.
This is my Android.mk and Application.mk and build. Gradle
Please help me! Thank you!
Android.mk:
`LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CFLAGS := -DGST_USE_UNSTABLE_API
``Hi , Thank you for trying. I'm working on it. Now I have some problems. Can we discuss them together? I am currently building with the following versions NDK: 21.4.7075529 Gstreamer: 1.22.7 SDK: 32
During this build, I ran into problems with “undefined reference to
gst_photography_get_type' and ”undefined reference to
gst_photography_set_autofocus' in function `gst_native_set_auto_focus'。I'm stuck here and don't know how to proceed. This is my Android.mk and Application.mk and build. Gradle Please help me! Thank you!
Android.mk: `LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) LOCAL_CFLAGS := -DGST_USE_UNSTABLE_API
设置源文件
LOCAL_MODULE :=android_camera LOCAL_SRC_FILES := android_camera.c dummy.cpp LOCAL_SHARED_LIBRARIES := gstreamer_android
添加 GStreamer 库
LOCAL_LDLIBS += -landroid -ldl -llog include $(BUILD_SHARED_LIBRARY)
GST_V4L2_USE_LIBV4L2 := 1
设置你的 GStreamer 路径
GSTREAMER_ROOT_PATH := D:\CodeRepo\AndroidProject\gstreamer-1.0-android-universal-1.22.7
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_ENCODING) androidmedia videofilter openh264 flac opensles opengl $(GSTREAMER_PLUGINS_NET)
GSTREAMER_EXTRA_DEPS := gstreamer-video-1.0 gstreamer-player-1.0 gio-2.0 glib-2.0 GSTREAMER_EXTRA_LIBS := -liconv include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk`
Application.mk:
APP_ABI = armeabi armeabi-v7a arm64-v8a x86 x86_64 APP_STL = c++_shared
build.gradle: `plugins { id 'com.android.application' }
android { compileSdk 32
}
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'com.google.android.material:material:1.4.0' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' }`