How to compile opencv gstreamer plugins for android?

Lulek maj.zirkelbach at gmail.com
Thu Jul 30 21:15:06 UTC 2020


Hi, i am trying to compile opencv gstreamer plugins from gst-plugins-bad for
android. I followed the instructions on
https://gstreamer.freedesktop.org/documentation/installing/building-from-source-using-cerbero.html?gi-language=c
and built gstreamer with cerbero. I downloaded and compiled opencv v3.4.6 (i
also tried with many other versions, but its always the same problem) for
android and added the generated opencv.pc to pkg config path (and also
opencv2 directory to the standard path .../arm64/include/gstreamer-1.0). To
save some time i also modified makefile.am to compile only one plugin
gstcvdilate.cpp:

plugin_LTLIBRARIES = libgstopencv.la
CXXFLAGS += -frtti -fexceptions

# sources used to compile this plug-in
            
libgstopencv_la_SOURCES = gstcvdilate.cpp #gstopencv.cpp

libgstopencv_la_CXXFLAGS = \
    -I$(top_srcdir)/gst-libs \
    -I$(top_builddir)/gst-libs \
    $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CXXFLAGS)
$(OPENCV_CFLAGS) \
   
-DGST_HAAR_CASCADES_DIR=\"$(pkgdatadir)/@GST_API_VERSION@/opencv_haarcascades\"

# flags used to compile this facedetect
# add other _CFLAGS and _LIBS as needed
#
# override CV_INLINE: GLib will take care of defining 'inline' sufficiently
and
# OpenCV's define isn't good enough to avoid 'unused' gcc warnings (at
v2.1.0)
libgstopencv_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) \
    $(GST_CFLAGS) $(OPENCV_CFLAGS) \
    -DCV_INLINE="static inline" \
    -DCV_NO_BACKWARD_COMPATIBILITY

libgstopencv_la_LIBADD = \
    $(top_builddir)/gst-libs/gst/opencv/libgstopencv-$(GST_API_VERSION).la \
    $(GST_LIBS) $(GST_BASE_LIBS) $(OPENCV_LIBS) \
    $(GSTPB_BASE_LIBS) -lgstvideo-$(GST_API_VERSION) -lstdc++

libgstopencv_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstopencv_la_LIBTOOLFLAGS = --tag=disable-static

# headers we need but don't want installed
noinst_HEADERS = gstcvdilate.h gstcvdilateerode.h


opencv_haarcascadesdir =
$(pkgdatadir)/$(GST_API_VERSION)/opencv_haarcascades
opencv_haarcascades_DATA = fist.xml palm.xml

EXTRA_DIST = $(opencv_haarcascades_DATA) 

but when i try to compile this plugin with make it always gives this error
(and many more linker errors if i try more plugins):

<http://gstreamer-devel.966125.n4.nabble.com/file/t379578/VirtualBoxVM_XJmc7gU6vR.png> 

Can anyone help me? I've been trying to compile opencv plugins for a month
now but no luck. Thanks in advance.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list