Audacity
3.2.0
modules
import-export
mod-ffmpeg
lib-ffmpeg-support
FFmpegTypes.h
Go to the documentation of this file.
1
/**********************************************************************
2
3
Audacity: A Digital Audio Editor
4
5
FFmpegTypes.h
6
7
Dmitry Vedenko
8
9
**********************************************************************/
10
11
#pragma once
12
13
#include <cstdint>
14
#include <errno.h>
15
16
#define AUDACITY_MKTAG(a, b, c, d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
17
#define AUDACITY_FFERRTAG(a, b, c, d) (-(int)AUDACITY_MKTAG(a, b, c, d))
18
19
#if EDOM > 0
20
# define AUDACITY_AVERROR(e) \
21
(-(e))
23
# define AUDACITY_AVUNERROR(e) \
24
(-(e))
26
#else
27
/* Some platforms have E* and errno already negated. */
28
# define AUDACITY_AVERROR(e) (e)
29
# define AUDACITY_AVUNERROR(e) (e)
30
#endif
31
32
#define AUDACITY_AVERROR_EOF AUDACITY_FFERRTAG('E', 'O', 'F', ' ')
33
34
#define AUDACITY_AVFMT_NOFILE 0x0001
35
/*
36
#define AVFMT_NEEDNUMBER 0x0002
37
#define AVFMT_SHOW_IDS 0x0008
38
#define AVFMT_RAWPICTURE 0x0020
39
*/
40
#define AUDACITY_AVFMT_GLOBALHEADER 0x0040
41
/*
42
#define AVFMT_NOTIMESTAMPS 0x0080
43
#define AVFMT_GENERIC_INDEX 0x0100
44
#define AVFMT_TS_DISCONT 0x0200
45
#define AVFMT_VARIABLE_FPS 0x0400
46
#define AVFMT_NODIMENSIONS 0x0800
47
#define AVFMT_NOSTREAMS 0x1000
48
#define AVFMT_NOBINSEARCH 0x2000
49
#define AVFMT_NOGENSEARCH 0x4000
50
#define AVFMT_NO_BYTE_SEEK 0x8000
51
#define AVFMT_ALLOW_FLUSH 0x10000
52
#define AVFMT_TS_NONSTRICT 0x20000
53
#define AVFMT_TS_NEGATIVE 0x40000
54
#define AVFMT_SEEK_TO_PTS 0x4000000
55
56
#define AVFMT_FLAG_GENPTS 0x0001
57
#define AVFMT_FLAG_IGNIDX 0x0002
58
#define AVFMT_FLAG_NONBLOCK 0x0004
59
#define AVFMT_FLAG_IGNDTS 0x0008
60
#define AVFMT_FLAG_NOFILLIN 0x0010
61
#define AVFMT_FLAG_NOPARSE 0x0020
62
#define AVFMT_FLAG_NOBUFFER 0x0040
63
#define AVFMT_FLAG_CUSTOM_IO 0x0080
64
#define AVFMT_FLAG_DISCARD_CORRUPT 0x0100
65
#define AVFMT_FLAG_FLUSH_PACKETS 0x0200
66
67
#define AVFMT_FLAG_BITEXACT 0x0400
68
#define AVFMT_FLAG_MP4A_LATM 0x8000
69
#define AVFMT_FLAG_SORT_DTS 0x10000
70
#define AVFMT_FLAG_PRIV_OPT 0x20000
71
#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000
72
*/
73
74
#define AUDACITY_AV_NOPTS_VALUE ((int64_t)UINT64_C(0x8000000000000000))
75
76
#ifndef AV_VERSION_INT
77
#define AV_VERSION_INT(a, b, c) (a << 16 | b << 8 | c)
78
#endif
79
80
#define AUDACITY_AV_TIME_BASE (1000 * 1000)
81
82
#define AUDACITY_AV_CODEC_FLAG_QSCALE (1 << 1)
83
84
#define AUDACITY_AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6)
85
86
87
//#define FF_LAMBDA_SHIFT 7
88
//#define FF_LAMBDA_SCALE (1 << FF_LAMBDA_SHIFT)
89
#define AUDACITY_FF_QP2LAMBDA 118
90
//#define FF_LAMBDA_MAX (256 * 128 - 1)
91
92
/*
93
#define FF_COMPLIANCE_VERY_STRICT 2
94
#define FF_COMPLIANCE_STRICT 1
95
#define FF_COMPLIANCE_NORMAL 0
96
#define FF_COMPLIANCE_UNOFFICIAL -1
97
*/
98
#define AUDACITY_FF_COMPLIANCE_EXPERIMENTAL -2
99
100
/*
101
#define FF_PROFILE_AAC_MAIN 0
102
*/
103
#define AUDACITY_FF_PROFILE_AAC_LOW 1
104
/*
105
#define FF_PROFILE_AAC_SSR 2
106
#define FF_PROFILE_AAC_LTP 3
107
#define FF_PROFILE_AAC_HE 4
108
#define FF_PROFILE_AAC_HE_V2 28
109
#define FF_PROFILE_AAC_LD 22
110
#define FF_PROFILE_AAC_ELD 38
111
#define FF_PROFILE_MPEG2_AAC_LOW 128
112
#define FF_PROFILE_MPEG2_AAC_HE 131
113
*/
114
115
#define AUDACITY_AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
116
117
typedef
struct
AVDictionary
AVDictionary
;
118
typedef
struct
AVFifoBuffer
AVFifoBuffer
;
119
typedef
struct
AVFrame
AVFrame
;
120
typedef
struct
AVFormatContext
AVFormatContext
;
121
typedef
struct
AVPacket
AVPacket
;
122
typedef
struct
AVOutputFormat
AVOutputFormat
;
123
typedef
struct
AVStream
AVStream
;
124
typedef
struct
AVCodec
AVCodec
;
125
typedef
struct
AVInputFormat
AVInputFormat
;
126
typedef
struct
AVIOContext
AVIOContext
;
127
typedef
struct
AVCodecContext
AVCodecContext
;
128
129
using
AVCodecIDFwd
= int;
130
using
AVMediaTypeFwd
= int;
131
using
AVPixelFormatFwd
= int;
132
using
AVSampleFormatFwd
= int;
133
using
AVDiscardFwd
= int;
134
135
// Stable structures and emums
136
137
struct
AudacityAVRational
{
138
int
num
{ 0 };
139
int
den
{ 0 };
140
};
141
143
struct
AudacityAVDictionaryEntry
{
144
char
*
key
{
nullptr
};
145
char
*
value
{
nullptr
};
146
};
147
148
enum
AudacityAVSampleFormat
{
149
AUDACITY_AV_SAMPLE_FMT_NONE
= -1,
150
AUDACITY_AV_SAMPLE_FMT_U8
,
151
AUDACITY_AV_SAMPLE_FMT_S16
,
152
AUDACITY_AV_SAMPLE_FMT_S32
,
153
AUDACITY_AV_SAMPLE_FMT_FLT
,
154
AUDACITY_AV_SAMPLE_FMT_DBL
,
155
156
AUDACITY_AV_SAMPLE_FMT_U8P
,
157
AUDACITY_AV_SAMPLE_FMT_S16P
,
158
AUDACITY_AV_SAMPLE_FMT_S32P
,
159
AUDACITY_AV_SAMPLE_FMT_FLTP
,
160
AUDACITY_AV_SAMPLE_FMT_DBLP
,
161
AUDACITY_AV_SAMPLE_FMT_S64
,
162
AUDACITY_AV_SAMPLE_FMT_S64P
,
163
164
AUDACITY_AV_SAMPLE_FMT_NB
165
};
166
167
struct
FFMPegVersion
final
168
{
169
unsigned
Major
{ 0 };
170
unsigned
Minor
{ 0 };
171
unsigned
Micro
{ 0 };
172
173
unsigned
GetIntVersion
() const noexcept
174
{
175
return
AV_VERSION_INT
(
Major
,
Minor
,
Micro
);
176
}
177
};
178
179
typedef
struct
AVBuffer
AVBuffer
;
180
181
typedef
struct
AVChannelLayout
AVChannelLayout
;
182
183
struct
AudacityAVBufferRef
184
{
185
AVBuffer
*
buffer
;
186
187
uint8_t*
data
;
188
189
int
size
;
190
};
AVCodecIDFwd
int AVCodecIDFwd
Definition:
AVCodecID.h:407
AVDictionary
struct AVDictionary AVDictionary
Definition:
FFmpegTypes.h:117
AVPixelFormatFwd
int AVPixelFormatFwd
Definition:
FFmpegTypes.h:131
AVBuffer
struct AVBuffer AVBuffer
Definition:
FFmpegTypes.h:179
AVDiscardFwd
int AVDiscardFwd
Definition:
FFmpegTypes.h:133
AVMediaTypeFwd
int AVMediaTypeFwd
Definition:
FFmpegTypes.h:130
AV_VERSION_INT
#define AV_VERSION_INT(a, b, c)
Definition:
FFmpegTypes.h:77
AVSampleFormatFwd
int AVSampleFormatFwd
Definition:
FFmpegTypes.h:132
AudacityAVSampleFormat
AudacityAVSampleFormat
Definition:
FFmpegTypes.h:148
AUDACITY_AV_SAMPLE_FMT_S64P
@ AUDACITY_AV_SAMPLE_FMT_S64P
Definition:
FFmpegTypes.h:162
AUDACITY_AV_SAMPLE_FMT_NB
@ AUDACITY_AV_SAMPLE_FMT_NB
Number of sample formats. DO NOT USE if linking dynamically.
Definition:
FFmpegTypes.h:164
AUDACITY_AV_SAMPLE_FMT_DBLP
@ AUDACITY_AV_SAMPLE_FMT_DBLP
double, planar
Definition:
FFmpegTypes.h:160
AUDACITY_AV_SAMPLE_FMT_S32P
@ AUDACITY_AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition:
FFmpegTypes.h:158
AUDACITY_AV_SAMPLE_FMT_S16P
@ AUDACITY_AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition:
FFmpegTypes.h:157
AUDACITY_AV_SAMPLE_FMT_S64
@ AUDACITY_AV_SAMPLE_FMT_S64
Definition:
FFmpegTypes.h:161
AUDACITY_AV_SAMPLE_FMT_FLTP
@ AUDACITY_AV_SAMPLE_FMT_FLTP
float, planar
Definition:
FFmpegTypes.h:159
AUDACITY_AV_SAMPLE_FMT_NONE
@ AUDACITY_AV_SAMPLE_FMT_NONE
Definition:
FFmpegTypes.h:149
AUDACITY_AV_SAMPLE_FMT_S16
@ AUDACITY_AV_SAMPLE_FMT_S16
signed 16 bits
Definition:
FFmpegTypes.h:151
AUDACITY_AV_SAMPLE_FMT_S32
@ AUDACITY_AV_SAMPLE_FMT_S32
signed 32 bits
Definition:
FFmpegTypes.h:152
AUDACITY_AV_SAMPLE_FMT_DBL
@ AUDACITY_AV_SAMPLE_FMT_DBL
double
Definition:
FFmpegTypes.h:154
AUDACITY_AV_SAMPLE_FMT_FLT
@ AUDACITY_AV_SAMPLE_FMT_FLT
float
Definition:
FFmpegTypes.h:153
AUDACITY_AV_SAMPLE_FMT_U8
@ AUDACITY_AV_SAMPLE_FMT_U8
unsigned 8 bits
Definition:
FFmpegTypes.h:150
AUDACITY_AV_SAMPLE_FMT_U8P
@ AUDACITY_AV_SAMPLE_FMT_U8P
unsigned 8 bits, planar
Definition:
FFmpegTypes.h:156
AVChannelLayout
Definition:
ffmpeg-6.0.0-single-header.h:1561
AVCodecContext
Definition:
ffmpeg-2.3.6-single-header.h:2847
AVCodec
Definition:
ffmpeg-2.3.6-single-header.h:3466
AVFifoBuffer
Definition:
ffmpeg-2.3.6-single-header.h:4912
AVFormatContext
Definition:
ffmpeg-2.3.6-single-header.h:4536
AVFrame
Definition:
ffmpeg-2.3.6-single-header.h:1530
AVIOContext
Definition:
ffmpeg-2.3.6-single-header.h:4048
AVInputFormat
Definition:
ffmpeg-2.3.6-single-header.h:4283
AVOutputFormat
Definition:
ffmpeg-2.3.6-single-header.h:4236
AVPacket
Definition:
ffmpeg-2.3.6-single-header.h:2801
AVStream
Definition:
ffmpeg-2.3.6-single-header.h:4372
AudacityAVBufferRef
Definition:
FFmpegTypes.h:184
AudacityAVBufferRef::size
int size
Definition:
FFmpegTypes.h:189
AudacityAVBufferRef::data
uint8_t * data
Definition:
FFmpegTypes.h:187
AudacityAVBufferRef::buffer
AVBuffer * buffer
Definition:
FFmpegTypes.h:185
AudacityAVDictionaryEntry
Simply an overlay of AVDictionaryEntry, but we avoid including that type.
Definition:
FFmpegTypes.h:143
AudacityAVDictionaryEntry::key
char * key
Definition:
FFmpegTypes.h:144
AudacityAVDictionaryEntry::value
char * value
Definition:
FFmpegTypes.h:145
AudacityAVRational
Definition:
FFmpegTypes.h:137
AudacityAVRational::den
int den
denominator
Definition:
FFmpegTypes.h:139
AudacityAVRational::num
int num
numerator
Definition:
FFmpegTypes.h:138
FFMPegVersion
Definition:
FFmpegTypes.h:168
FFMPegVersion::Major
unsigned Major
Definition:
FFmpegTypes.h:169
FFMPegVersion::Micro
unsigned Micro
Definition:
FFmpegTypes.h:171
FFMPegVersion::Minor
unsigned Minor
Definition:
FFmpegTypes.h:170
FFMPegVersion::GetIntVersion
unsigned GetIntVersion() const noexcept
Definition:
FFmpegTypes.h:173
Generated by
1.9.3