@@ -164,6 +164,10 @@ namespace {
*/
static constexpr unsigned int kRkISP1MaxQueuedRequests = 4;
+/*
+ * This many internal buffers (or rather parameter and statistics buffer
+ * pairs) ensures that the pipeline runs smoothly, without frame drops.
+ */
static constexpr unsigned int kRkISP1MinBufferCount = 4;
} // namespace
@@ -1004,24 +1008,19 @@ int PipelineHandlerRkISP1::allocateBuffers(Camera *camera)
unsigned int ipaBufferId = 1;
int ret;
- unsigned int maxCount = std::max({
- data->mainPathStream_.configuration().bufferCount,
- data->selfPathStream_.configuration().bufferCount,
- });
-
if (!isRaw_) {
- ret = param_->allocateBuffers(maxCount, ¶mBuffers_);
+ ret = param_->allocateBuffers(kRkISP1MinBufferCount, ¶mBuffers_);
if (ret < 0)
goto error;
- ret = stat_->allocateBuffers(maxCount, &statBuffers_);
+ ret = stat_->allocateBuffers(kRkISP1MinBufferCount, &statBuffers_);
if (ret < 0)
goto error;
}
/* If the dewarper is being used, allocate internal buffers for ISP. */
if (useDewarper_) {
- ret = mainPath_.exportBuffers(maxCount, &mainPathBuffers_);
+ ret = mainPath_.exportBuffers(kRkISP1MinBufferCount, &mainPathBuffers_);
if (ret < 0)
goto error;