libcamera: MappedFrameBuffer: Add MappedFrameBuffer::getPlaneFD()

Add MappedFrameBuffer::getPlaneFD() which takes a plane index and returns
the file descriptor associated with it.

This fd will be used to feed into eglCreateImageKHR for both texture
creation on upload and directly render-to-texture where the texture buffer
comes from the fd given to eglCreateImageKHR.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
This commit is contained in:
Bryan O'Donoghue 2025-05-11 15:16:44 +01:00
parent 1142f89aae
commit 2929cdcc58
2 changed files with 6 additions and 0 deletions

View file

@ -55,6 +55,7 @@ public:
using MapFlags = Flags<MapFlag>;
MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags);
int getPlaneFD(int plane);
private:
const FrameBuffer *buffer_;

View file

@ -242,4 +242,9 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)
buffer_ = buffer;
}
int MappedFrameBuffer::getPlaneFD(int plane)
{
return buffer_->planes()[plane].fd.get();
}
} /* namespace libcamera */