summaryrefslogtreecommitdiff
path: root/src/android/camera_device.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/android/camera_device.cpp')
-rw-r--r--src/android/camera_device.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 0600ebc8..9c9a5cfa 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1273,19 +1273,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
StreamConfiguration &cfg = config_->at(index);
- /*
- * Construct a software encoder for the MJPEG streams from the
- * chosen libcamera source stream.
- */
- Encoder *encoder = new EncoderLibJpeg();
- int ret = encoder->configure(cfg);
- if (ret) {
- LOG(HAL, Error) << "Failed to configure encoder";
- delete encoder;
- return ret;
- }
-
- streams_.emplace_back(formats::MJPEG, cfg.size, type, index, encoder);
+ streams_.emplace_back(formats::MJPEG, cfg.size, type, index);
jpegStream->priv = static_cast<void *>(&streams_.back());
}
@@ -1306,11 +1294,20 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
return -EINVAL;
}
+ /*
+ * Configure the HAL CameraStream instances using the associated
+ * StreamConfiguration and set the number of required buffers in
+ * the Android camera3_stream_t.
+ */
for (unsigned int i = 0; i < stream_list->num_streams; ++i) {
camera3_stream_t *stream = stream_list->streams[i];
CameraStream *cameraStream = static_cast<CameraStream *>(stream->priv);
StreamConfiguration &cfg = config_->at(cameraStream->index());
+ int ret = cameraStream->configure(cfg);
+ if (ret)
+ return ret;
+
/* Use the bufferCount confirmed by the validation process. */
stream->max_buffers = cfg.bufferCount;
}