gst_element_factory_make returns nullptr on Android

Tomasz Mikolajczyk tmmikolajczyk at gmail.com
Tue Feb 13 09:51:43 UTC 2024


The cache dir is in fact is ~/.cache/gstreamer-1.0/

Once removed, you may run the pipeline with GST_DEBUG=4 and then you will
see at the beginning what libraries are getting loaded for instance:

0:00:00.002036000 71423 0x600003dfc660 INFO      GST_PLUGIN_LOADING
gstplugin.c:987:_priv_gst_plugin_load_file_for_registry: plugin
"/opt/homebrew/Cellar/gstreamer/1.22.9_1/lib/gstreamer-1.0/libgstdebug.dylib"
loaded
0:00:00.002977000 71423 0x600003dfc660 INFO      GST_PLUGIN_LOADING
gstplugin.c:987:_priv_gst_plugin_load_file_for_registry: plugin
"/opt/homebrew/Cellar/gstreamer/1.22.9_1/lib/gstreamer-1.0/libgstwebp.dylib"
loaded
0:00:00.003554000 71423 0x600003dfc660 INFO      GST_PLUGIN_LOADING
gstplugin.c:987:_priv_gst_plugin_load_file_for_registry: plugin
"/opt/homebrew/Cellar/gstreamer/1.22.9_1/lib/gstreamer-1.0/libgstipcpipeline.dylib"
loaded
0:00:00.004612000 71423 0x600003dfc660 INFO      GST_PLUGIN_LOADING
gstplugin.c:987:_priv_gst_plugin_load_file_for_registry: plugin
"/opt/homebrew/Cellar/gstreamer/1.22.9_1/lib/gstreamer-1.0/libgstinterleave.dylib"
loaded

In my case `gst-inspect-1.0 filesrc` says that filesrc is located
in  /opt/homebrew/Cellar/gstreamer/1.22.9_1/lib/gstreamer-1.0/libgstcoreelements.dylib.

This way you may ensure that the correct libs get loaded. If not then you
may try with setting GST_PLUGIN_PATH env variable (I would remove the cache
first).

On Tue, Feb 13, 2024 at 10:06 AM Ramil Galin <leftbyheaven at gmail.com> wrote:

> Hi Tomasz,
>
> Thank you for the quick response!
>
> I've tried removing the cache, unfortunately it doesn't help.
>
> вт, 13 февр. 2024 г. в 09:47, Tomasz Mikolajczyk <tmmikolajczyk at gmail.com
> >:
>
>> Have you tried to remove the cache directory? Usually ~/.cache/gstreamer
>> (at least on Linux).
>>
>> On Tue, 13 Feb 2024 at 09:01, Ramil Galin via gstreamer-devel <
>> gstreamer-devel at lists.freedesktop.org> wrote:
>>
>>> Hello!
>>>
>>> I am developing an app for Android using JNI. I use CMake to build my
>>> jni lib and follow this
>>> <https://github.com/henkeldi/gstreamer-android/blob/master/app/src/main/cpp/CMakeLists.txt>
>>> example to configure the CMakeLists.txt and gstreamer_android.cpp. I
>>> declare and register plugins according to the example either.
>>>
>>> The problem is that when I try to create some element of pipeline (e.g.
>>> "filesrc", "videotestsrc" etc.) using *gst_element_factory_make, *it
>>> returns nullptr. I posted the questions on stackoverflow
>>> <https://stackoverflow.com/questions/77961381/andoird-jni-gst-element-factory-make-returns-nullptr-when-i-try-create-element>
>>> and gstreamer
>>> <https://discourse.gstreamer.org/t/android-jni-gst-element-factory-make-returns-nullptr/959/3>
>>> forum but still got no answers.
>>>
>>> I would appreciate if you could help me with this problem.
>>>
>>> Looking forward to hearing from you.
>>>
>>> Best regards,
>>> Ramil Galin
>>>
>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20240213/2c44a9bd/attachment.htm>


More information about the gstreamer-devel mailing list