Ignition Common

API Reference

3.6.1
ffmpeg_inc.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef IGNITION_COMMON_FFMPEG_INC_HH_
18 #define IGNITION_COMMON_FFMPEG_INC_HH_
19 
20 #include <ignition/common/config.hh>
21 
22 #ifndef _WIN32
23 #pragma GCC system_header
24 #endif
25 
26 #ifndef INT64_C
27 #define INT64_C(c) (c ## LL)
28 #define UINT64_C(c) (c ## ULL)
29 #endif
30 
31 #ifndef AV_ERROR_MAX_STRING_SIZE
32 #define AV_ERROR_MAX_STRING_SIZE 64
33 #endif
34 
35 extern "C" {
36 #include <libavcodec/avcodec.h>
37 #include <libavformat/avformat.h>
38 #include <libswscale/swscale.h>
39 #include <libavutil/mathematics.h>
40 #include <libavutil/opt.h>
41 #include <libavutil/error.h>
42 #include <libavutil/imgutils.h>
43 
44 #if defined(__linux__) && defined(HAVE_AVDEVICE)
45 #include <libavdevice/avdevice.h>
46 #endif
47 }
48 
49 #include <ignition/common/av/Export.hh>
50 
51 namespace ignition
52 {
53  namespace common
54  {
56  IGNITION_COMMON_AV_VISIBLE
57  AVFrame *AVFrameAlloc(void);
58 
60  IGNITION_COMMON_AV_VISIBLE
61  void AVFrameUnref(AVFrame *_frame);
62 
65  IGNITION_COMMON_AV_VISIBLE
66  void AVPacketUnref(AVPacket *_packet);
67 
77  IGNITION_COMMON_AV_VISIBLE
78  int AVCodecDecode(AVCodecContext *_codecCtx,
79  AVFrame *_frame, int *_gotFrame, AVPacket *_packet);
80  }
81 }
82 
83 #endif
IGNITION_COMMON_AV_VISIBLE void AVPacketUnref(AVPacket *_packet)
Helper function to avoid deprecation warnings.
IGNITION_COMMON_AV_VISIBLE AVFrame * AVFrameAlloc(void)
Helper function to avoid deprecation warnings.
IGNITION_COMMON_AV_VISIBLE int AVCodecDecode(AVCodecContext *_codecCtx, AVFrame *_frame, int *_gotFrame, AVPacket *_packet)
Helper function to avoid deprecation warnings from av_codec_decode_video2.
IGNITION_COMMON_AV_VISIBLE void AVFrameUnref(AVFrame *_frame)
Helper function to avoid deprecation warnings.
Forward declarations for the common classes.