libcamera: support transform
to orientation
rename
This commit is contained in:
@ -99,6 +99,15 @@ int libcamera_buffer_list_open(buffer_list_t *buf_list)
|
||||
if (configurations->validate() == libcamera::CameraConfiguration::Invalid) {
|
||||
LOG_ERROR(buf_list, "Camera configuration invalid");
|
||||
}
|
||||
#ifdef LIBCAMERA_USES_ORIENTATION
|
||||
if (buf_list->dev->libcamera->vflip && buf_list->dev->libcamera->hflip) {
|
||||
configurations->orientation = libcamera::Orientation::Rotate180;
|
||||
} else if (buf_list->dev->libcamera->vflip) {
|
||||
configurations->orientation = libcamera::Orientation::Rotate180Mirror;
|
||||
} else if (buf_list->dev->libcamera->hflip) {
|
||||
configurations->orientation = libcamera::Orientation::Rotate0Mirror;
|
||||
}
|
||||
#else // LIBCAMERA_USES_ORIENTATION
|
||||
if (buf_list->dev->libcamera->vflip) {
|
||||
configurations->transform |= libcamera::Transform::VFlip;
|
||||
}
|
||||
@ -108,6 +117,7 @@ int libcamera_buffer_list_open(buffer_list_t *buf_list)
|
||||
if (!!(configurations->transform & libcamera::Transform::Transpose)) {
|
||||
LOG_ERROR(buf_list, "Transformation requiring transpose not supported");
|
||||
}
|
||||
#endif // LIBCAMERA_USES_ORIENTATION
|
||||
|
||||
if (buf_list->dev->libcamera->camera->configure(configurations.get()) < 0) {
|
||||
LOG_ERROR(buf_list, "Failed to configure camera");
|
||||
|
@ -7,6 +7,7 @@ extern "C" {
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "version.h"
|
||||
#include "device/device.h"
|
||||
#include "device/buffer_list.h"
|
||||
#include "device/buffer.h"
|
||||
@ -29,7 +30,11 @@ extern "C" {
|
||||
#include <libcamera/request.h>
|
||||
#include <libcamera/stream.h>
|
||||
#include <libcamera/formats.h>
|
||||
#ifdef LIBCAMERA_USES_ORIENTATION
|
||||
#include <libcamera/orientation.h>
|
||||
#else // LIBCAMERA_USES_ORIENTATION
|
||||
#include <libcamera/transform.h>
|
||||
#endif // LIBCAMERA_USES_ORIENTATION
|
||||
|
||||
typedef struct buffer_s buffer_t;
|
||||
typedef struct buffer_list_s buffer_list_t;
|
||||
|
Reference in New Issue
Block a user