summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-05-22 04:02:06 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-06-18 13:26:58 +0300
commit8b7e073e6eab6d62e6d8e8e0b4e120e2e016da3d (patch)
tree08ad0c8d87c1efe374ada44f66a7f84584b090c6 /src/android
parent56c99424edd64c5a2bfe255eabc9e00787fc75a0 (diff)
libcamera: Replace explicit DRM FourCCs with libcamera formats
Use the new pixel format constants to replace usage of macros from drm_fourcc.h. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/android')
-rw-r--r--src/android/camera_device.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index c56e2355..f788c11e 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -12,6 +12,7 @@
#include <vector>
#include <libcamera/controls.h>
+#include <libcamera/formats.h>
#include <libcamera/property_ids.h>
#include "libcamera/internal/log.h"
@@ -58,13 +59,13 @@ struct Camera3Format {
const std::map<int, const Camera3Format> camera3FormatsMap = {
{
HAL_PIXEL_FORMAT_BLOB, {
- { PixelFormat(DRM_FORMAT_MJPEG) },
+ { formats::MJPEG },
ANDROID_SCALER_AVAILABLE_FORMATS_BLOB,
"BLOB"
}
}, {
HAL_PIXEL_FORMAT_YCbCr_420_888, {
- { PixelFormat(DRM_FORMAT_NV12), PixelFormat(DRM_FORMAT_NV21) },
+ { formats::NV12, formats::NV21 },
ANDROID_SCALER_AVAILABLE_FORMATS_YCbCr_420_888,
"YCbCr_420_888"
}
@@ -74,7 +75,7 @@ const std::map<int, const Camera3Format> camera3FormatsMap = {
* usage flag. For now, copy the YCbCr_420 configuration.
*/
HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, {
- { PixelFormat(DRM_FORMAT_NV12), PixelFormat(DRM_FORMAT_NV21) },
+ { formats::NV12, formats::NV21 },
ANDROID_SCALER_AVAILABLE_FORMATS_IMPLEMENTATION_DEFINED,
"IMPLEMENTATION_DEFINED"
}
@@ -264,7 +265,7 @@ int CameraDevice::initializeStreamConfigurations()
for (const PixelFormat &pixelFormat : libcameraFormats) {
/* \todo Fixed mapping for JPEG. */
if (androidFormat == HAL_PIXEL_FORMAT_BLOB) {
- mappedFormat = PixelFormat(DRM_FORMAT_MJPEG);
+ mappedFormat = formats::MJPEG;
break;
}