ChinnaSuhas / ossbuild

Automatically exported from code.google.com/p/ossbuild
Other
0 stars 1 forks source link

Add opencv build [patch] #98

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Attached is a patch to add build files for the opencv plugin recently added to 
gst-plugins-bad. Not sure how you want to handle the dependency (OpenCV), as it 
uses CMake, so I didn't modify the build scripts. opencv_dep.zip includes the 
required dll/lib/h files. I guessed at the WiX and Java modifications required, 
and they are untested.

Original issue reported on code.google.com by joshthep...@gmail.com on 18 Nov 2010 at 5:34

Attachments:

GoogleCodeExporter commented 9 years ago
Oops, I included a change to the element name textwrite (changed to cvputtext) 
meant for an upstream patch. Attached patch uses old gsttextwrite.c/h filename 
in opencv.vcproj.

Original comment by joshthep...@gmail.com on 18 Nov 2010 at 5:38

Attachments:

GoogleCodeExporter commented 9 years ago
Looks good excepts for one thing:
-#include <gstopencvvideofilter.h>
+#include "gstopencvvideofilter.h"

We try to have a clean copy of the upstream sources, so that when we have to 
update we are sure that we don't override anything.
Instead of changing the include, you should add the path 
Main/GStreamer/Source/gst-plugins-bad/ext/opencv/ to the gstopencv VS project. 
Take a look on how it's done in other projects.

Another thing that is missing is the integration of OpenCV with the build 
system. This document is probably going to help you :)
http://code.google.com/p/ossbuild/wiki/ExternalDependencies

And many thanks for the patch!!!

Original comment by ylatuya on 18 Nov 2010 at 5:57

GoogleCodeExporter commented 9 years ago

Original comment by ylatuya on 18 Nov 2010 at 5:57

GoogleCodeExporter commented 9 years ago

Original comment by ylatuya on 18 Nov 2010 at 5:58

GoogleCodeExporter commented 9 years ago
Ok, I'll make that change, and submit a separate patch upstream to fix that 
little issue.

OpenCV requires CMake to generate the build files; should I add CMake to 
msys-env.bat or do something else?

Original comment by joshthep...@gmail.com on 18 Nov 2010 at 9:39

GoogleCodeExporter commented 9 years ago
Here's the updated patch, which doesn't change any upstream sources.

I'll wait to hear your opinion on how to handle CMake before submitting that 
patch.

Original comment by joshthep...@gmail.com on 19 Nov 2010 at 1:40

Attachments:

GoogleCodeExporter commented 9 years ago
I'm working on integrating opencv with the build system, and once it's done 
I'll apply your patches :)

Original comment by ylatuya on 10 Dec 2010 at 2:30

GoogleCodeExporter commented 9 years ago
Regarding CMake, what options are you using? I have no experience with opencv 
and I'm building with the following options:
"$CMAKE" -G "MSYS Makefiles" -DBUILD_TEST=No -DBUILD_NEW_PYTHON_SUPPORT=No \
-DOPENCV_BUILD_3RDPARTY_LIBS=No $PKG_DIR

I have seen that ffmpeg support can be added too, but not support whether it's 
useful for the gstreamer or not-

Original comment by ylatuya on 10 Dec 2010 at 2:33

GoogleCodeExporter commented 9 years ago
Hi again,

I'm experimenting some troubles compiling opencv, mostly because my lack of 
knowledge in cmake. I have pushed the opencv package and set its variables in 
version.sh in r947.
You should add in the build script something like:

#FIXME: Should we add CMake to the build system or leave it like a dependency?
# CMAKE 
CMAKE="/c/Program Files/CMake 2.8/bin/cmake.exe

if [ ! -f "$BinDir/libopencv_core.dll" ]; then 
    if [ ! -f "$CMAKE" ];then
        echo "*** OpenCV will not be built. ***"
        echo "Could not find CMake in the path:"
        echo "$CMAKE"
        return
    fi

    unpack_zip_and_move_windows "opencv.zip" "$PKG_DIR_OPENCV"
    mkdir_and_move "$IntDir/opencv"

        "$CMAKE" -G "MSYS Makefiles" -DBUILD_TEST=No -DBUILD_NEW_PYTHON_SUPPORT=No \
    -DOPENCV_BUILD_3RDPARTY_LIBS=No $PKG_DIR

    make && make install
fi

For me it's trying to compile the 3rdparty libraries, even if it's not 
specified in the config with "-DOPENCV_BUILD_3RDPARTY_LIBS=No", and fails 
building libjpeg because INLINE is not defined:

c:/ossbuild/Libraries/Source/OpenCV-2.2.0/3rdparty/libjpeg/jchuff.c:301: error: 
                                              expected '=', ',', ';', 'asm' or 
'__attribute__' before 'static'
c:/ossbuild/Libraries/Source/OpenCV-2.2.0/3rdparty/libjpeg/jchuff.c: In functio 
                                             n 'flush_bits':
c:/ossbuild/Libraries/Source/OpenCV-2.2.0/3rdparty/libjpeg/jchuff.c:342: warnin 
                                             g: implicit declaration of 
function 'emit_bits'
make[2]: *** [3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jchuff.obj] Error 1
make[1]: *** [3rdparty/libjpeg/CMakeFiles/libjpeg.dir/all] Error 2

Original comment by ylatuya on 10 Dec 2010 at 10:03

GoogleCodeExporter commented 9 years ago
opencv plugin was added to the upstream -bad. so probably it'd be useful to 
follow their way too.

Original comment by vitorl...@gmail.com on 25 Jan 2011 at 11:07

GoogleCodeExporter commented 9 years ago
When shall we see this patch in git?

thanks

Original comment by gergo.cs...@gmail.com on 21 Mar 2011 at 9:39

GoogleCodeExporter commented 9 years ago
do you plan to include opencv on bad as in upstreamer?

Original comment by lfar...@gmail.com on 23 Mar 2011 at 9:55