[FFmpeg-devel] [PATCH] Fix vf_libopencv compilation problem in Mac OS X

sean darcy seandarcy2 at gmail.com
Thu Apr 21 00:57:37 CEST 2011


On 04/20/2011 01:02 PM, Roger Pau Monné wrote:
> 2011/4/20 Thilo Borgmann<thilo.borgmann at googlemail.com>:
>> Am 20.04.11 12:23, schrieb Roger Pau Monné:
>>> 2011/4/20 Thilo Borgmann<thilo.borgmann at googlemail.com>:
>>>> Am 20.04.11 11:02, schrieb Roger Pau Monné:
>>>>> Sorry, I didn't realize I've sent the file, I had the patch prepared,
>>>>> don't know why I sent that... Anyway the bug is the same as the one
>>>>> described here: http://www.openradar.me/8026390. Don't know if there
>>>>> is another way to fix this, I've only been able to find this solution.
>>>>>
>>>>> 2011/4/20 Carl Eugen Hoyos<cehoyos at ag.or.at>:
>>>>>> Roger Pau Monné<roger.pau<at>  entel.upc.edu>  writes:
>>>>>>
>>>>>>> Just added a couple of macros to allow compilation of vf_libopencv in
>>>>>>> Mac OS X. Tested on Mac OS X 10.6.7, gcc 4.2.1 and OpenCV 2.2.
>>>>
>>>> Has this really been tested with OpenCV>= 2.2?
>>>
>>> It has been tested with this release
>>> http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.2/OpenCV-2.2.0.tar.bz2
>>> (OpenCV 2.2 stable, installed from brew)
>>
>> I downloaded from a mirror yesterday and this file is not in there. I suspect
>> the file is left from a previous installation on your system then?
>>
>
> It's the first time I've installed OpenCV, so I don't think so, maybe
> it has something to do with installing OpenCV from brew.
>
>>
>>
>>>>> Signed-off-by: Roger Pau Monné<roger.pau at entel.upc.edu>
>>>>> ---
>>>>> libavfilter/vf_libopencv.c |    6 ++++++
>>>>> 1 files changed, 6 insertions(+), 0 deletions(-)
>>>>>
>>>>> diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c
>>>>> index 8401b4d..c1e57c6 100644
>>>>> --- a/libavfilter/vf_libopencv.c
>>>>> +++ b/libavfilter/vf_libopencv.c
>>>>> @@ -25,6 +25,12 @@
>>>>>
>>>>> /* #define DEBUG */
>>>>>
>>>>> +#ifndef NeXTBSD /* Allow compilation on NeXT and Darwin */
>>>>> +#ifdef __APPLE__
>>>>> +    #undef __GNUC_STDC_INLINE__
>>>>> +#endif
>>>>> +#endif
>>>>> +
>>>>>   #include<opencv/cv.h>
>>>>
>>>>>   #include<opencv/cxtypes.h>
>>>>
>>>> There's a report on FFmpeg-user complaining and myself ensured that this file
>>>> has been disappeared in OpenCV 2.2. Thus it should not compile against 2.2.
>>>>
>>>> https://lists.ffmpeg.org/pipermail/ffmpeg-user/2011-April/000434.html
>>>>
>>>> Or has this been fixed elsewhere in the mean time?
>>>
>>> I haven't been able to compile FFmpeg with OpenCV without adding the
>>> #undef, although I don't know if it's really the best way to do it
>>
>> I mean the include of a missing file. Your #undef patch maybe fine though I've
>> not had the time to review it.
>>
>> -Thilo
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Just got OpenCV-2.2.0 tar ball from SF. No cxtypes.h:

 >find OpenCV-2.2.0 -name cxtypes.h
 >

ffmpeg git-N-29196-ge61b83d , yesterday, built by just taking out the 
cxtypes.h include.

 From http://opencv.willowgarage.com/wiki/OpenCV%20Change%20Logs:

> # If you detected OpenCV and configured your make scripts using CMake or pkg-config tool, your code will likely build fine without any changes. Otherwise, you will need to modify linker parameters (change the library names) and update the include paths.
> #
>
> It is still possible to use #include <cv.h> etc. but the recommended notation is:
>
>     * #include "opencv2/imgproc/imgproc.hpp"


But some recent commit causes today's build to fail:

libavfilter/vf_libopencv.c: In function 'read_shape_from_file':
libavfilter/vf_libopencv.c:161:18: error: 
'FF_INTERNAL_MEM_TYPE_MAX_VALUE' undeclared (first use in this function)
libavfilter/vf_libopencv.c:161:18: note: each undeclared identifier is 
reported only once for each function it appears in
make: *** [libavfilter/vf_libopencv.o] Error 1

sean



More information about the ffmpeg-devel mailing list