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
5229b783
Commit
5229b783
authored
Apr 16, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/aspect: extend verbose feedback, show old SAR and DAR values
parent
fe5ca6b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
+23
-5
vf_aspect.c
libavfilter/vf_aspect.c
+23
-5
No files found.
libavfilter/vf_aspect.c
View file @
5229b783
...
...
@@ -79,12 +79,22 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
#define OFFSET(x) offsetof(AspectContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static
inline
void
compute_dar
(
AVRational
*
dar
,
AVRational
sar
,
int
w
,
int
h
)
{
if
(
sar
.
num
&&
sar
.
den
)
{
av_reduce
(
&
dar
->
num
,
&
dar
->
den
,
sar
.
num
*
w
,
sar
.
den
*
h
,
INT_MAX
);
}
else
{
av_reduce
(
&
dar
->
num
,
&
dar
->
den
,
w
,
h
,
INT_MAX
);
}
}
#if CONFIG_SETDAR_FILTER
static
int
setdar_config_props
(
AVFilterLink
*
inlink
)
{
AspectContext
*
aspect
=
inlink
->
dst
->
priv
;
AVRational
dar
=
aspect
->
aspect
;
AVRational
dar
=
aspect
->
aspect
,
old_dar
;
AVRational
old_sar
=
inlink
->
sample_aspect_ratio
;
if
(
aspect
->
aspect
.
num
&&
aspect
->
aspect
.
den
)
{
av_reduce
(
&
aspect
->
aspect
.
num
,
&
aspect
->
aspect
.
den
,
...
...
@@ -96,9 +106,10 @@ static int setdar_config_props(AVFilterLink *inlink)
dar
=
(
AVRational
){
inlink
->
w
,
inlink
->
h
};
}
av_log
(
inlink
->
dst
,
AV_LOG_VERBOSE
,
"w:%d h:%d -> dar:%d/%d sar:%d/%d
\n
"
,
inlink
->
w
,
inlink
->
h
,
dar
.
num
,
dar
.
den
,
inlink
->
sample_aspect_ratio
.
num
,
inlink
->
sample_aspect_ratio
.
den
);
compute_dar
(
&
old_dar
,
old_sar
,
inlink
->
w
,
inlink
->
h
);
av_log
(
inlink
->
dst
,
AV_LOG_VERBOSE
,
"w:%d h:%d dar:%d/%d sar:%d/%d -> dar:%d/%d sar:%d/%d
\n
"
,
inlink
->
w
,
inlink
->
h
,
old_dar
.
num
,
old_dar
.
den
,
old_sar
.
num
,
old_sar
.
den
,
dar
.
den
,
dar
.
num
,
inlink
->
sample_aspect_ratio
.
num
,
inlink
->
sample_aspect_ratio
.
den
);
return
0
;
}
...
...
@@ -152,13 +163,20 @@ AVFilter avfilter_vf_setdar = {
#if CONFIG_SETSAR_FILTER
static
int
setsar_config_props
(
AVFilterLink
*
inlink
)
{
AspectContext
*
aspect
=
inlink
->
dst
->
priv
;
AVRational
old_sar
=
inlink
->
sample_aspect_ratio
;
AVRational
old_dar
,
dar
;
inlink
->
sample_aspect_ratio
=
aspect
->
aspect
;
compute_dar
(
&
old_dar
,
old_sar
,
inlink
->
w
,
inlink
->
h
);
compute_dar
(
&
dar
,
aspect
->
aspect
,
inlink
->
w
,
inlink
->
h
);
av_log
(
inlink
->
dst
,
AV_LOG_VERBOSE
,
"w:%d h:%d sar:%d/%d dar:%d/%d -> sar:%d/%d dar:%d/%d
\n
"
,
inlink
->
w
,
inlink
->
h
,
old_sar
.
num
,
old_sar
.
den
,
old_dar
.
num
,
old_dar
.
den
,
inlink
->
sample_aspect_ratio
.
num
,
inlink
->
sample_aspect_ratio
.
den
,
dar
.
num
,
dar
.
den
);
return
0
;
}
...
...
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