android: camera_device: Return unique_ptr from createFrameBuffer
Returning a non-managed pointer can cause leaks. Use a unique_ptr<> instead to avoid possible future issues. The std::move() for the planes argument to the FrameBuffer constructor is dropped as it's misleading. FrameBuffer has no constructor that takes an rvalue reference to planes, so the vector was copied despite the move. This only clarifies the intent, no functional change is introduced. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
@@ -94,9 +94,10 @@ private:
|
||||
|
||||
void stop();
|
||||
|
||||
libcamera::FrameBuffer *createFrameBuffer(const buffer_handle_t camera3buffer,
|
||||
libcamera::PixelFormat pixelFormat,
|
||||
const libcamera::Size &size);
|
||||
std::unique_ptr<libcamera::FrameBuffer>
|
||||
createFrameBuffer(const buffer_handle_t camera3buffer,
|
||||
libcamera::PixelFormat pixelFormat,
|
||||
const libcamera::Size &size);
|
||||
void abortRequest(camera3_capture_request_t *request);
|
||||
bool isValidRequest(camera3_capture_request_t *request) const;
|
||||
void notifyShutter(uint32_t frameNumber, uint64_t timestamp);
|
||||
|
||||
Reference in New Issue
Block a user