Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ffworker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Video AG Infrastruktur
ffworker
Commits
22d0d3a1
Commit
22d0d3a1
authored
7 years ago
by
Julian Rother
Browse files
Options
Downloads
Patches
Plain Diff
transcode: Connect remaining open filter pads based on pad names
parent
bf0b74d1
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
transcode.c
+20
-1
20 additions, 1 deletion
transcode.c
with
20 additions
and
1 deletion
transcode.c
+
20
−
1
View file @
22d0d3a1
...
...
@@ -223,6 +223,25 @@ static void filtergraph_send(AVFilterContext *src, AVCodecContext *dec, AVPacket
av_frame_free
(
&
frame
);
}
void
connect_pads
(
AVFilterInOut
**
ins
,
AVFilterInOut
**
outs
)
{
int
err
;
AVFilterInOut
*
in
,
*
out
;
/* TODO: Really remove matched pads from ins/outs */
for
(
in
=
*
ins
;
in
;
in
=
in
->
next
)
{
if
(
!
in
->
name
)
continue
;
for
(
out
=
*
outs
;
out
&&
(
!
out
->
name
||
strcmp
(
in
->
name
,
out
->
name
));
out
=
out
->
next
);
if
(
!
out
)
continue
;
if
((
err
=
avfilter_link
(
in
->
filter_ctx
,
in
->
pad_idx
,
out
->
filter_ctx
,
out
->
pad_idx
))
<
0
)
job_failed
(
"Could not connect remaining filter pads named
\"
%s
\"
: %s"
,
in
->
name
,
av_err2str
(
err
));
out
->
name
=
0
;
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
err
,
i
,
progress
,
_progress
;
...
...
@@ -280,10 +299,10 @@ int main(int argc, char *argv[])
for
(
i
=
0
,
p
=
jenter
(
jlookup
(
output
,
"streams"
));
p
;
i
++
,
p
=
jnext
(
p
))
prepare_output_stream
(
p
,
avformat_new_stream
(
mux
,
0
),
encs
,
fg
,
sinks
,
&
outpads
);
/* TODO: Connect pads of same name before applying any filter strings */
for
(
p
=
jenter
(
jlookup
(
argv
[
4
],
"filters"
));
p
;
p
=
jnext
(
p
))
if
((
err
=
avfilter_graph_parse_ptr
(
fg
,
jstr
(
p
,
"ERROR"
),
&
outpads
,
&
inpads
,
0
))
<
0
)
job_failed
(
"Parsing filter string
\"
%s
\"
failed: %s"
,
jstr
(
p
,
0
),
av_err2str
(
err
));
connect_pads
(
&
inpads
,
&
outpads
);
if
(
avfilter_graph_config
(
fg
,
0
)
<
0
)
job_failed
(
"Error configuring filter graph: %s"
,
av_err2str
(
err
));
...
...
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