Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gst-plugins-good
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
George Kiagiadakis
gst-plugins-good
Commits
cb311d57
Commit
cb311d57
authored
Apr 29, 2014
by
Nicolas Dufresne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v4l2bufferpool: Re-enqueue buffer at stream start
parent
a946a7cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
sys/v4l2/gstv4l2bufferpool.c
sys/v4l2/gstv4l2bufferpool.c
+29
-0
No files found.
sys/v4l2/gstv4l2bufferpool.c
View file @
cb311d57
...
...
@@ -602,10 +602,34 @@ start_streaming (GstV4l2BufferPool * pool)
case
GST_V4L2_IO_USERPTR
:
case
GST_V4L2_IO_DMABUF
:
case
GST_V4L2_IO_DMABUF_IMPORT
:
{
/* For capture device, we need to re-enqueue buffers before be can let
* the driver stream again */
if
(
!
V4L2_TYPE_IS_OUTPUT
(
obj
->
type
))
{
GstBufferPool
*
bpool
=
GST_BUFFER_POOL
(
pool
);
GstBufferPoolAcquireParams
params
=
{
0
};
GstFlowReturn
ret
;
while
(
pool
->
num_queued
<
pool
->
num_allocated
)
{
GstBuffer
*
buf
;
params
.
flags
=
GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT
;
ret
=
GST_BUFFER_POOL_CLASS
(
parent_class
)
->
acquire_buffer
(
bpool
,
&
buf
,
&
params
);
if
(
ret
!=
GST_FLOW_OK
)
goto
requeue_failed
;
gst_v4l2_buffer_pool_release_buffer
(
bpool
,
buf
);
}
}
GST_DEBUG_OBJECT
(
pool
,
"STREAMON"
);
if
(
v4l2_ioctl
(
pool
->
video_fd
,
VIDIOC_STREAMON
,
&
obj
->
type
)
<
0
)
goto
start_failed
;
break
;
}
default:
g_assert_not_reached
();
break
;
...
...
@@ -622,6 +646,11 @@ start_failed:
g_strerror
(
errno
));
return
FALSE
;
}
requeue_failed:
{
GST_ERROR_OBJECT
(
pool
,
"failed to re-enqueue buffers"
);
return
FALSE
;
}
}
static
void
...
...
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