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#if EDOM > 0
17# define AUDACITY_AVERROR(e) \
18 (-(e))
20# define AUDACITY_AVUNERROR(e) \
21 (-(e))
23#else
24/* Some platforms have E* and errno already negated. */
25# define AUDACITY_AVERROR(e) (e)
26# define AUDACITY_AVUNERROR(e) (e)
27#endif
28
29#define AUDACITY_AVFMT_NOFILE 0x0001
30/*
31#define AVFMT_NEEDNUMBER 0x0002
32#define AVFMT_SHOW_IDS 0x0008
33#define AVFMT_RAWPICTURE 0x0020
34 */
35#define AUDACITY_AVFMT_GLOBALHEADER 0x0040
36/*
37#define AVFMT_NOTIMESTAMPS 0x0080
38#define AVFMT_GENERIC_INDEX 0x0100
39#define AVFMT_TS_DISCONT 0x0200
40#define AVFMT_VARIABLE_FPS 0x0400
41#define AVFMT_NODIMENSIONS 0x0800
42#define AVFMT_NOSTREAMS 0x1000
43#define AVFMT_NOBINSEARCH 0x2000
44#define AVFMT_NOGENSEARCH 0x4000
45#define AVFMT_NO_BYTE_SEEK 0x8000
46#define AVFMT_ALLOW_FLUSH 0x10000
47#define AVFMT_TS_NONSTRICT 0x20000
48#define AVFMT_TS_NEGATIVE 0x40000
49#define AVFMT_SEEK_TO_PTS 0x4000000
50
51#define AVFMT_FLAG_GENPTS 0x0001
52#define AVFMT_FLAG_IGNIDX 0x0002
53#define AVFMT_FLAG_NONBLOCK 0x0004
54#define AVFMT_FLAG_IGNDTS 0x0008
55#define AVFMT_FLAG_NOFILLIN 0x0010
56#define AVFMT_FLAG_NOPARSE 0x0020
57#define AVFMT_FLAG_NOBUFFER 0x0040
58#define AVFMT_FLAG_CUSTOM_IO 0x0080
59#define AVFMT_FLAG_DISCARD_CORRUPT 0x0100
60#define AVFMT_FLAG_FLUSH_PACKETS 0x0200
61
62#define AVFMT_FLAG_BITEXACT 0x0400
63#define AVFMT_FLAG_MP4A_LATM 0x8000
64#define AVFMT_FLAG_SORT_DTS 0x10000
65#define AVFMT_FLAG_PRIV_OPT 0x20000
66#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000
67*/
68
69#define AUDACITY_AV_NOPTS_VALUE ((int64_t)UINT64_C(0x8000000000000000))
70
71#ifndef AV_VERSION_INT
72#define AV_VERSION_INT(a, b, c) (a << 16 | b << 8 | c)
73#endif
74
75#define AUDACITY_AV_TIME_BASE (1000 * 1000)
76
77#define AUDACITY_AV_CODEC_FLAG_QSCALE (1 << 1)
78
79#define AUDACITY_AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6)
80
81
82//#define FF_LAMBDA_SHIFT 7
83//#define FF_LAMBDA_SCALE (1 << FF_LAMBDA_SHIFT)
84#define AUDACITY_FF_QP2LAMBDA 118
85//#define FF_LAMBDA_MAX (256 * 128 - 1)
86
87/*
88#define FF_COMPLIANCE_VERY_STRICT 2
89#define FF_COMPLIANCE_STRICT 1
90#define FF_COMPLIANCE_NORMAL 0
91#define FF_COMPLIANCE_UNOFFICIAL -1
92 */
93#define AUDACITY_FF_COMPLIANCE_EXPERIMENTAL -2
94
95/*
96#define FF_PROFILE_AAC_MAIN 0
97 */
98#define AUDACITY_FF_PROFILE_AAC_LOW 1
99/*
100#define FF_PROFILE_AAC_SSR 2
101#define FF_PROFILE_AAC_LTP 3
102#define FF_PROFILE_AAC_HE 4
103#define FF_PROFILE_AAC_HE_V2 28
104#define FF_PROFILE_AAC_LD 22
105#define FF_PROFILE_AAC_ELD 38
106#define FF_PROFILE_MPEG2_AAC_LOW 128
107#define FF_PROFILE_MPEG2_AAC_HE 131
108 */
109
110#define AUDACITY_AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
111
114typedef struct AVFrame AVFrame;
116typedef struct AVPacket AVPacket;
118typedef struct AVStream AVStream;
119typedef struct AVCodec AVCodec;
123
124using AVCodecIDFwd = int;
125using AVMediaTypeFwd = int;
128using AVDiscardFwd = int;
129
130// Stable structures and emums
131
133 int num { 0 };
134 int den { 0 };
135};
136
139 char* key { nullptr };
140 char* value { nullptr };
141};
142
150
158
161
162struct FFMPegVersion final
163{
164 unsigned Major { 0 };
165 unsigned Minor { 0 };
166 unsigned Micro { 0 };
167
168 unsigned GetIntVersion() const noexcept
169 {
171 }
172};
173
174typedef struct AVBuffer AVBuffer;
175
177{
179
180 uint8_t* data;
181
182 int size;
183};
int AVCodecIDFwd
Definition: AVCodecID.h:407
struct AVDictionary AVDictionary
Definition: FFmpegTypes.h:112
int AVPixelFormatFwd
Definition: FFmpegTypes.h:126
struct AVBuffer AVBuffer
Definition: FFmpegTypes.h:174
int AVDiscardFwd
Definition: FFmpegTypes.h:128
int AVMediaTypeFwd
Definition: FFmpegTypes.h:125
#define AV_VERSION_INT(a, b, c)
Definition: FFmpegTypes.h:72
int AVSampleFormatFwd
Definition: FFmpegTypes.h:127
AudacityAVSampleFormat
Definition: FFmpegTypes.h:143
@ AUDACITY_AV_SAMPLE_FMT_S64P
Definition: FFmpegTypes.h:157
@ AUDACITY_AV_SAMPLE_FMT_NB
Number of sample formats. DO NOT USE if linking dynamically.
Definition: FFmpegTypes.h:159
@ AUDACITY_AV_SAMPLE_FMT_DBLP
double, planar
Definition: FFmpegTypes.h:155
@ AUDACITY_AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition: FFmpegTypes.h:153
@ AUDACITY_AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: FFmpegTypes.h:152
@ AUDACITY_AV_SAMPLE_FMT_S64
Definition: FFmpegTypes.h:156
@ AUDACITY_AV_SAMPLE_FMT_FLTP
float, planar
Definition: FFmpegTypes.h:154
@ AUDACITY_AV_SAMPLE_FMT_NONE
Definition: FFmpegTypes.h:144
@ AUDACITY_AV_SAMPLE_FMT_S16
signed 16 bits
Definition: FFmpegTypes.h:146
@ AUDACITY_AV_SAMPLE_FMT_S32
signed 32 bits
Definition: FFmpegTypes.h:147
@ AUDACITY_AV_SAMPLE_FMT_DBL
double
Definition: FFmpegTypes.h:149
@ AUDACITY_AV_SAMPLE_FMT_FLT
float
Definition: FFmpegTypes.h:148
@ AUDACITY_AV_SAMPLE_FMT_U8
unsigned 8 bits
Definition: FFmpegTypes.h:145
@ AUDACITY_AV_SAMPLE_FMT_U8P
unsigned 8 bits, planar
Definition: FFmpegTypes.h:151
Simply an overlay of AVDictionaryEntry, but we avoid including that type.
Definition: FFmpegTypes.h:138
char * key
Definition: FFmpegTypes.h:139
char * value
Definition: FFmpegTypes.h:140
int den
denominator
Definition: FFmpegTypes.h:134
int num
numerator
Definition: FFmpegTypes.h:133
unsigned Major
Definition: FFmpegTypes.h:164
unsigned Micro
Definition: FFmpegTypes.h:166
unsigned Minor
Definition: FFmpegTypes.h:165
unsigned GetIntVersion() const noexcept
Definition: FFmpegTypes.h:168