Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
1d2ecf96
Commit
1d2ecf96
authored
May 13, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/drawtext: switch to AV_OPT_TYPE_COLOR
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
83e89223
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
24 deletions
+3
-24
vf_drawtext.c
libavfilter/vf_drawtext.c
+3
-24
No files found.
libavfilter/vf_drawtext.c
View file @
1d2ecf96
...
...
@@ -136,9 +136,6 @@ typedef struct {
int
max_glyph_h
;
///< max glyph height
int
shadowx
,
shadowy
;
unsigned
int
fontsize
;
///< font size to use
char
*
fontcolor_string
;
///< font color as string
char
*
boxcolor_string
;
///< box color as string
char
*
shadowcolor_string
;
///< shadow color as string
short
int
draw_box
;
///< draw box around text - true or false
int
use_kerning
;
///< font kerning is used - true/false
...
...
@@ -176,9 +173,9 @@ static const AVOption drawtext_options[]= {
{
"fontfile"
,
"set font file"
,
OFFSET
(
fontfile
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
{
"text"
,
"set text"
,
OFFSET
(
text
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
{
"textfile"
,
"set text file"
,
OFFSET
(
textfile
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
{
"fontcolor"
,
"set foreground color"
,
OFFSET
(
fontcolor
_string
),
AV_OPT_TYPE_STRING
,
{.
str
=
"black"
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
{
"boxcolor"
,
"set box color"
,
OFFSET
(
boxcolor
_string
),
AV_OPT_TYPE_STRING
,
{.
str
=
"white"
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
{
"shadowcolor"
,
"set shadow color"
,
OFFSET
(
shadowcolor
_string
),
AV_OPT_TYPE_STRING
,
{.
str
=
"black"
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
{
"fontcolor"
,
"set foreground color"
,
OFFSET
(
fontcolor
.
rgba
),
AV_OPT_TYPE_COLOR
,
{.
str
=
"black"
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
{
"boxcolor"
,
"set box color"
,
OFFSET
(
boxcolor
.
rgba
),
AV_OPT_TYPE_COLOR
,
{.
str
=
"white"
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
{
"shadowcolor"
,
"set shadow color"
,
OFFSET
(
shadowcolor
.
rgba
),
AV_OPT_TYPE_COLOR
,
{.
str
=
"black"
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
{
"box"
,
"set box"
,
OFFSET
(
draw_box
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
1
,
FLAGS
},
{
"fontsize"
,
"set font size"
,
OFFSET
(
fontsize
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT_MAX
,
FLAGS
},
{
"x"
,
"set x expression"
,
OFFSET
(
x_expr
),
AV_OPT_TYPE_STRING
,
{.
str
=
"0"
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
...
...
@@ -458,24 +455,6 @@ static av_cold int init(AVFilterContext *ctx)
return
AVERROR
(
EINVAL
);
}
if
((
err
=
av_parse_color
(
s
->
fontcolor
.
rgba
,
s
->
fontcolor_string
,
-
1
,
ctx
)))
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid font color '%s'
\n
"
,
s
->
fontcolor_string
);
return
err
;
}
if
((
err
=
av_parse_color
(
s
->
boxcolor
.
rgba
,
s
->
boxcolor_string
,
-
1
,
ctx
)))
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid box color '%s'
\n
"
,
s
->
boxcolor_string
);
return
err
;
}
if
((
err
=
av_parse_color
(
s
->
shadowcolor
.
rgba
,
s
->
shadowcolor_string
,
-
1
,
ctx
)))
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid shadow color '%s'
\n
"
,
s
->
shadowcolor_string
);
return
err
;
}
if
((
err
=
FT_Init_FreeType
(
&
(
s
->
library
))))
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Could not load FreeType: %s
\n
"
,
FT_ERRMSG
(
err
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment