<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi all,<div><br></div><div>I want to have my application run on different hosts, and these hosts may not have GStreamer packages installed. My idea is to build a static GStreamer library, and load the static library when my application starts.</div><div><br></div><div>I use the source code of 1.20.2 from GitLab, and the following are my build commands:</div><div>> meson --buildtype=release \ </div><div>            --strip \ </div><div>             --wrap-mode=forcefallback \</div><div>             -Dauto_features=disabled \ </div><div>              -Dbad=enabled \</div><div>              -Dgst-plugins-base:videotestsrc=enabled \ </div><div>              -Dgst-plugins-good:autodetect=enabled \ </div><div>              --default-library=static \ </div><div>              -Dintrospection=disabled \ </div><div>              build</div><div>> ninja -C build</div><div><br></div><div>I can get the static library <a href="http://libgstreamer-full-1.0.so">libgstreamer-full-1.0.so</a> in the build folder, and I create a symbolic link of <a href="http://libgstreamer-1.0.so">libgstreamer-1.0.so</a> to it.</div><div>Then I update $LD_LIBRARY_PATH on my Linux environment and run a Java example to load the GStreamer library.</div><div>This is the Java example I used:</div><div><a href="https://github.com/gstreamer-java/gst1-java-examples/blob/master/BasicPipeline/src/main/java/org/freedesktop/gstreamer/examples/BasicPipeline.java">https://github.com/gstreamer-java/gst1-java-examples/blob/master/BasicPipeline/src/main/java/org/freedesktop/gstreamer/examples/BasicPipeline.java</a></div><div><br></div><div>I expect that the library has its dependencies linked statically, but the application fails and I find the following messages:</div><div>INFO: Trying <a href="http://libgstreamer-1.0.so">libgstreamer-1.0.so</a></div><div>May 07, 2022 6:30:45 AM com.sun.jna.NativeLibrary loadLibrary</div><div>INFO: Found library 'gstreamer-1.0' at <a href="http://libgstreamer-1.0.so">libgstreamer-1.0.so</a></div><div>May 07, 2022 6:30:45 AM com.sun.jna.NativeLibrary loadLibrary<br></div><div><div>INFO: Trying /usr/lib64/libglib-2.0.so.0.5600.1</div><div>May 07, 2022 6:30:45 AM com.sun.jna.NativeLibrary loadLibrary</div><div>INFO: Found library 'glib-2.0' at /usr/lib64/libglib-2.0.so.0.5600.1</div><div>May 07, 2022 6:30:45 AM com.sun.jna.NativeLibrary loadLibrary</div></div><div><div>INFO: Trying /usr/lib64/libgobject-2.0.so.0.5600.1</div><div>May 07, 2022 6:30:45 AM com.sun.jna.NativeLibrary loadLibrary</div><div>INFO: Found library 'gobject-2.0' at /usr/lib64/libgobject-2.0.so.0.5600.1</div><div><br></div><div>(gst1-java-core:31071): GLib-CRITICAL **: 06:30:45.770: g_datalist_id_set_data_full: assertion 'key_id > 0' failed</div><div>#</div><div># A fatal error has been detected by the Java Runtime Environment:</div><div>#</div><div>#  SIGSEGV (0xb) at pc=0x00007f1bd8d8abdb, pid=31071, tid=0x00007f1c38bee700</div></div><div><br></div><div>The application still uses the GLib and GObject on the System.<br>Would anyone help to guide me on the correct way to build and use the static GStreamer library for the Java example?</div><div>Thanks.</div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>