Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
a70519aa
Commit
a70519aa
authored
12 years ago
by
Anton Khirnov
Browse files
Options
Downloads
Patches
Plain Diff
vf_overlay: use the name 's' for the pointer to the private context
This is shorter and consistent across filters.
parent
8d2565c2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavfilter/vf_overlay.c
+21
-21
21 additions, 21 deletions
libavfilter/vf_overlay.c
with
21 additions
and
21 deletions
libavfilter/vf_overlay.c
+
21
−
21
View file @
a70519aa
...
@@ -101,12 +101,12 @@ static int query_formats(AVFilterContext *ctx)
...
@@ -101,12 +101,12 @@ static int query_formats(AVFilterContext *ctx)
static
int
config_input_main
(
AVFilterLink
*
inlink
)
static
int
config_input_main
(
AVFilterLink
*
inlink
)
{
{
OverlayContext
*
over
=
inlink
->
dst
->
priv
;
OverlayContext
*
s
=
inlink
->
dst
->
priv
;
const
AVPixFmtDescriptor
*
pix_desc
=
av_pix_fmt_desc_get
(
inlink
->
format
);
const
AVPixFmtDescriptor
*
pix_desc
=
av_pix_fmt_desc_get
(
inlink
->
format
);
av_image_fill_max_pixsteps
(
over
->
max_plane_step
,
NULL
,
pix_desc
);
av_image_fill_max_pixsteps
(
s
->
max_plane_step
,
NULL
,
pix_desc
);
over
->
hsub
=
pix_desc
->
log2_chroma_w
;
s
->
hsub
=
pix_desc
->
log2_chroma_w
;
over
->
vsub
=
pix_desc
->
log2_chroma_h
;
s
->
vsub
=
pix_desc
->
log2_chroma_h
;
return
0
;
return
0
;
}
}
...
@@ -114,7 +114,7 @@ static int config_input_main(AVFilterLink *inlink)
...
@@ -114,7 +114,7 @@ static int config_input_main(AVFilterLink *inlink)
static
int
config_input_overlay
(
AVFilterLink
*
inlink
)
static
int
config_input_overlay
(
AVFilterLink
*
inlink
)
{
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
AVFilterContext
*
ctx
=
inlink
->
dst
;
OverlayContext
*
over
=
inlink
->
dst
->
priv
;
OverlayContext
*
s
=
inlink
->
dst
->
priv
;
char
*
expr
;
char
*
expr
;
double
var_values
[
VAR_VARS_NB
],
res
;
double
var_values
[
VAR_VARS_NB
],
res
;
int
ret
;
int
ret
;
...
@@ -130,36 +130,36 @@ static int config_input_overlay(AVFilterLink *inlink)
...
@@ -130,36 +130,36 @@ static int config_input_overlay(AVFilterLink *inlink)
var_values
[
VAR_OVERLAY_W
]
=
var_values
[
VAR_OW
]
=
ctx
->
inputs
[
OVERLAY
]
->
w
;
var_values
[
VAR_OVERLAY_W
]
=
var_values
[
VAR_OW
]
=
ctx
->
inputs
[
OVERLAY
]
->
w
;
var_values
[
VAR_OVERLAY_H
]
=
var_values
[
VAR_OH
]
=
ctx
->
inputs
[
OVERLAY
]
->
h
;
var_values
[
VAR_OVERLAY_H
]
=
var_values
[
VAR_OH
]
=
ctx
->
inputs
[
OVERLAY
]
->
h
;
if
((
ret
=
av_expr_parse_and_eval
(
&
res
,
(
expr
=
over
->
x_expr
),
var_names
,
var_values
,
if
((
ret
=
av_expr_parse_and_eval
(
&
res
,
(
expr
=
s
->
x_expr
),
var_names
,
var_values
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
ctx
))
<
0
)
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
ctx
))
<
0
)
goto
fail
;
goto
fail
;
over
->
x
=
res
;
s
->
x
=
res
;
if
((
ret
=
av_expr_parse_and_eval
(
&
res
,
(
expr
=
over
->
y_expr
),
var_names
,
var_values
,
if
((
ret
=
av_expr_parse_and_eval
(
&
res
,
(
expr
=
s
->
y_expr
),
var_names
,
var_values
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
ctx
)))
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
ctx
)))
goto
fail
;
goto
fail
;
over
->
y
=
res
;
s
->
y
=
res
;
/* x may depend on y */
/* x may depend on y */
if
((
ret
=
av_expr_parse_and_eval
(
&
res
,
(
expr
=
over
->
x_expr
),
var_names
,
var_values
,
if
((
ret
=
av_expr_parse_and_eval
(
&
res
,
(
expr
=
s
->
x_expr
),
var_names
,
var_values
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
ctx
))
<
0
)
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
ctx
))
<
0
)
goto
fail
;
goto
fail
;
over
->
x
=
res
;
s
->
x
=
res
;
av_log
(
ctx
,
AV_LOG_VERBOSE
,
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"main w:%d h:%d fmt:%s overlay x:%d y:%d w:%d h:%d fmt:%s
\n
"
,
"main w:%d h:%d fmt:%s overlay x:%d y:%d w:%d h:%d fmt:%s
\n
"
,
ctx
->
inputs
[
MAIN
]
->
w
,
ctx
->
inputs
[
MAIN
]
->
h
,
ctx
->
inputs
[
MAIN
]
->
w
,
ctx
->
inputs
[
MAIN
]
->
h
,
av_get_pix_fmt_name
(
ctx
->
inputs
[
MAIN
]
->
format
),
av_get_pix_fmt_name
(
ctx
->
inputs
[
MAIN
]
->
format
),
over
->
x
,
over
->
y
,
s
->
x
,
s
->
y
,
ctx
->
inputs
[
OVERLAY
]
->
w
,
ctx
->
inputs
[
OVERLAY
]
->
h
,
ctx
->
inputs
[
OVERLAY
]
->
w
,
ctx
->
inputs
[
OVERLAY
]
->
h
,
av_get_pix_fmt_name
(
ctx
->
inputs
[
OVERLAY
]
->
format
));
av_get_pix_fmt_name
(
ctx
->
inputs
[
OVERLAY
]
->
format
));
if
(
over
->
x
<
0
||
over
->
y
<
0
||
if
(
s
->
x
<
0
||
s
->
y
<
0
||
over
->
x
+
var_values
[
VAR_OVERLAY_W
]
>
var_values
[
VAR_MAIN_W
]
||
s
->
x
+
var_values
[
VAR_OVERLAY_W
]
>
var_values
[
VAR_MAIN_W
]
||
over
->
y
+
var_values
[
VAR_OVERLAY_H
]
>
var_values
[
VAR_MAIN_H
])
{
s
->
y
+
var_values
[
VAR_OVERLAY_H
]
>
var_values
[
VAR_MAIN_H
])
{
av_log
(
ctx
,
AV_LOG_ERROR
,
av_log
(
ctx
,
AV_LOG_ERROR
,
"Overlay area (%d,%d)<->(%d,%d) not within the main area (0,0)<->(%d,%d) or zero-sized
\n
"
,
"Overlay area (%d,%d)<->(%d,%d) not within the main area (0,0)<->(%d,%d) or zero-sized
\n
"
,
over
->
x
,
over
->
y
,
s
->
x
,
s
->
y
,
(
int
)(
over
->
x
+
var_values
[
VAR_OVERLAY_W
]),
(
int
)(
s
->
x
+
var_values
[
VAR_OVERLAY_W
]),
(
int
)(
over
->
y
+
var_values
[
VAR_OVERLAY_H
]),
(
int
)(
s
->
y
+
var_values
[
VAR_OVERLAY_H
]),
(
int
)
var_values
[
VAR_MAIN_W
],
(
int
)
var_values
[
VAR_MAIN_H
]);
(
int
)
var_values
[
VAR_MAIN_W
],
(
int
)
var_values
[
VAR_MAIN_H
]);
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
}
}
...
@@ -186,7 +186,7 @@ static void blend_frame(AVFilterContext *ctx,
...
@@ -186,7 +186,7 @@ static void blend_frame(AVFilterContext *ctx,
AVFrame
*
dst
,
AVFrame
*
src
,
AVFrame
*
dst
,
AVFrame
*
src
,
int
x
,
int
y
)
int
x
,
int
y
)
{
{
OverlayContext
*
over
=
ctx
->
priv
;
OverlayContext
*
s
=
ctx
->
priv
;
int
i
,
j
,
k
;
int
i
,
j
,
k
;
int
width
,
height
;
int
width
,
height
;
int
overlay_end_y
=
y
+
src
->
height
;
int
overlay_end_y
=
y
+
src
->
height
;
...
@@ -218,8 +218,8 @@ static void blend_frame(AVFilterContext *ctx,
...
@@ -218,8 +218,8 @@ static void blend_frame(AVFilterContext *ctx,
}
}
}
else
{
}
else
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
int
hsub
=
i
?
over
->
hsub
:
0
;
int
hsub
=
i
?
s
->
hsub
:
0
;
int
vsub
=
i
?
over
->
vsub
:
0
;
int
vsub
=
i
?
s
->
vsub
:
0
;
uint8_t
*
dp
=
dst
->
data
[
i
]
+
(
x
>>
hsub
)
+
uint8_t
*
dp
=
dst
->
data
[
i
]
+
(
x
>>
hsub
)
+
(
start_y
>>
vsub
)
*
dst
->
linesize
[
i
];
(
start_y
>>
vsub
)
*
dst
->
linesize
[
i
];
uint8_t
*
sp
=
src
->
data
[
i
];
uint8_t
*
sp
=
src
->
data
[
i
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment