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
ad3f6212
Commit
ad3f6212
authored
Apr 09, 2020
by
John Stebbins
Committed by
Philip Langdale
Apr 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/movtextenc: handle changes to hilight alpha
Signed-off-by:
Philip Langdale
<
philipl@overt.org
>
parent
eeef8708
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
9 deletions
+28
-9
movtextenc.c
libavcodec/movtextenc.c
+28
-9
No files found.
libavcodec/movtextenc.c
View file @
ad3f6212
...
...
@@ -479,19 +479,23 @@ static void mov_text_color_cb(void *priv, unsigned int color, unsigned int color
if
(
color_id
==
1
)
{
//primary color changes
mov_text_color_set
(
s
,
color
);
}
else
if
(
color_id
==
2
)
{
//secondary color changes
if
(
s
->
box_flags
&
HLIT_BOX
)
{
//close tag
s
->
hlit
.
end
=
s
->
text_pos
;
}
else
{
if
(
!
(
s
->
box_flags
&
HCLR_BOX
))
// Highlight alpha not set yet, use current primary alpha
s
->
hclr
.
color
=
s
->
style_attributes_temp
->
style_color
;
if
(
!
(
s
->
box_flags
&
HLIT_BOX
)
||
s
->
hlit
.
start
==
s
->
text_pos
)
{
s
->
box_flags
|=
HCLR_BOX
;
s
->
box_flags
|=
HLIT_BOX
;
s
->
hlit
.
start
=
s
->
text_pos
;
s
->
hclr
.
color
=
color
|
0xFF
;
//set alpha value to FF
s
->
hclr
.
color
=
color
|
(
s
->
hclr
.
color
&
0xFF
);
}
else
//close tag
s
->
hlit
.
end
=
s
->
text_pos
;
/* If there are more than one secondary color changes in ASS,
take start of first section and end of last section. Movtext
allows only one highlight box per sample.
*/
}
/* If there are more than one secondary color changes in ASS, take start of
first section and end of last section. Movtext allows only one
highlight box per sample.
*/
// Movtext does not support changes to other color_id (outline, background)
}
static
void
mov_text_alpha_set
(
MovTextContext
*
s
,
uint8_t
alpha
)
...
...
@@ -510,8 +514,23 @@ static void mov_text_alpha_cb(void *priv, int alpha, int alpha_id)
{
MovTextContext
*
s
=
priv
;
alpha
=
255
-
alpha
;
if
(
alpha_id
==
1
)
// primary alpha changes
mov_text_alpha_set
(
s
,
255
-
alpha
);
mov_text_alpha_set
(
s
,
alpha
);
else
if
(
alpha_id
==
2
)
{
//secondary alpha changes
if
(
!
(
s
->
box_flags
&
HCLR_BOX
))
// Highlight color not set yet, use current primary color
s
->
hclr
.
color
=
s
->
style_attributes_temp
->
style_color
;
if
(
!
(
s
->
box_flags
&
HLIT_BOX
)
||
s
->
hlit
.
start
==
s
->
text_pos
)
{
s
->
box_flags
|=
HCLR_BOX
;
s
->
box_flags
|=
HLIT_BOX
;
s
->
hlit
.
start
=
s
->
text_pos
;
s
->
hclr
.
color
=
(
s
->
hclr
.
color
&
0xffffff00
)
|
alpha
;
}
else
//close tag
s
->
hlit
.
end
=
s
->
text_pos
;
}
// Movtext does not support changes to other alpha_id (outline, background)
}
static
uint16_t
find_font_id
(
MovTextContext
*
s
,
const
char
*
name
)
...
...
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