YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ffmpeg_api.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_FFMPEG_DEVICE_FFMPEG_API_H
8#define YARP_FFMPEG_DEVICE_FFMPEG_API_H
9
10// ffmpeg changes all the time.
11// time to start factoring out some of the things that change.
12
13#ifndef __STDC_CONSTANT_MACROS
14#define __STDC_CONSTANT_MACROS
15#endif
16
17extern "C" {
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>
24}
25
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"
28#endif
29
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
34#endif
35
36#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 0, 0)
37# define AV_CODEC_FLAG_GLOBAL_HEADER CODEC_FLAG_GLOBAL_HEADER
38#endif
39
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); }
42#endif
43
44int stable_img_convert (AVPicture *dst, int dst_pix_fmt,
45 const AVPicture *src, int src_pix_fmt,
46 int src_width, int src_height);
47
48
49#endif // YARP_FFMPEG_DEVICE_FFMPEG_API_H
int stable_img_convert(AVPicture *dst, int dst_pix_fmt, const AVPicture *src, int src_pix_fmt, int src_width, int src_height)