FFmpeg
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
Functions
Variables
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
c
d
g
i
o
q
r
s
v
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
a
d
e
f
i
j
l
m
n
p
r
s
v
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
l
m
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
libavfilter
tests
drawutils.c
Go to the documentation of this file.
1
/*
2
* This file is part of FFmpeg.
3
*
4
* FFmpeg is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
8
*
9
* FFmpeg is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
13
*
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with FFmpeg; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
*/
18
19
#include <stdio.h>
20
21
#include "
libavutil/pixdesc.h
"
22
#include "
libavfilter/drawutils.h
"
23
24
int
main
(
void
)
25
{
26
enum
AVPixelFormat
f
;
27
const
AVPixFmtDescriptor
*
desc
;
28
FFDrawContext
draw;
29
FFDrawColor
color
;
30
int
r
,
i
;
31
32
for
(
f
= 0;
av_pix_fmt_desc_get
(
f
);
f
++) {
33
desc
=
av_pix_fmt_desc_get
(
f
);
34
if
(!
desc
->name)
35
continue
;
36
printf
(
"Testing %s...%*s"
,
desc
->name,
37
(
int
)(16 - strlen(
desc
->name)),
""
);
38
r
=
ff_draw_init
(&draw,
f
, 0);
39
if
(
r
< 0) {
40
char
buf[128];
41
av_strerror
(
r
, buf,
sizeof
(buf));
42
printf
(
"no: %s\n"
, buf);
43
continue
;
44
}
45
ff_draw_color
(&draw, &
color
, (uint8_t[]) { 1, 0, 0, 1 });
46
for
(
i
= 0;
i
<
sizeof
(
color
);
i
++)
47
if
(((uint8_t *)&
color
)[
i
] != 128)
48
break
;
49
if
(
i
==
sizeof
(
color
)) {
50
printf
(
"fallback color\n"
);
51
continue
;
52
}
53
printf
(
"ok\n"
);
54
}
55
return
0;
56
}
FFDrawColor
Definition:
drawutils.h:48
AVPixelFormat
AVPixelFormat
Pixel format.
Definition:
pixfmt.h:64
r
const char * r
Definition:
vf_curves.c:116
color
Definition:
vf_paletteuse.c:599
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition:
pixdesc.c:2660
pixdesc.h
av_strerror
int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
Put a description of the AVERROR code errnum in errbuf.
Definition:
error.c:105
ff_draw_init
int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
Init a draw context.
Definition:
drawutils.c:79
f
#define f(width, name)
Definition:
cbs_vp9.c:255
color
static const uint32_t color[16+AV_CLASS_CATEGORY_NB]
Definition:
log.c:92
printf
printf("static const uint8_t my_array[100] = {\n")
i
#define i(width, name, range_min, range_max)
Definition:
cbs_h2645.c:271
FFDrawContext
Definition:
drawutils.h:35
ff_draw_color
void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4])
Prepare a color.
Definition:
drawutils.c:141
desc
const char * desc
Definition:
libsvtav1.c:79
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition:
pixdesc.h:69
drawutils.h
main
int main(void)
Definition:
drawutils.c:24
Generated on Wed Aug 24 2022 21:38:09 for FFmpeg by
1.8.17