gstfdmemory: log with GST_INFO instead of GST_ERROR on permission denied

For example mmap can fail with EACCES if the the fd has been open
with read only mode. And mapping the memory might be the only way
to check that. So no need to print out an error.

Ex: ioctl(dev, DRM_IOCTL_PRIME_HANDLE_TO_FD, flags & ~DRM_RDWR)

https://bugzilla.gnome.org/show_bug.cgi?id=765600
This commit is contained in:
Julien Isorce 2016-10-07 15:08:37 +01:00
parent 7e14875458
commit b68d9bbe43

View file

@ -110,9 +110,20 @@ gst_fd_mem_map (GstMemory * gmem, gsize maxsize, GstMapFlags flags)
mem->data = mmap (0, gmem->maxsize, prot, flags, mem->fd, 0);
if (mem->data == MAP_FAILED) {
GstDebugLevel level;
mem->data = NULL;
GST_ERROR ("%p: fd %d: mmap failed: %s", mem, mem->fd,
g_strerror (errno));
switch (errno) {
case EACCES:
level = GST_LEVEL_INFO;
break;
default:
level = GST_LEVEL_ERROR;
break;
}
GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, level, NULL,
"%p: fd %d: mmap failed: %s", mem, mem->fd, g_strerror (errno));
goto out;
}
}