summaryrefslogtreecommitdiff
path: root/src/android/camera_device.cpp
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-09-04 16:06:11 +0200
committerJacopo Mondi <jacopo@jmondi.org>2020-10-07 16:07:44 +0200
commit94c4d49ebe41a58657d402df5f57556da96b5023 (patch)
tree0255f69d5179b03f82158008f163c8fcb752373a /src/android/camera_device.cpp
parent5cf64b26a24d1430eed9523ca5899bdd3faf203b (diff)
android: camera_stream: Add CameraStream::Type
Define the CameraStream::Type enumeration and assign it to each CameraStream instance at construction time. The CameraStream type will be used to decide if memory needs to be allocated on its behalf or if the stream is backed by memory externally allocated by the Android framework. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/camera_device.cpp')
-rw-r--r--src/android/camera_device.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index bbc692fe..0600ebc8 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1216,12 +1216,14 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
config_->addConfiguration(streamConfiguration);
unsigned int index = config_->size() - 1;
- streams_.emplace_back(format, size, index);
+ streams_.emplace_back(format, size, CameraStream::Type::Direct,
+ index);
stream->priv = static_cast<void *>(&streams_.back());
}
/* Now handle the MJPEG streams, adding a new stream if required. */
if (jpegStream) {
+ CameraStream::Type type;
int index = -1;
/* Search for a compatible stream in the non-JPEG ones. */
@@ -1239,6 +1241,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
LOG(HAL, Info)
<< "Android JPEG stream mapped to libcamera stream " << i;
+ type = CameraStream::Type::Mapped;
index = i;
break;
}
@@ -1263,6 +1266,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
LOG(HAL, Info) << "Adding " << streamConfiguration.toString()
<< " for MJPEG support";
+ type = CameraStream::Type::Internal;
config_->addConfiguration(streamConfiguration);
index = config_->size() - 1;
}
@@ -1281,7 +1285,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
return ret;
}
- streams_.emplace_back(formats::MJPEG, cfg.size, index, encoder);
+ streams_.emplace_back(formats::MJPEG, cfg.size, type, index, encoder);
jpegStream->priv = static_cast<void *>(&streams_.back());
}