mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
v4l2: implement more bits of RW I/O mode
Implement the relaese of RW buffers in the pool. Warn for unsupported write() mode for sinks.
This commit is contained in:
parent
be32a6393e
commit
b2e1532021
1 changed files with 30 additions and 14 deletions
|
@ -738,6 +738,13 @@ gst_v4l2_buffer_pool_release_buffer (GstBufferPool * bpool, GstBuffer * buffer)
|
|||
break;
|
||||
|
||||
case V4L2_BUF_TYPE_VIDEO_OUTPUT:
|
||||
switch (obj->mode) {
|
||||
case GST_V4L2_IO_RW:
|
||||
/* release back in the pool */
|
||||
GST_BUFFER_POOL_CLASS (parent_class)->release_buffer (bpool, buffer);
|
||||
break;
|
||||
|
||||
case GST_V4L2_IO_MMAP:
|
||||
{
|
||||
GstMetaV4l2 *meta;
|
||||
|
||||
|
@ -747,7 +754,8 @@ gst_v4l2_buffer_pool_release_buffer (GstBufferPool * bpool, GstBuffer * buffer)
|
|||
if (pool->buffers[meta->vbuffer.index] == NULL) {
|
||||
GST_LOG_OBJECT (pool, "buffer not queued, putting on free list");
|
||||
/* playback, put the buffer back in the queue to refill later. */
|
||||
GST_BUFFER_POOL_CLASS (parent_class)->release_buffer (bpool, buffer);
|
||||
GST_BUFFER_POOL_CLASS (parent_class)->release_buffer (bpool,
|
||||
buffer);
|
||||
} else {
|
||||
/* the buffer is queued in the device but maybe not played yet. We just
|
||||
* leave it there and not make it available for future calls to acquire
|
||||
|
@ -757,6 +765,13 @@ gst_v4l2_buffer_pool_release_buffer (GstBufferPool * bpool, GstBuffer * buffer)
|
|||
break;
|
||||
}
|
||||
|
||||
case GST_V4L2_IO_USERPTR:
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
|
@ -955,6 +970,7 @@ gst_v4l2_buffer_pool_process (GstBufferPool * bpool, GstBuffer * buf)
|
|||
switch (obj->mode) {
|
||||
case GST_V4L2_IO_RW:
|
||||
/* FIXME, do write() */
|
||||
GST_WARNING_OBJECT (pool, "implement write()");
|
||||
break;
|
||||
|
||||
case GST_V4L2_IO_MMAP:
|
||||
|
|
Loading…
Reference in a new issue