summaryrefslogtreecommitdiff
path: root/src/android/camera_device.cpp
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-10-03 13:45:29 +0200
committerJacopo Mondi <jacopo@jmondi.org>2020-10-07 16:07:45 +0200
commit6c8837da5e8f9ba31aed338f8f6bbe578ddd638a (patch)
tree8d880c1a76cf140e5ddb64ecf8ba47c37e152e28 /src/android/camera_device.cpp
parentfc1fcb5bc9c21cc497bb978b866885787587aa9f (diff)
android: camera_device: Make CameraStream configuration nicer
Loop over the CameraStream instances and use their interface to perform CameraStream configuration. Modify CameraStream::configure() to configure the android stream buffer count and to retrieve the StreamConfiguration by index instead of receiving it as a parameter. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/camera_device.cpp')
-rw-r--r--src/android/camera_device.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 678dca60..1e2cbeeb 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1287,17 +1287,12 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
* 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);
- const StreamConfiguration &cfg = cameraStream->configuration();
-
- int ret = cameraStream->configure(cfg);
- if (ret)
+ for (CameraStream &cameraStream : streams_) {
+ int ret = cameraStream.configure();
+ if (ret) {
+ LOG(HAL, Error) << "Failed to configure camera stream";
return ret;
-
- /* Use the bufferCount confirmed by the validation process. */
- stream->max_buffers = cfg.bufferCount;
+ }
}
/*