adding multiple .h and .cpp files to custom plugin

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

adding multiple .h and .cpp files to custom plugin

dpw157
Hey so I have a question about adding additional files to to my plugin. After
looking around it seems like in order to have the plugin see and compile
properly i just have to add the extra .cpp files to _SOURCES and the .h
files to noint_HEADERS.
The plugin is successfully created and shows up in gst-inspect-1.0 but when
i try to inspect i get a segmentation fault:11. From my understanding this
means that the plugin is trying to access files its not supposed to. My
guess is its trying to access the function inside the extra .cpp files i am
using in the chain function.
How would i go about debugging this and do you have any ideas on if im
including the extra files properly. Do i need to do something different in
order for them to be seen?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: adding multiple .h and .cpp files to custom plugin

dpw157
Hey just an update for anybody else in case they have the same problem. I fixed what was happening. It had a couple of problems. One was my makefile, according to some old post i found the name of the .la/.so has to be the same as what you call your filter. So if your plugin is named gstmyfilter.cpp the plugin_LTLIBRARIES should have libgstmyfilter.la. Adding the extra files to sources and the headers to noinst_HEADERS was also fine. Im thinking the segfault was some weird stuff happening in my code because everything got fixed after i changed some stuff.

# Note: plugindir is set in configure

##############################################################################
# TODO: change libgstmyfilter.la to something else, e.g. libmysomething.la     #
##############################################################################
plugin_LTLIBRARIES = libgstmyfilter.la

##############################################################################
# TODO: for the next set of variables, name the prefix if you named the .la, #
#  e.g. libmysomething.la => libmysomething_la_SOURCES                       #
#                            libmysomething_la_CFLAGS                        #
#                            libmysomething_la_LIBADD                        #
#                            libmysomething_la_LDFLAGS                       #
##############################################################################

## Plugin 1

# sources used to compile this plug-in
# sources used to compile this plug-in
libgstmyfilter_la_SOURCES = gstmyfilter.cpp gstmyfilter.h Calibration.cpp MlDetection.cpp PersonDetection.cpp ConfigParsing.cpp dataset.cpp OpticalFlowFeatures.cpp ParticleFilter.cpp Utils.cpp 
OPENCV_CFLAGS = `pkg-config --cflags opencv`
OPENCV_LIBS = `pkg-config --libs opencv`

# # compiler and linker flags used to compile this plugin, set in configure.ac

libgstmyfilter_la_CXXFLAGS = $(GST_CFLAGS) $(OPENCV_CFLAGS)
libgstmyfilter_la_LIBADD = $(GST_LIBS) 
libgstmyfilter_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(OPENCV_LIBS)
libgstmyfilter_la_LIBTOOLFLAGS = --tag=disable-static
# # headers we need but don't want installed
noinst_HEADERS = MlDetection.h PersonDetection.hpp ConfigParsing.hpp dataset.h OpticalFlowFeatures.hpp ParticleFilter.hpp  Utils.hpp Calibration.hpp

I also made some changes to my configure.ac file. But they were minor so i dont think that will be the case for anybody else with the same problems.

Sent from the GStreamer-devel mailing list archive at Nabble.com.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel