summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
Diffstat (limited to 'src/android')
-rw-r--r--src/android/camera_request.cpp19
-rw-r--r--src/android/camera_request.h17
2 files changed, 30 insertions, 6 deletions
diff --git a/src/android/camera_request.cpp b/src/android/camera_request.cpp
index 5bac1b8f..8162aa78 100644
--- a/src/android/camera_request.cpp
+++ b/src/android/camera_request.cpp
@@ -37,9 +37,7 @@ Camera3RequestDescriptor::Camera3RequestDescriptor(
CameraStream *stream =
static_cast<CameraStream *>(buffer.stream->priv);
- buffers_.push_back({ stream, buffer.buffer, nullptr,
- buffer.acquire_fence, Status::Success,
- nullptr, nullptr, nullptr, this });
+ buffers_.emplace_back(stream, buffer, this);
}
/* Clone the controls associated with the camera3 request. */
@@ -54,3 +52,18 @@ Camera3RequestDescriptor::Camera3RequestDescriptor(
}
Camera3RequestDescriptor::~Camera3RequestDescriptor() = default;
+
+Camera3RequestDescriptor::StreamBuffer::StreamBuffer(
+ CameraStream *cameraStream, const camera3_stream_buffer_t &buffer,
+ Camera3RequestDescriptor *requestDescriptor)
+ : stream(cameraStream), camera3Buffer(buffer.buffer),
+ fence(buffer.acquire_fence), request(requestDescriptor)
+{
+}
+
+Camera3RequestDescriptor::StreamBuffer::~StreamBuffer() = default;
+
+Camera3RequestDescriptor::StreamBuffer::StreamBuffer(StreamBuffer &&) = default;
+
+Camera3RequestDescriptor::StreamBuffer &
+Camera3RequestDescriptor::StreamBuffer::operator=(Camera3RequestDescriptor::StreamBuffer &&) = default;
diff --git a/src/android/camera_request.h b/src/android/camera_request.h
index cfafa445..8d1204e5 100644
--- a/src/android/camera_request.h
+++ b/src/android/camera_request.h
@@ -34,15 +34,26 @@ public:
};
struct StreamBuffer {
+ StreamBuffer(CameraStream *stream,
+ const camera3_stream_buffer_t &buffer,
+ Camera3RequestDescriptor *request);
+ ~StreamBuffer();
+
+ StreamBuffer(StreamBuffer &&);
+ StreamBuffer &operator=(StreamBuffer &&);
+
CameraStream *stream;
buffer_handle_t *camera3Buffer;
std::unique_ptr<libcamera::FrameBuffer> frameBuffer;
int fence;
- Status status;
- libcamera::FrameBuffer *internalBuffer;
- const libcamera::FrameBuffer *srcBuffer;
+ Status status = Status::Success;
+ libcamera::FrameBuffer *internalBuffer = nullptr;
+ const libcamera::FrameBuffer *srcBuffer = nullptr;
std::unique_ptr<CameraBuffer> dstBuffer;
Camera3RequestDescriptor *request;
+
+ private:
+ LIBCAMERA_DISABLE_COPY(StreamBuffer)
};
/* Keeps track of streams requiring post-processing. */