summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-02-08 01:33:20 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-03-03 22:52:04 +0200
commitf490a87fd339fc7443f5d8467ba56a35c750a5f7 (patch)
treea78795af63828e38f7844bbafa7479c2359e096f
parent96aecfe36508f3c2a2b1be621b3fbe4f72ef1fe6 (diff)
libcamera: camera_sensor: Accept entities exposing the ISP function
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
-rw-r--r--src/libcamera/camera_sensor.cpp7
1 files changed, 6 insertions, 1 deletions
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());