@@ -20,6 +20,8 @@ public:
CameraBuffer(buffer_handle_t camera3Buffer, int flags);
~CameraBuffer();
+ static bool isValidBuffer(buffer_handle_t camera3Buffer);
+
bool isValid() const;
unsigned int numPlanes() const;
@@ -38,6 +40,10 @@ CameraBuffer::CameraBuffer(buffer_handle_t camera3Buffer, int flags) \
CameraBuffer::~CameraBuffer() \
{ \
} \
+bool CameraBuffer::isValidBuffer(buffer_handle_t buffer) \
+{ \
+ return Private::isValidBuffer(buffer); \
+} \
bool CameraBuffer::isValid() const \
{ \
const Private *const d = LIBCAMERA_D_PTR(); \
@@ -24,6 +24,8 @@ public:
buffer_handle_t camera3Buffer, int flags);
~Private();
+ static bool isValidBuffer(buffer_handle_t camera3Buffer);
+
bool isValid() const { return valid_; }
unsigned int numPlanes() const;
@@ -133,4 +135,10 @@ size_t CameraBuffer::Private::jpegBufferSize(size_t maxJpegBufferSize) const
return bufferManager_->GetPlaneSize(handle_, 0);
}
+/* static */
+bool CameraBuffer::Private::isValidBuffer(buffer_handle_t camera3Buffer)
+{
+ return cros::CameraBufferManager::IsValidBuffer(camera3Buffer);
+}
+
PUBLIC_CAMERA_BUFFER_IMPLEMENTATION
@@ -24,6 +24,8 @@ public:
buffer_handle_t camera3Buffer, int flags);
~Private();
+ static bool isValidBuffer(buffer_handle_t camera3Buffer);
+
unsigned int numPlanes() const;
Span<uint8_t> plane(unsigned int plane);
@@ -85,4 +87,11 @@ size_t CameraBuffer::Private::jpegBufferSize(size_t maxJpegBufferSize) const
maxJpegBufferSize);
}
+/* static */
+bool CameraBuffer::Private::isValidBuffer(
+ [[maybe_unused]] buffer_handle_t camera3Buffer)
+{
+ return true;
+}
+
PUBLIC_CAMERA_BUFFER_IMPLEMENTATION