7#ifndef YARP_FFMPEG_DEVICE_FFMPEG_API_H
8#define YARP_FFMPEG_DEVICE_FFMPEG_API_H
13#ifndef __STDC_CONSTANT_MACROS
14#define __STDC_CONSTANT_MACROS
18#include <libavcodec/avcodec.h>
19#include <libavformat/avformat.h>
20#include <libavdevice/avdevice.h>
21#include <libswscale/swscale.h>
22#include <libavutil/imgutils.h>
23#include <libavutil/mathematics.h>
26#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 0, 0)
27# error "ffmpeg version is too old, sorry - please download and compile newer version"
30#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 0, 0)
31# define av_frame_alloc avcodec_alloc_frame
32# define av_frame_unref avcodec_get_frame_defaults
33# define av_frame_free avcodec_free_frame
36#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 0, 0)
37# define AV_CODEC_FLAG_GLOBAL_HEADER CODEC_FLAG_GLOBAL_HEADER
40#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(54, 4, 100)
41# define av_dict_set_int(x, k, v, f) { char buf[256]; sprintf(buf,"%d",v); av_dict_set(x, k ,buf, 0); }
45 const AVPicture *src,
int src_pix_fmt,
46 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)