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
12e7e1d0
Commit
12e7e1d0
authored
13 years ago
by
Anton Khirnov
Browse files
Options
Downloads
Patches
Plain Diff
graphparser: allow specifying sws flags in the graph description.
parent
4e781c25
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/filters.texi
+7
-1
7 additions, 1 deletion
doc/filters.texi
libavfilter/graphparser.c
+29
-0
29 additions, 0 deletions
libavfilter/graphparser.c
with
36 additions
and
1 deletion
doc/filters.texi
+
7
−
1
View file @
12e7e1d0
...
...
@@ -76,6 +76,12 @@ In a complete filterchain all the unlabelled filter input and output
pads must be connected. A filtergraph is considered valid if all the
filter input and output pads of all the filterchains are connected.
Libavfilter will automatically insert scale filters where format
conversion is required. It is possible to specify swscale flags
for those automatically inserted scalers by prepending
@code{sws_flags=@var{flags};}
to the filtergraph description.
Follows a BNF description for the filtergraph syntax:
@example
@var{NAME} ::= sequence of alphanumeric characters and '_'
...
...
@@ -84,7 +90,7 @@ Follows a BNF description for the filtergraph syntax:
@var{FILTER_ARGUMENTS} ::= sequence of chars (eventually quoted)
@var{FILTER} ::= [@var{LINKNAMES}] @var{NAME} ["=" @var{ARGUMENTS}] [@var{LINKNAMES}]
@var{FILTERCHAIN} ::= @var{FILTER} [,@var{FILTERCHAIN}]
@var{FILTERGRAPH} ::= @var{FILTERCHAIN} [;@var{FILTERGRAPH}]
@var{FILTERGRAPH} ::=
[sws_flags=@var{flags};]
@var{FILTERCHAIN} [;@var{FILTERGRAPH}]
@end example
@c man end FILTERGRAPH DESCRIPTION
...
...
This diff is collapsed.
Click to expand it.
libavfilter/graphparser.c
+
29
−
0
View file @
12e7e1d0
...
...
@@ -349,6 +349,30 @@ static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs,
#else
#define log_ctx NULL
#endif
static
int
parse_sws_flags
(
const
char
**
buf
,
AVFilterGraph
*
graph
)
{
char
*
p
=
strchr
(
*
buf
,
';'
);
if
(
strncmp
(
*
buf
,
"sws_flags="
,
10
))
return
0
;
if
(
!
p
)
{
av_log
(
log_ctx
,
AV_LOG_ERROR
,
"sws_flags not terminated with ';'.
\n
"
);
return
AVERROR
(
EINVAL
);
}
*
buf
+=
4
;
// keep the 'flags=' part
av_freep
(
&
graph
->
scale_sws_opts
);
if
(
!
(
graph
->
scale_sws_opts
=
av_mallocz
(
p
-
*
buf
+
1
)))
return
AVERROR
(
ENOMEM
);
av_strlcpy
(
graph
->
scale_sws_opts
,
*
buf
,
p
-
*
buf
+
1
);
*
buf
=
p
+
1
;
return
0
;
}
int
avfilter_graph_parse2
(
AVFilterGraph
*
graph
,
const
char
*
filters
,
AVFilterInOut
**
inputs
,
AVFilterInOut
**
outputs
)
...
...
@@ -358,6 +382,11 @@ int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters,
AVFilterInOut
*
curr_inputs
=
NULL
,
*
open_inputs
=
NULL
,
*
open_outputs
=
NULL
;
filters
+=
strspn
(
filters
,
WHITESPACES
);
if
((
ret
=
parse_sws_flags
(
&
filters
,
graph
))
<
0
)
goto
fail
;
do
{
AVFilterContext
*
filter
;
filters
+=
strspn
(
filters
,
WHITESPACES
);
...
...
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