Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
fac834b2
Commit
fac834b2
authored
Aug 24, 2019
by
Aman Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/v4l2_context: expose timeout for dequeue_frame
Signed-off-by:
Aman Gupta
<
aman@tmm1.net
>
parent
3475758a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
v4l2_context.c
libavcodec/v4l2_context.c
+3
-3
v4l2_context.h
libavcodec/v4l2_context.h
+2
-1
v4l2_m2m_dec.c
libavcodec/v4l2_m2m_dec.c
+1
-1
No files found.
libavcodec/v4l2_context.c
View file @
fac834b2
...
...
@@ -582,16 +582,16 @@ int ff_v4l2_context_enqueue_packet(V4L2Context* ctx, const AVPacket* pkt)
return
ff_v4l2_buffer_enqueue
(
avbuf
);
}
int
ff_v4l2_context_dequeue_frame
(
V4L2Context
*
ctx
,
AVFrame
*
frame
)
int
ff_v4l2_context_dequeue_frame
(
V4L2Context
*
ctx
,
AVFrame
*
frame
,
int
timeout
)
{
V4L2Buffer
*
avbuf
=
NULL
;
/*
* blocks until:
*
timeout=-1
blocks until:
* 1. decoded frame available
* 2. an input buffer is ready to be dequeued
*/
avbuf
=
v4l2_dequeue_v4l2buf
(
ctx
,
-
1
);
avbuf
=
v4l2_dequeue_v4l2buf
(
ctx
,
timeout
);
if
(
!
avbuf
)
{
if
(
ctx
->
done
)
return
AVERROR_EOF
;
...
...
libavcodec/v4l2_context.h
View file @
fac834b2
...
...
@@ -154,9 +154,10 @@ int ff_v4l2_context_dequeue_packet(V4L2Context* ctx, AVPacket* pkt);
* The frame must be non NULL.
* @param[in] ctx The V4L2Context to dequeue from.
* @param[inout] f The AVFrame to dequeue to.
* @param[in] timeout The timeout for dequeue (-1 to block, 0 to return immediately, or milliseconds)
* @return 0 in case of success, AVERROR(EAGAIN) if no buffer was ready, another negative error in case of error.
*/
int
ff_v4l2_context_dequeue_frame
(
V4L2Context
*
ctx
,
AVFrame
*
f
);
int
ff_v4l2_context_dequeue_frame
(
V4L2Context
*
ctx
,
AVFrame
*
f
,
int
timeout
);
/**
* Enqueues a buffer to a V4L2Context from an AVPacket
...
...
libavcodec/v4l2_m2m_dec.c
View file @
fac834b2
...
...
@@ -162,7 +162,7 @@ static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame)
dequeue:
av_packet_unref
(
&
avpkt
);
return
ff_v4l2_context_dequeue_frame
(
capture
,
frame
);
return
ff_v4l2_context_dequeue_frame
(
capture
,
frame
,
-
1
);
}
static
av_cold
int
v4l2_decode_init
(
AVCodecContext
*
avctx
)
...
...
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