mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-21 18:04:00 +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,24 +738,39 @@ gst_v4l2_buffer_pool_release_buffer (GstBufferPool * bpool, GstBuffer * buffer)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case V4L2_BUF_TYPE_VIDEO_OUTPUT:
|
case V4L2_BUF_TYPE_VIDEO_OUTPUT:
|
||||||
{
|
switch (obj->mode) {
|
||||||
GstMetaV4l2 *meta;
|
case GST_V4L2_IO_RW:
|
||||||
|
/* release back in the pool */
|
||||||
|
GST_BUFFER_POOL_CLASS (parent_class)->release_buffer (bpool, buffer);
|
||||||
|
break;
|
||||||
|
|
||||||
meta = GST_META_V4L2_GET (buffer);
|
case GST_V4L2_IO_MMAP:
|
||||||
g_assert (meta != NULL);
|
{
|
||||||
|
GstMetaV4l2 *meta;
|
||||||
|
|
||||||
if (pool->buffers[meta->vbuffer.index] == NULL) {
|
meta = GST_META_V4L2_GET (buffer);
|
||||||
GST_LOG_OBJECT (pool, "buffer not queued, putting on free list");
|
g_assert (meta != NULL);
|
||||||
/* playback, put the buffer back in the queue to refill later. */
|
|
||||||
GST_BUFFER_POOL_CLASS (parent_class)->release_buffer (bpool, buffer);
|
if (pool->buffers[meta->vbuffer.index] == NULL) {
|
||||||
} else {
|
GST_LOG_OBJECT (pool, "buffer not queued, putting on free list");
|
||||||
/* the buffer is queued in the device but maybe not played yet. We just
|
/* playback, put the buffer back in the queue to refill later. */
|
||||||
* leave it there and not make it available for future calls to acquire
|
GST_BUFFER_POOL_CLASS (parent_class)->release_buffer (bpool,
|
||||||
* for now. The buffer will be dequeued and reused later. */
|
buffer);
|
||||||
GST_LOG_OBJECT (pool, "buffer is queued");
|
} 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
|
||||||
|
* for now. The buffer will be dequeued and reused later. */
|
||||||
|
GST_LOG_OBJECT (pool, "buffer is queued");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case GST_V4L2_IO_USERPTR:
|
||||||
|
default:
|
||||||
|
g_assert_not_reached ();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
|
@ -955,6 +970,7 @@ gst_v4l2_buffer_pool_process (GstBufferPool * bpool, GstBuffer * buf)
|
||||||
switch (obj->mode) {
|
switch (obj->mode) {
|
||||||
case GST_V4L2_IO_RW:
|
case GST_V4L2_IO_RW:
|
||||||
/* FIXME, do write() */
|
/* FIXME, do write() */
|
||||||
|
GST_WARNING_OBJECT (pool, "implement write()");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GST_V4L2_IO_MMAP:
|
case GST_V4L2_IO_MMAP:
|
||||||
|
|
Loading…
Reference in a new issue