From f490a87fd339fc7443f5d8467ba56a35c750a5f7 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 8 Feb 2021 01:33:20 +0200 Subject: libcamera: camera_sensor: Accept entities exposing the ISP function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Camera sensors can include an ISP, which may be reported as a separate entity from the pixel array in the media graph. Support such sensors by accepting MEDIA_ENT_F_PROC_VIDEO_ISP as a valid entity type. This allows using sensors that can be fully (or at least meaningfully) configured through the ISP's source pad only. Sensors that require further configuration, on the ISP sink pad and/or on the pixel array's source pad, will require further extension to the CameraSensor class. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/libcamera/camera_sensor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/libcamera/camera_sensor.cpp') diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index 8db6e897..a0498297 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -198,7 +198,12 @@ int CameraSensor::init() return -EINVAL; } - if (entity_->function() != MEDIA_ENT_F_CAM_SENSOR) { + switch (entity_->function()) { + case MEDIA_ENT_F_CAM_SENSOR: + case MEDIA_ENT_F_PROC_VIDEO_ISP: + break; + + default: LOG(CameraSensor, Error) << "Invalid sensor function " << utils::hex(entity_->function()); -- cgit v1.2.1