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.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 8e804d4d..773cb3b6 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -681,10 +681,23 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
for (const auto &streamConfig : streamConfigs) {
config->addConfiguration(streamConfig.config);
+ CameraStream *sourceStream = nullptr;
for (auto &stream : streamConfig.streams) {
streams_.emplace_back(this, config.get(), stream.type,
- stream.stream, config->size() - 1);
+ stream.stream, sourceStream,
+ config->size() - 1);
stream.stream->priv = static_cast<void *>(&streams_.back());
+
+ /*
+ * The streamConfig.streams vector contains as its first
+ * element a Direct (or Internal) stream, and then an
+ * optional set of Mapped streams derived from the
+ * Direct stream. Cache the Direct stream pointer, to
+ * be used when constructing the subsequent mapped
+ * streams.
+ */
+ if (stream.type == CameraStream::Type::Direct)
+ sourceStream = &streams_.back();
}
}