Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
F
ffworker
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Video AG Infrastruktur
ffworker
Commits
22d0d3a1
Commit
22d0d3a1
authored
Nov 27, 2017
by
Julian Rother
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transcode: Connect remaining open filter pads based on pad names
parent
bf0b74d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
transcode.c
transcode.c
+20
-1
No files found.
transcode.c
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
));
...
...
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