File: WrapFFMpeg.h

package info (click to toggle)
libavg 1.8.2-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 23,424 kB
  • sloc: cpp: 84,241; python: 17,113; sh: 1,288; ansic: 783; makefile: 492; xml: 94
file content (99 lines) | stat: -rw-r--r-- 2,967 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//
//  libavg - Media Playback Engine. 
//  Copyright (C) 2003-2014 Ulrich von Zadow
//
//  This library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Lesser General Public
//  License as published by the Free Software Foundation; either
//  version 2 of the License, or (at your option) any later version.
//
//  This library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with this library; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
//  Current versions can be found at www.libavg.de
//

#ifndef _WrapFFMpeg_H_
#define _WrapFFMpeg_H_

#include "../avgconfigwrapper.h"

#ifdef _WIN32
#define EMULATE_INTTYPES
#else
// This is probably GCC-specific.
#if !defined INT64_C
#if defined __WORDSIZE && __WORDSIZE == 64
#define INT64_C(c) c ## L
#define UINT64_C(c) c ## UL
#else
#define INT64_C(c) c ## LL
#define UINT64_C(c) c ## ULL
#endif
#endif
#endif

extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include <libavutil/avutil.h>
#include <libavutil/pixdesc.h>
#include <libavutil/mathematics.h>
#include <libavutil/opt.h>
#if LIBAVFORMAT_VERSION_MAJOR < 53
#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
#endif

#if LIBAVFORMAT_VERSION_MAJOR > 52
  #define SAMPLE_FMT_S16 AV_SAMPLE_FMT_S16
  #define SAMPLE_FMT_FLT AV_SAMPLE_FMT_FLT
  #define SAMPLE_FMT_DBL AV_SAMPLE_FMT_DBL
  #define SAMPLE_FMT_S32 AV_SAMPLE_FMT_S32
  #define SAMPLE_FMT_U8 AV_SAMPLE_FMT_U8
  #define SAMPLE_FMT_S16P AV_SAMPLE_FMT_S16P
  #define SAMPLE_FMT_FLTP AV_SAMPLE_FMT_FLTP
  #define SampleFormat AVSampleFormat
#endif

#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 25, 00)
  #define AV_CODEC_ID_MPEG1VIDEO CODEC_ID_MPEG1VIDEO 
  #define AV_CODEC_ID_MPEG2VIDEO CODEC_ID_MPEG2VIDEO
  #define AV_CODEC_ID_H264 CODEC_ID_H264
  #define AV_CODEC_ID_WMV3 CODEC_ID_WMV3
  #define AV_CODEC_ID_VC1 CODEC_ID_VC1
  #define AV_CODEC_ID_MJPEG CODEC_ID_MJPEG
  #define AV_CODEC_ID_NONE CODEC_ID_NONE
#endif

#ifndef URL_WRONLY
        #define url_fopen avio_open
        #define url_fclose avio_close
        #define URL_WRONLY AVIO_FLAG_WRITE
#endif
#ifdef HAVE_LIBAVRESAMPLE_AVRESAMPLE_H
    #include <libavresample/avresample.h>
    #include <libavresample/version.h>
#endif
}

#ifdef PixelFormat
#undef PixelFormat
#endif

// Defines renamed in libav 12 / FFmpeg 2.8
#ifndef AV_INPUT_BUFFER_PADDING_SIZE
  #define AV_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE
#endif
#ifndef AV_CODEC_FLAG_GLOBAL_HEADER
  #define AV_CODEC_FLAG_GLOBAL_HEADER CODEC_FLAG_GLOBAL_HEADER
#endif

#endif