mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-31 20:48:56 +00:00
v4l2codecs: Do not register stateless decoder if the driver doesn't support VIDIOC_CREATE_BUFS
If the driver can't allocate buffers with VIDIOC_CREATE_BUFS do not register it has stateless decoder. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7684>
This commit is contained in:
parent
2753a8f0c1
commit
fecdfe18ca
1 changed files with 14 additions and 0 deletions
|
@ -167,6 +167,11 @@ gst_v4l2_decoder_open (GstV4l2Decoder * self)
|
|||
{
|
||||
gint ret;
|
||||
struct v4l2_capability querycap;
|
||||
struct v4l2_create_buffers createbufs = {
|
||||
.count = 0,
|
||||
.memory = V4L2_MEMORY_MMAP,
|
||||
};
|
||||
|
||||
guint32 capabilities;
|
||||
|
||||
self->media_fd = open (self->media_device, 0);
|
||||
|
@ -211,6 +216,15 @@ gst_v4l2_decoder_open (GstV4l2Decoder * self)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
createbufs.format.type = self->sink_buf_type;
|
||||
ret = ioctl (self->video_fd, VIDIOC_CREATE_BUFS, &createbufs);
|
||||
if (ret < 0) {
|
||||
GST_ERROR_OBJECT (self,
|
||||
"GStreamer requires VIDIOC_CREATE_BUFS to be supported by stateless decoders.");
|
||||
gst_v4l2_decoder_close (self);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
self->opened = TRUE;
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue