Android & Libcamera issue
jan at radicalsystems.co.za
jan at radicalsystems.co.za
Wed Jun 12 17:55:49 CEST 2024
Hi Libcamera Guru
Please help with Android interfacing to libcamera
W.r.t. src/android/mm/generic_camera_buffer.cpp
And function
CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer,
buffer_handle_t
camera3Buffer,
PixelFormat
pixelFormat,
const Size &size, int
flags)
I get an error: "Discontiguous planes are not supported"
The working code looks like this, which seems to short cut things or hack it
to work:
https://github.com/raspberry-vanilla/android_external_libcamera/blob/android
-14.0/src/android/mm/generic_camera_buffer.cpp
/*
* As Android doesn't offer an API to query buffer layouts, assume for
* now that the buffer is backed by a single dmabuf, with planes being
* stored contiguously.
*/
for (int i = 0; i < camera3Buffer->numFds; i++) {
if (camera3Buffer->data[i] == -1 || camera3Buffer->data[i]
== fd_)
continue;
fd_ = camera3Buffer->data[0];
}
And I updated it to be more recent:
https://github.com/libcamera-org/libcamera/blob/master/src/android/mm/generi
c_camera_buffer.cpp
/*
* As Android doesn't offer an API to query buffer layouts, assume for
* now that the buffer is backed by a single dmabuf, with planes being
* stored contiguously.
*/
for (int i = 0; i < camera3Buffer->numFds; i++) {
if (camera3Buffer->data[i] == -1 || camera3Buffer->data[i]
== fd_)
continue;
if (fd_ != -1) {
error_ = -EINVAL;
LOG(HAL, Error) << "Discontiguous planes are
not supported";
return;
}
fd_ = camera3Buffer->data[i];
}
I'm trying to resolve my issue to taking a picture while streaming.
Can someone please shed some light on what the issue can be?
Will really appreciate it.
Regards,
Jan Zwiegers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20240612/aa2af0cf/attachment.htm>
More information about the libcamera-devel
mailing list