mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-15 00:19:44 +03:00
android: camera_device: Get rid of stream counter
Use the size() method of the CameraConfiguration class to retrieve the index of the StreamConfiguration associated with a CameraStream and get rid of the custom counter. Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
4961033ac9
commit
5b64f64745
1 changed files with 2 additions and 9 deletions
|
@ -1190,12 +1190,6 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
|
||||||
streams_.clear();
|
streams_.clear();
|
||||||
streams_.reserve(stream_list->num_streams);
|
streams_.reserve(stream_list->num_streams);
|
||||||
|
|
||||||
/*
|
|
||||||
* Track actually created streams, as there may not be a 1:1 mapping of
|
|
||||||
* camera3 streams to libcamera streams.
|
|
||||||
*/
|
|
||||||
unsigned int streamIndex = 0;
|
|
||||||
|
|
||||||
/* First handle all non-MJPEG streams. */
|
/* First handle all non-MJPEG streams. */
|
||||||
for (unsigned int i = 0; i < stream_list->num_streams; ++i) {
|
for (unsigned int i = 0; i < stream_list->num_streams; ++i) {
|
||||||
camera3_stream_t *stream = stream_list->streams[i];
|
camera3_stream_t *stream = stream_list->streams[i];
|
||||||
|
@ -1226,8 +1220,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
|
||||||
streamConfiguration.pixelFormat = format;
|
streamConfiguration.pixelFormat = format;
|
||||||
|
|
||||||
config_->addConfiguration(streamConfiguration);
|
config_->addConfiguration(streamConfiguration);
|
||||||
|
streams_[i].index = config_->size() - 1;
|
||||||
streams_[i].index = streamIndex++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now handle MJPEG streams, adding a new stream if required. */
|
/* Now handle MJPEG streams, adding a new stream if required. */
|
||||||
|
@ -1276,7 +1269,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
|
||||||
<< " for MJPEG support";
|
<< " for MJPEG support";
|
||||||
|
|
||||||
config_->addConfiguration(streamConfiguration);
|
config_->addConfiguration(streamConfiguration);
|
||||||
streams_[i].index = streamIndex++;
|
streams_[i].index = config_->size() - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue