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
beeba916
Commit
beeba916
authored
12 years ago
by
Nicolas George
Browse files
Options
Downloads
Patches
Plain Diff
lavfi: add a closed field to AVFilerLink.
It will help forward errors and maintain consistency.
parent
ac07f941
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
libavfilter/audio.c
+5
-0
5 additions, 0 deletions
libavfilter/audio.c
libavfilter/avfilter.c
+9
-0
9 additions, 0 deletions
libavfilter/avfilter.c
libavfilter/avfilter.h
+17
-0
17 additions, 0 deletions
libavfilter/avfilter.h
libavfilter/video.c
+5
-0
5 additions, 0 deletions
libavfilter/video.c
with
36 additions
and
0 deletions
libavfilter/audio.c
+
5
−
0
View file @
beeba916
...
...
@@ -172,6 +172,11 @@ int ff_filter_samples_framed(AVFilterLink *link, AVFilterBufferRef *samplesref)
FF_TPRINTF_START
(
NULL
,
filter_samples
);
ff_tlog_link
(
NULL
,
link
,
1
);
if
(
link
->
closed
)
{
avfilter_unref_buffer
(
samplesref
);
return
AVERROR_EOF
;
}
if
(
!
(
filter_samples
=
dst
->
filter_samples
))
filter_samples
=
default_filter_samples
;
...
...
This diff is collapsed.
Click to expand it.
libavfilter/avfilter.c
+
9
−
0
View file @
beeba916
...
...
@@ -159,6 +159,11 @@ void avfilter_link_free(AVFilterLink **link)
av_freep
(
link
);
}
void
avfilter_link_set_closed
(
AVFilterLink
*
link
,
int
closed
)
{
link
->
closed
=
closed
;
}
int
avfilter_insert_filter
(
AVFilterLink
*
link
,
AVFilterContext
*
filt
,
unsigned
filt_srcpad_idx
,
unsigned
filt_dstpad_idx
)
{
...
...
@@ -325,6 +330,8 @@ int ff_request_frame(AVFilterLink *link)
int
ret
=
-
1
;
FF_TPRINTF_START
(
NULL
,
request_frame
);
ff_tlog_link
(
NULL
,
link
,
1
);
if
(
link
->
closed
)
return
AVERROR_EOF
;
if
(
link
->
srcpad
->
request_frame
)
ret
=
link
->
srcpad
->
request_frame
(
link
);
else
if
(
link
->
src
->
inputs
[
0
])
...
...
@@ -335,6 +342,8 @@ int ff_request_frame(AVFilterLink *link)
ff_filter_samples_framed
(
link
,
pbuf
);
return
0
;
}
if
(
ret
==
AVERROR_EOF
)
link
->
closed
=
1
;
return
ret
;
}
...
...
This diff is collapsed.
Click to expand it.
libavfilter/avfilter.h
+
17
−
0
View file @
beeba916
...
...
@@ -697,6 +697,18 @@ struct AVFilterLink {
* by the filters.
*/
AVFilterBufferRef
*
cur_buf_copy
;
/**
* True if the link is closed.
* If set, all attemps of start_frame, filter_samples or request_frame
* will fail with AVERROR_EOF, and if necessary the reference will be
* destroyed.
* If request_frame returns AVERROR_EOF, this flag is set on the
* corresponding link.
* It can be set also be set by either the source or the destination
* filter.
*/
int
closed
;
};
/**
...
...
@@ -716,6 +728,11 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
*/
void
avfilter_link_free
(
AVFilterLink
**
link
);
/**
* Set the closed field of a link.
*/
void
avfilter_link_set_closed
(
AVFilterLink
*
link
,
int
closed
);
/**
* Negotiate the media format, dimensions, etc of all inputs to a filter.
*
...
...
This diff is collapsed.
Click to expand it.
libavfilter/video.c
+
5
−
0
View file @
beeba916
...
...
@@ -248,6 +248,11 @@ int ff_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
FF_TPRINTF_START
(
NULL
,
start_frame
);
ff_tlog_link
(
NULL
,
link
,
0
);
ff_tlog
(
NULL
,
" "
);
ff_tlog_ref
(
NULL
,
picref
,
1
);
if
(
link
->
closed
)
{
avfilter_unref_buffer
(
picref
);
return
AVERROR_EOF
;
}
if
(
!
(
start_frame
=
dst
->
start_frame
))
start_frame
=
default_start_frame
;
...
...
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