summaryrefslogtreecommitdiff
path: root/src/android/yuv/post_processor_yuv.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/android/yuv/post_processor_yuv.h')
-rw-r--r--src/android/yuv/post_processor_yuv.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/android/yuv/post_processor_yuv.h b/src/android/yuv/post_processor_yuv.h
new file mode 100644
index 00000000..ed7bb1fb
--- /dev/null
+++ b/src/android/yuv/post_processor_yuv.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2021, Google Inc.
+ *
+ * Post Processor using libyuv
+ */
+
+#pragma once
+
+#include "../post_processor.h"
+
+#include <libcamera/geometry.h>
+
+class PostProcessorYuv : public PostProcessor
+{
+public:
+ PostProcessorYuv() = default;
+
+ int configure(const libcamera::StreamConfiguration &incfg,
+ const libcamera::StreamConfiguration &outcfg) override;
+ void process(Camera3RequestDescriptor::StreamBuffer *streamBuffer) override;
+
+private:
+ bool isValidBuffers(const libcamera::FrameBuffer &source,
+ const CameraBuffer &destination) const;
+ void calculateLengths(const libcamera::StreamConfiguration &inCfg,
+ const libcamera::StreamConfiguration &outCfg);
+
+ libcamera::Size sourceSize_;
+ libcamera::Size destinationSize_;
+ unsigned int sourceLength_[2] = {};
+ unsigned int destinationLength_[2] = {};
+ unsigned int sourceStride_[2] = {};
+ unsigned int destinationStride_[2] = {};
+};