Linking to external libraries in gstreamer plugin using autotools

I wrote the gstreamer plugin using the template template specified in the gstreamer plugin authors guide ( http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/chapter-building-boiler.html ). I first built the plugin without fully implementing the chain function (basically an empty plugin that passed data from the source to stream without changes).

Now I am implementing a chaining function to do basic filtering of data in a buffer. Filtering uses an external sharpening library (which I have successfully used outside of gstreamer). When creating using autotools I get no errors, but when creating a pipeline using a new plugin I get an undefined character error

(gst-plugin-scanner:6512): GStreamer-WARNING **: Failed to load plugin '/usr/local/lib/gstreamer-1.0/libgstsharpening.so': /usr/local/lib/gstreamer-1.0/libgstsharpening.so: undefined symbol: InitializeSharpeningModule

I'm admittedly very new to autotools, and I believe that my problem lies somewhere in the process, but I cannot figure out where. The used external sharpening library can be found here.

/public/gstreamer_pipeline/lib/libsharpening.so

I edited the Makefile.am plugin found in the src directory for my plugin

/public/gstreamer_pipeline/src/gst-sharpening/src

Contents of Edited Makefile.am

plugin_LTLIBRARIES = libgstsharpening.la

libgstsharpening_la_SOURCES = gstsharpening.c gstsharpening.h

libgstsharpening_la_CFLAGS = $(GST_CFLAGS) -I/public/gstreamer_pipeline/include
libgstsharpening_la_LIBADD = $(GST_LIBS) -lsharpening
libgstsharpening_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -L/public/gstreamer_pipeline/lib
libgstsharpening_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)

noinst_HEADERS = gstsharpening.h

The undefined symbolic error occurs when creating a pipeline from the main program or creating a pipeline from the command line using

gst-launch-1.0 fakesrc ! sharpening ! fakesink

ldd ( LD_LIBRARY_PATH)

ldd /usr/local/lib/gstreamer-1.0/libgstsharpening.so
    linux-vdso.so.1 =>  (0x00007fff17bc0000)
    libgstbase-1.0.so.0 => /usr/local/lib/libgstbase-1.0.so.0 (0x00007f3c51778000)
    libgstcontroller-1.0.so.0 => /usr/local/lib/libgstcontroller-1.0.so.0 (0x00007f3c51568000)
    libgstreamer-1.0.so.0 => /usr/local/lib/libgstreamer-1.0.so.0 (0x00007f3c51250000)
    libgmodule-2.0.so.0 => /usr/local/lib/libgmodule-2.0.so.0 (0x00007f3c5104d000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f3c50db0000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f3c50bac000)
    libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0 (0x00007f3c5095f000)
    libffi.so.6 => /usr/local/lib/../lib64/libffi.so.6 (0x00007f3c50755000)
    libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x00007f3c50420000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f3c50203000)
    librt.so.1 => /lib64/librt.so.1 (0x00007f3c4fffa000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f3c4fc67000)
    /lib64/ld-linux-x86-64.so.2 (0x0000003406c00000)

configure.log http://pastie.org/10450341

make make install http://pastie.org/10450352

+4
1

, / (libsharpening.so) (/public/gstreamer_pipeline/lib/).

( automake, , , ).

:

  • , , , /usr/local/lib/ ( )

    • , /etc/ld.so.config ( - sytem - /etc/ld.so.conf.d/gstreamer_pipeline.conf)
  • LD_LIBRARY_PATH.

.

LD_LIBRARY_PATH=/public/gstreamer_pipeline/lib/ gst-launch-1.0 \
          fakesrc ! sharpening ! fakesink
+1

Source: https://habr.com/ru/post/1609333/


All Articles