summaryrefslogtreecommitdiff
path: root/src/android/yuv
diff options
context:
space:
mode:
Diffstat (limited to 'src/android/yuv')
-rw-r--r--src/android/yuv/post_processor_yuv.cpp20
-rw-r--r--src/android/yuv/post_processor_yuv.h4
2 files changed, 12 insertions, 12 deletions
diff --git a/src/android/yuv/post_processor_yuv.cpp b/src/android/yuv/post_processor_yuv.cpp
index 1318349a..b67364c8 100644
--- a/src/android/yuv/post_processor_yuv.cpp
+++ b/src/android/yuv/post_processor_yuv.cpp
@@ -48,7 +48,7 @@ int PostProcessorYuv::configure(const StreamConfiguration &inCfg,
}
int PostProcessorYuv::process(const FrameBuffer &source,
- libcamera::MappedBuffer *destination,
+ CameraBuffer *destination,
[[maybe_unused]] const CameraMetadata &requestMetadata,
[[maybe_unused]] CameraMetadata *metadata)
{
@@ -66,9 +66,9 @@ int PostProcessorYuv::process(const FrameBuffer &source,
sourceMapped.maps()[1].data(),
sourceStride_[1],
sourceSize_.width, sourceSize_.height,
- destination->maps()[0].data(),
+ destination->plane(0).data(),
destinationStride_[0],
- destination->maps()[1].data(),
+ destination->plane(1).data(),
destinationStride_[1],
destinationSize_.width,
destinationSize_.height,
@@ -82,16 +82,16 @@ int PostProcessorYuv::process(const FrameBuffer &source,
}
bool PostProcessorYuv::isValidBuffers(const FrameBuffer &source,
- const libcamera::MappedBuffer &destination) const
+ const CameraBuffer &destination) const
{
if (source.planes().size() != 2) {
LOG(YUV, Error) << "Invalid number of source planes: "
<< source.planes().size();
return false;
}
- if (destination.maps().size() != 2) {
+ if (destination.numPlanes() != 2) {
LOG(YUV, Error) << "Invalid number of destination planes: "
- << destination.maps().size();
+ << destination.numPlanes();
return false;
}
@@ -106,12 +106,12 @@ bool PostProcessorYuv::isValidBuffers(const FrameBuffer &source,
<< sourceLength_[1] << "}";
return false;
}
- if (destination.maps()[0].size() < destinationLength_[0] ||
- destination.maps()[1].size() < destinationLength_[1]) {
+ if (destination.plane(0).size() < destinationLength_[0] ||
+ destination.plane(1).size() < destinationLength_[1]) {
LOG(YUV, Error)
<< "The destination planes lengths are too small, actual size: {"
- << destination.maps()[0].size() << ", "
- << destination.maps()[1].size()
+ << destination.plane(0).size() << ", "
+ << destination.plane(1).size()
<< "}, expected size: {"
<< sourceLength_[0] << ", "
<< sourceLength_[1] << "}";
diff --git a/src/android/yuv/post_processor_yuv.h b/src/android/yuv/post_processor_yuv.h
index c58b4cf7..f8b1ba23 100644
--- a/src/android/yuv/post_processor_yuv.h
+++ b/src/android/yuv/post_processor_yuv.h
@@ -21,13 +21,13 @@ public:
int configure(const libcamera::StreamConfiguration &incfg,
const libcamera::StreamConfiguration &outcfg) override;
int process(const libcamera::FrameBuffer &source,
- libcamera::MappedBuffer *destination,
+ CameraBuffer *destination,
const CameraMetadata &requestMetadata,
CameraMetadata *metadata) override;
private:
bool isValidBuffers(const libcamera::FrameBuffer &source,
- const libcamera::MappedBuffer &destination) const;
+ const CameraBuffer &destination) const;
void calculateLengths(const libcamera::StreamConfiguration &inCfg,
const libcamera::StreamConfiguration &outCfg);
> offsets_[kv.first] = {}; ParseStatus ret = findRegs(buffer); /* * > 0 means "worked partially but parse again next time", * < 0 means "hard error". * * In either case, we retry parsing on the next frame. */ if (ret != PARSE_OK) return ERROR; reset_ = false; } /* Populate the register values requested. */ registers.clear(); for (const auto &[reg, offset] : offsets_) { if (!offset) { reset_ = true; return NOTFOUND; } registers[reg] = buffer[offset.value()]; } return OK; } MdParserSmia::ParseStatus MdParserSmia::findRegs(libcamera::Span<const uint8_t> buffer) { ASSERT(offsets_.size()); if (buffer[0] != LINE_START) return NO_LINE_START; unsigned int current_offset = 1; /* after the LINE_START */ unsigned int current_line_start = 0, current_line = 0; unsigned int reg_num = 0, regs_done = 0; while (1) { int tag = buffer[current_offset++]; if ((bits_per_pixel_ == 10 && (current_offset + 1 - current_line_start) % 5 == 0) || (bits_per_pixel_ == 12 && (current_offset + 1 - current_line_start) % 3 == 0)) { if (buffer[current_offset++] != REG_SKIP) return BAD_DUMMY; }