YARP
Yet Another Robot Platform
ffmpeg_api.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_FFMPEG_DEVICE_FFMPEG_API_H
11 #define YARP_FFMPEG_DEVICE_FFMPEG_API_H
12 
13 // ffmpeg changes all the time.
14 // time to start factoring out some of the things that change.
15 
16 #ifndef __STDC_CONSTANT_MACROS
17 #define __STDC_CONSTANT_MACROS
18 #endif
19 
20 extern "C" {
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>
27 }
28 
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"
31 #endif
32 
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
37 #endif
38 
39 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 0, 0)
40 # define AV_CODEC_FLAG_GLOBAL_HEADER CODEC_FLAG_GLOBAL_HEADER
41 #endif
42 
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); }
45 #endif
46 
47 int stable_img_convert (AVPicture *dst, int dst_pix_fmt,
48  const AVPicture *src, int src_pix_fmt,
49  int src_width, int src_height);
50 
51 
52 #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)
Definition: ffmpeg_api.cpp:13