android: capabilities: Use per-configuration durations

Use the per-configuration stream durations as collected during
initializeStreamConfigurations() to populate the
ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT static metadata.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Jacopo Mondi 2021-06-29 17:34:10 +02:00
parent e3d7206fb5
commit 02f4786915

View file

@ -1291,19 +1291,16 @@ int CameraCapabilities::initializeStaticMetadata()
staticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_STALL_DURATIONS, staticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_STALL_DURATIONS,
availableStallDurations); availableStallDurations);
/* Use the minimum frame duration for all the YUV/RGB formats. */ std::vector<int64_t> minFrameDurations;
if (minFrameDurationNsec > 0) { minFrameDurations.reserve(streamConfigurations_.size() * 4);
std::vector<int64_t> minFrameDurations; for (const auto &entry : streamConfigurations_) {
minFrameDurations.reserve(streamConfigurations_.size() * 4); minFrameDurations.push_back(entry.androidFormat);
for (const auto &entry : streamConfigurations_) { minFrameDurations.push_back(entry.resolution.width);
minFrameDurations.push_back(entry.androidFormat); minFrameDurations.push_back(entry.resolution.height);
minFrameDurations.push_back(entry.resolution.width); minFrameDurations.push_back(entry.minFrameDurationNsec);
minFrameDurations.push_back(entry.resolution.height);
minFrameDurations.push_back(minFrameDurationNsec);
}
staticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,
minFrameDurations);
} }
staticMetadata_->addEntry(ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,
minFrameDurations);
uint8_t croppingType = ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY; uint8_t croppingType = ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY;
staticMetadata_->addEntry(ANDROID_SCALER_CROPPING_TYPE, croppingType); staticMetadata_->addEntry(ANDROID_SCALER_CROPPING_TYPE, croppingType);