Hi, i am new to gstreamer and android but i am trying something similar to you and facing same issue like you.
I also tried gstreamer prebuilt binaries to AOSP under external/gstreamer* directory in the source tree, this is my Android.bp file under external/gstreamer directory:
cc_prebuilt_library_static {
name: "libglib",
strip: {
none: true,
},
vendor: true,
compile_multilib: "both",
target: {
android_x86_64: {
srcs: ["x86_64/lib/libglib-2.0.a"],
export_include_dirs: [
"x86_64/include/glib-2.0",
"x86_64/lib/glib-2.0/include",
],
},
android_x86: {
srcs: ["x86/lib/libglib-2.0.a"],
export_include_dirs: [
"x86/include/glib-2.0",
"x86/lib/glib-2.0/include",
],
}
},
}
cc_prebuilt_library_static {
name: "libgstapp",
strip: {
none: true,
},
vendor: true,
compile_multilib: "both",
target: {
android_x86_64: {
srcs: ["x86_64/lib/libgstapp-1.0.a"],
export_include_dirs: [
"x86_64/include",
],
},
android_x86: {
srcs: ["x86/lib/libgstapp-1.0.a"],
export_include_dirs: [
"x86/include",
],
}
},
}
cc_prebuilt_library_static {
name: "libgstbase",
strip: {
none: true,
},
vendor: true,
compile_multilib: "both",
target: {
android_x86_64: {
srcs: ["x86_64/lib/libgstbase-1.0.a"],
export_include_dirs: [
"x86_64/include",
],
},
android_x86: {
srcs: ["x86/lib/libgstbase-1.0.a"],
export_include_dirs: [
"x86/include",
],
}
},
}
cc_prebuilt_library_static {
name: "libgobject",
strip: {
none: true,
},
vendor: true,
compile_multilib: "both",
target: {
android_x86_64: {
srcs: ["x86_64/lib/libgobject-2.0.a"],
export_include_dirs: [
"x86_64/include",
],
},
android_x86: {
srcs: ["x86/lib/libgobject-2.0.a"],
export_include_dirs: [
"x86/include",
],
}
},
}
cc_prebuilt_library_static {
name: "libffi",
strip: {
none: true,
},
vendor: true,
compile_multilib: "both",
target: {
android_x86_64: {
srcs: ["x86_64/lib/libffi.a"],
export_include_dirs: [
"x86_64/include",
],
},
android_x86: {
srcs: ["x86/lib/libffi.a"],
export_include_dirs: [
"x86/include",
],
}
},
}
cc_prebuilt_library_static {
name: "libintl",
strip: {
none: true,
},
vendor: true,
compile_multilib: "both",
target: {
android_x86_64: {
srcs: ["x86_64/lib/libintl.a"],
export_include_dirs: [
"x86_64/include",
],
},
android_x86: {
srcs: ["x86/lib/libintl.a"],
export_include_dirs: [
"x86/include",
],
}
},
}
cc_prebuilt_library_static {
name: "libgstreamer",
strip: {
none: true,
},
vendor: true,
compile_multilib: "both",
target: {
android_x86_64: {
srcs: ["x86_64/lib/libgstreamer-1.0.a"],
export_include_dirs: [
"x86_64/include/glib-2.0",
"x86_64/include/gstreamer-1.0",
],
},
android_x86: {
srcs: ["x86/lib/libgstreamer-1.0.a"],
export_include_dirs: [
"x86/include/gstreamer-1.0",
"x86/include/glib-2.0",
],
}
},
static_libs: [
"libglib",
"libintl",
"libgmodule",
"libiconv",
"libpcre2",
"libgstapp",
"libgobject",
"libgstbase",
"libgstplugin",
],
}
cc_prebuilt_library_static {
name: "libgmodule",
strip: {
none: true,
},
vendor: true,
compile_multilib: "both",
target: {
android_x86_64: {
srcs: ["x86_64/lib/libgmodule-2.0.a"],
export_include_dirs: [
"x86_64/include/glib-2.0",
],
},
android_x86: {
srcs: ["x86/lib/libgmodule-2.0.a"],
export_include_dirs: [
"x86/include/glib-2.0",
],
}
},
}
cc_prebuilt_library_static {
name: "libgstplugin",
strip: {
none: true,
},
vendor: true,
compile_multilib: "both",
target: {
android_x86_64: {
srcs: ["x86_64/lib/gstreamer-1.0/libgstapp.a"],
export_include_dirs: [
"x86_64/include",
],
},
android_x86: {
srcs: ["x86/lib/gstreamer-1.0/libgstapp.a"],
export_include_dirs: [
"x86/include",
],
}
},
static_libs: [
"libglib",
"libintl",
"libgmodule",
"libiconv",
"libpcre2",
"libgstapp",
"libgobject",
"libgstbase",
],
}
cc_prebuilt_library_static {
name: "libiconv",
strip: {
none: true,
},
vendor: true,
compile_multilib: "both",
target: {
android_x86_64: {
srcs: ["x86_64/lib/libiconv.a"],
export_include_dirs: [
"x86_64/include",
],
},
android_x86: {
srcs: ["x86/lib/libiconv.a"],
export_include_dirs: [
"x86/include/",
],
}
},
}
cc_prebuilt_library_static {
name: "libpcre2",
strip: {
none: true,
},
vendor: true,
compile_multilib: "both",
target: {
android_x86_64: {
srcs: ["x86_64/lib/libpcre2-8.a"],
export_include_dirs: [
"x86_64/include",
],
},
android_x86: {
srcs: ["x86/lib/libpcre2-8.a"],
export_include_dirs: [
"x86/include",
],
}
},
}
I am also not able to see plugin linked as this function always returns null in my case:
GstElement* source = gst_element_factory_make("autoaudiosrc", "source");
Please help, as i am new dont know what i am doing wrong here...
Thanks in advance!