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
9ab79612
Commit
9ab79612
authored
Apr 12, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter: Update scale to dictionary based options
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
710b0aa8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
20 deletions
+8
-20
avfilter.c
libavfilter/avfilter.c
+0
-1
vf_scale.c
libavfilter/vf_scale.c
+8
-19
No files found.
libavfilter/avfilter.c
View file @
9ab79612
...
...
@@ -690,7 +690,6 @@ static const char *const filters_left_to_update[] = {
"atempo"
,
"buffer"
,
"pan"
,
"scale"
,
};
static
int
filter_use_deprecated_init
(
const
char
*
name
)
...
...
libavfilter/vf_scale.c
View file @
9ab79612
...
...
@@ -95,21 +95,7 @@ typedef struct {
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
ScaleContext
*
scale
=
ctx
->
priv
;
#if 1
static
const
char
*
shorthand
[]
=
{
"w"
,
"h"
,
NULL
};
int
ret
;
const
char
*
args0
=
args
;
if
(
args
&&
(
scale
->
size_str
=
av_get_token
(
&
args
,
":"
)))
{
if
(
av_parse_video_size
(
&
scale
->
w
,
&
scale
->
h
,
scale
->
size_str
)
<
0
)
{
av_freep
(
&
scale
->
size_str
);
args
=
args0
;
}
else
if
(
*
args
)
args
++
;
}
if
((
ret
=
av_opt_set_from_string
(
scale
,
args
,
shorthand
,
"="
,
":"
))
<
0
)
return
ret
;
if
(
scale
->
size_str
&&
(
scale
->
w_expr
||
scale
->
h_expr
))
{
av_log
(
ctx
,
AV_LOG_ERROR
,
...
...
@@ -117,6 +103,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
return
AVERROR
(
EINVAL
);
}
if
(
scale
->
w_expr
&&
!
scale
->
h_expr
)
FFSWAP
(
char
*
,
scale
->
w_expr
,
scale
->
size_str
);
if
(
scale
->
size_str
)
{
char
buf
[
32
];
if
((
ret
=
av_parse_video_size
(
&
scale
->
w
,
&
scale
->
h
,
scale
->
size_str
))
<
0
)
{
...
...
@@ -138,7 +127,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
scale
->
w_expr
,
scale
->
h_expr
,
(
char
*
)
av_x_if_null
(
scale
->
flags_str
,
""
),
scale
->
interlaced
);
scale
->
flags
=
SWS_BILINEAR
;
#endif
if
(
scale
->
flags_str
)
{
const
AVClass
*
class
=
sws_get_class
();
const
AVOption
*
o
=
av_opt_find
(
&
class
,
"sws_flags"
,
NULL
,
0
,
...
...
@@ -399,10 +388,10 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
static
const
AVOption
scale_options
[]
=
{
{
"w"
,
"Output video width"
,
OFFSET
(
w_expr
),
AV_OPT_TYPE_STRING
,
{
.
str
=
"iw"
},
.
flags
=
FLAGS
},
{
"width"
,
"Output video width"
,
OFFSET
(
w_expr
),
AV_OPT_TYPE_STRING
,
{
.
str
=
"iw"
},
.
flags
=
FLAGS
},
{
"h"
,
"Output video height"
,
OFFSET
(
h_expr
),
AV_OPT_TYPE_STRING
,
{
.
str
=
"ih"
},
.
flags
=
FLAGS
},
{
"height"
,
"Output video height"
,
OFFSET
(
h_expr
),
AV_OPT_TYPE_STRING
,
{
.
str
=
"ih"
},
.
flags
=
FLAGS
},
{
"w"
,
"Output video width"
,
OFFSET
(
w_expr
),
AV_OPT_TYPE_STRING
,
.
flags
=
FLAGS
},
{
"width"
,
"Output video width"
,
OFFSET
(
w_expr
),
AV_OPT_TYPE_STRING
,
.
flags
=
FLAGS
},
{
"h"
,
"Output video height"
,
OFFSET
(
h_expr
),
AV_OPT_TYPE_STRING
,
.
flags
=
FLAGS
},
{
"height"
,
"Output video height"
,
OFFSET
(
h_expr
),
AV_OPT_TYPE_STRING
,
.
flags
=
FLAGS
},
{
"flags"
,
"Flags to pass to libswscale"
,
OFFSET
(
flags_str
),
AV_OPT_TYPE_STRING
,
{
.
str
=
"bilinear"
},
.
flags
=
FLAGS
},
{
"interl"
,
"set interlacing"
,
OFFSET
(
interlaced
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
1
,
1
,
FLAGS
},
{
"size"
,
"set video size"
,
OFFSET
(
size_str
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
FLAGS
},
...
...
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