[ros-users] a patch for compiling usb_cam package with the l…

Top Page
Attachments:
Message as email
+ (text/plain)
+ usb_cam.patch (application/octet-stream)
Delete this message
Reply to this message
Author: User discussions
Date:  
To: ros-users
Subject: [ros-users] a patch for compiling usb_cam package with the latest libavutil
Hi all.

now i try to use usb_cam package of bosch_drivers stack with the
latest libavutil.

however, i got the following errors when i compile it:
[ 66%] Building CXX object src/libusb_cam/CMakeFiles/usb_cam.dir/usb_cam.o
In file included from /usr/include/libavutil/avutil.h:81,
                from /usr/include/libavcodec/avcodec.h:30,
                from
/home/mechuser/ros/cturtle/bosch-ros-pkg/stacks/bosch_drivers/usb_cam/src/libusb_cam/usb_cam.cpp:55:
/usr/include/libavutil/common.h: In function 'int32_t av_clipl_int32(int64_t)':
/usr/include/libavutil/common.h:154: error: 'UINT64_C' was not
declared in this scope
/home/mechuser/ros/cturtle/bosch-ros-pkg/stacks/bosch_drivers/usb_cam/src/libusb_cam/usb_cam.cpp:
In function 'void mjpeg2rgb(char*, int, char*, int)':
/home/mechuser/ros/cturtle/bosch-ros-pkg/stacks/bosch_drivers/usb_cam/src/libusb_cam/usb_cam.cpp:321:
warning: 'int avcodec_decode_video(AVCodecContext*, AVFrame*, int*,
const uint8_t*, int)' is deprecated (declared at
/usr/include/libavcodec/avcodec.h:3452)
/home/mechuser/ros/cturtle/bosch-ros-pkg/stacks/bosch_drivers/usb_cam/src/libusb_cam/usb_cam.cpp:321:
warning: 'int avcodec_decode_video(AVCodecContext*, AVFrame*, int*,
const uint8_t*, int)' is deprecated (declared at
/usr/include/libavcodec/avcodec.h:3452)
make[3]: *** [src/libusb_cam/CMakeFiles/usb_cam.dir/usb_cam.o] Error 1
make[3]: Leaving directory
`/home/mechuser/ros/cturtle/bosch-ros-pkg/stacks/bosch_drivers/usb_cam/build'
make[2]: *** [src/libusb_cam/CMakeFiles/usb_cam.dir/all] Error 2
make[2]: Leaving directory
`/home/mechuser/ros/cturtle/bosch-ros-pkg/stacks/bosch_drivers/usb_cam/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory
`/home/mechuser/ros/cturtle/bosch-ros-pkg/stacks/bosch_drivers/usb_cam/build'
make: *** [all] Error 2


i found we need to put
#define __STDC_CONSTANT_MACROS
before include stdio.h.

i also attatched the patch.

you can find the similar topic here:
http://lists.willowgarage.com/pipermail/pr2-users/2010-October/001203.html

thanks

-- ryohei