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
2d6522ba
Commit
2d6522ba
authored
Apr 19, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vsrc_buffer: count the number of failed requests.
parent
f75ee403
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
vsrc_buffer.c
libavfilter/vsrc_buffer.c
+9
-0
vsrc_buffer.h
libavfilter/vsrc_buffer.h
+9
-0
No files found.
libavfilter/vsrc_buffer.c
View file @
2d6522ba
...
@@ -40,6 +40,7 @@ typedef struct {
...
@@ -40,6 +40,7 @@ typedef struct {
AVRational
sample_aspect_ratio
;
AVRational
sample_aspect_ratio
;
char
sws_param
[
256
];
char
sws_param
[
256
];
int
eof
;
int
eof
;
unsigned
nb_failed_requests
;
}
BufferSourceContext
;
}
BufferSourceContext
;
#define CHECK_PARAM_CHANGE(s, c, width, height, format)\
#define CHECK_PARAM_CHANGE(s, c, width, height, format)\
...
@@ -123,6 +124,7 @@ int av_vsrc_buffer_add_video_buffer_ref(AVFilterContext *buffer_filter,
...
@@ -123,6 +124,7 @@ int av_vsrc_buffer_add_video_buffer_ref(AVFilterContext *buffer_filter,
avfilter_unref_buffer
(
buf
);
avfilter_unref_buffer
(
buf
);
return
ret
;
return
ret
;
}
}
c
->
nb_failed_requests
=
0
;
return
0
;
return
0
;
}
}
...
@@ -147,6 +149,7 @@ int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf)
...
@@ -147,6 +149,7 @@ int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf)
if
((
ret
=
av_fifo_generic_write
(
c
->
fifo
,
&
buf
,
sizeof
(
buf
),
NULL
))
<
0
)
if
((
ret
=
av_fifo_generic_write
(
c
->
fifo
,
&
buf
,
sizeof
(
buf
),
NULL
))
<
0
)
return
ret
;
return
ret
;
c
->
nb_failed_requests
=
0
;
return
0
;
return
0
;
}
}
...
@@ -178,6 +181,11 @@ int av_vsrc_buffer_add_frame(AVFilterContext *buffer_src,
...
@@ -178,6 +181,11 @@ int av_vsrc_buffer_add_frame(AVFilterContext *buffer_src,
}
}
#endif
#endif
unsigned
av_vsrc_buffer_get_nb_failed_requests
(
AVFilterContext
*
buffer_src
)
{
return
((
BufferSourceContext
*
)
buffer_src
->
priv
)
->
nb_failed_requests
;
}
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
,
void
*
opaque
)
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
,
void
*
opaque
)
{
{
BufferSourceContext
*
c
=
ctx
->
priv
;
BufferSourceContext
*
c
=
ctx
->
priv
;
...
@@ -249,6 +257,7 @@ static int request_frame(AVFilterLink *link)
...
@@ -249,6 +257,7 @@ static int request_frame(AVFilterLink *link)
if
(
!
av_fifo_size
(
c
->
fifo
))
{
if
(
!
av_fifo_size
(
c
->
fifo
))
{
if
(
c
->
eof
)
if
(
c
->
eof
)
return
AVERROR_EOF
;
return
AVERROR_EOF
;
c
->
nb_failed_requests
++
;
return
AVERROR
(
EAGAIN
);
return
AVERROR
(
EAGAIN
);
}
}
av_fifo_generic_read
(
c
->
fifo
,
&
buf
,
sizeof
(
buf
),
NULL
);
av_fifo_generic_read
(
c
->
fifo
,
&
buf
,
sizeof
(
buf
),
NULL
);
...
...
libavfilter/vsrc_buffer.h
View file @
2d6522ba
...
@@ -46,4 +46,13 @@
...
@@ -46,4 +46,13 @@
int
av_vsrc_buffer_add_video_buffer_ref
(
AVFilterContext
*
buffer_src
,
int
av_vsrc_buffer_add_video_buffer_ref
(
AVFilterContext
*
buffer_src
,
AVFilterBufferRef
*
picref
,
int
flags
);
AVFilterBufferRef
*
picref
,
int
flags
);
/**
* Get the number of failed requests.
*
* A failed request is when the request_frame method is called while no
* frame is present in the buffer.
* The number is reset when a frame is added.
*/
unsigned
av_vsrc_buffer_get_nb_failed_requests
(
AVFilterContext
*
buffer_src
);
#endif
/* AVFILTER_VSRC_BUFFER_H */
#endif
/* AVFILTER_VSRC_BUFFER_H */
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