10 #ifndef YARP_FFMPEG_DEVICE_FFMPEG_API_H
11 #define YARP_FFMPEG_DEVICE_FFMPEG_API_H
16 #ifndef __STDC_CONSTANT_MACROS
17 #define __STDC_CONSTANT_MACROS
21 #include <libavcodec/avcodec.h>
22 #include <libavformat/avformat.h>
23 #include <libavdevice/avdevice.h>
24 #include <libswscale/swscale.h>
25 #include <libavutil/imgutils.h>
26 #include <libavutil/mathematics.h>
29 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 0, 0)
30 # error "ffmpeg version is too old, sorry - please download and compile newer version"
33 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 0, 0)
34 # define av_frame_alloc avcodec_alloc_frame
35 # define av_frame_unref avcodec_get_frame_defaults
36 # define av_frame_free avcodec_free_frame
39 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 0, 0)
40 # define AV_CODEC_FLAG_GLOBAL_HEADER CODEC_FLAG_GLOBAL_HEADER
43 #if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(54, 4, 100)
44 # define av_dict_set_int(x, k, v, f) { char buf[256]; sprintf(buf,"%d",v); av_dict_set(x, k ,buf, 0); }
48 const AVPicture *src,
int src_pix_fmt,
49 int src_width,
int src_height);
int stable_img_convert(AVPicture *dst, int dst_pix_fmt, const AVPicture *src, int src_pix_fmt, int src_width, int src_height)