Audacity 3.2.0
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
119typedef struct AVFrame AVFrame;
121typedef struct AVPacket AVPacket;
123typedef struct AVStream AVStream;
124typedef struct AVCodec AVCodec;
128
129using AVCodecIDFwd = int;
130using AVMediaTypeFwd = int;
133using AVDiscardFwd = int;
134
135// Stable structures and emums
136
138 int num { 0 };
139 int den { 0 };
140};
141
144 char* key { nullptr };
145 char* value { nullptr };
146};
147
155
163
166
167struct FFMPegVersion final
168{
169 unsigned Major { 0 };
170 unsigned Minor { 0 };
171 unsigned Micro { 0 };
172
173 unsigned GetIntVersion() const noexcept
174 {
176 }
177};
178
179typedef struct AVBuffer AVBuffer;
180
182
184{
186
187 uint8_t* data;
188
189 int size;
190};
int AVCodecIDFwd
Definition: AVCodecID.h:407
struct AVDictionary AVDictionary
Definition: FFmpegTypes.h:117
int AVPixelFormatFwd
Definition: FFmpegTypes.h:131
struct AVBuffer AVBuffer
Definition: FFmpegTypes.h:179
int AVDiscardFwd
Definition: FFmpegTypes.h:133
int AVMediaTypeFwd
Definition: FFmpegTypes.h:130
#define AV_VERSION_INT(a, b, c)
Definition: FFmpegTypes.h:77
int AVSampleFormatFwd
Definition: FFmpegTypes.h:132
AudacityAVSampleFormat
Definition: FFmpegTypes.h:148
@ AUDACITY_AV_SAMPLE_FMT_S64P
Definition: FFmpegTypes.h:162
@ AUDACITY_AV_SAMPLE_FMT_NB
Number of sample formats. DO NOT USE if linking dynamically.
Definition: FFmpegTypes.h:164
@ AUDACITY_AV_SAMPLE_FMT_DBLP
double, planar
Definition: FFmpegTypes.h:160
@ AUDACITY_AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition: FFmpegTypes.h:158
@ AUDACITY_AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: FFmpegTypes.h:157
@ AUDACITY_AV_SAMPLE_FMT_S64
Definition: FFmpegTypes.h:161
@ AUDACITY_AV_SAMPLE_FMT_FLTP
float, planar
Definition: FFmpegTypes.h:159
@ AUDACITY_AV_SAMPLE_FMT_NONE
Definition: FFmpegTypes.h:149
@ AUDACITY_AV_SAMPLE_FMT_S16
signed 16 bits
Definition: FFmpegTypes.h:151
@ AUDACITY_AV_SAMPLE_FMT_S32
signed 32 bits
Definition: FFmpegTypes.h:152
@ AUDACITY_AV_SAMPLE_FMT_DBL
double
Definition: FFmpegTypes.h:154
@ AUDACITY_AV_SAMPLE_FMT_FLT
float
Definition: FFmpegTypes.h:153
@ AUDACITY_AV_SAMPLE_FMT_U8
unsigned 8 bits
Definition: FFmpegTypes.h:150
@ AUDACITY_AV_SAMPLE_FMT_U8P
unsigned 8 bits, planar
Definition: FFmpegTypes.h:156
Simply an overlay of AVDictionaryEntry, but we avoid including that type.
Definition: FFmpegTypes.h:143
char * key
Definition: FFmpegTypes.h:144
char * value
Definition: FFmpegTypes.h:145
int den
denominator
Definition: FFmpegTypes.h:139
int num
numerator
Definition: FFmpegTypes.h:138
unsigned Major
Definition: FFmpegTypes.h:169
unsigned Micro
Definition: FFmpegTypes.h:171
unsigned Minor
Definition: FFmpegTypes.h:170
unsigned GetIntVersion() const noexcept
Definition: FFmpegTypes.h:173