summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-07-23 18:32:23 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-07-24 19:03:52 +0200
commit142a9ee3f87726a8842a32bc132ca4a11d750a9e (patch)
tree9d2d3d53d1a9157dc11248418284fe5152688fd5
parent3530614fbf59b83f29bbd618742a6683c4fa244f (diff)
android: camera_device: Use HAL_PIXEL_FORMAT_* defines for formats
The documentation says the HAL_PIXEL_FORMAT_* defines shall be used for formats instead of ANDROID_SCALER_AVAILABLE_FORMATS_* for the ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS and ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS tags. This have worked in the past as the numerical value of the two sets are the same for the formats supported. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--src/android/camera_device.cpp8
-rw-r--r--src/android/camera_device.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 6e767358..96dd8d5a 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -317,14 +317,14 @@ int CameraDevice::initializeStreamConfigurations()
status != CameraConfiguration::Valid)
continue;
- streamConfigurations_.push_back({ res, camera3Format.scalerFormat });
+ streamConfigurations_.push_back({ res, androidFormat });
}
}
LOG(HAL, Debug) << "Collected stream configuration map: ";
for (const auto &entry : streamConfigurations_)
LOG(HAL, Debug) << "{ " << entry.resolution.toString() << " - "
- << utils::hex(entry.androidScalerCode) << " }";
+ << utils::hex(entry.androidFormat) << " }";
return 0;
}
@@ -658,7 +658,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
std::vector<uint32_t> availableStreamConfigurations;
availableStreamConfigurations.reserve(streamConfigurations_.size() * 4);
for (const auto &entry : streamConfigurations_) {
- availableStreamConfigurations.push_back(entry.androidScalerCode);
+ availableStreamConfigurations.push_back(entry.androidFormat);
availableStreamConfigurations.push_back(entry.resolution.width);
availableStreamConfigurations.push_back(entry.resolution.height);
availableStreamConfigurations.push_back(
@@ -679,7 +679,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
std::vector<int64_t> minFrameDurations;
minFrameDurations.reserve(streamConfigurations_.size() * 4);
for (const auto &entry : streamConfigurations_) {
- minFrameDurations.push_back(entry.androidScalerCode);
+ minFrameDurations.push_back(entry.androidFormat);
minFrameDurations.push_back(entry.resolution.width);
minFrameDurations.push_back(entry.resolution.height);
minFrameDurations.push_back(33333333);
diff --git a/src/android/camera_device.h b/src/android/camera_device.h
index 5b8b9c3e..00472c21 100644
--- a/src/android/camera_device.h
+++ b/src/android/camera_device.h
@@ -75,7 +75,7 @@ private:
struct Camera3StreamConfiguration {
libcamera::Size resolution;
- int androidScalerCode;
+ int androidFormat;
};
int initializeStreamConfigurations();