From b5f865b92566e4205770b63ba713c41c4edb5da3 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 7 Oct 2020 08:43:10 +0300 Subject: dmabuffb: add constructor which takes in string fourcc Signed-off-by: Tomi Valkeinen --- kms++/inc/kms++/dmabufframebuffer.h | 2 ++ kms++/src/dmabufframebuffer.cpp | 5 +++++ py/pykms/pykmsbase.cpp | 2 ++ 3 files changed, 9 insertions(+) diff --git a/kms++/inc/kms++/dmabufframebuffer.h b/kms++/inc/kms++/dmabufframebuffer.h index 2596d30..328dd2b 100644 --- a/kms++/inc/kms++/dmabufframebuffer.h +++ b/kms++/inc/kms++/dmabufframebuffer.h @@ -12,6 +12,8 @@ namespace kms class DmabufFramebuffer : public Framebuffer { public: + DmabufFramebuffer(Card& card, uint32_t width, uint32_t height, const std::string& format, + std::vector fds, std::vector pitches, std::vector offsets, std::vector modifiers = {}); DmabufFramebuffer(Card& card, uint32_t width, uint32_t height, PixelFormat format, std::vector fds, std::vector pitches, std::vector offsets, std::vector modifiers = {}); ~DmabufFramebuffer() override; diff --git a/kms++/src/dmabufframebuffer.cpp b/kms++/src/dmabufframebuffer.cpp index 1e8c914..991d96c 100644 --- a/kms++/src/dmabufframebuffer.cpp +++ b/kms++/src/dmabufframebuffer.cpp @@ -15,6 +15,11 @@ using namespace std; namespace kms { +DmabufFramebuffer::DmabufFramebuffer(Card& card, uint32_t width, uint32_t height, const string& format, + vector fds, vector pitches, vector offsets, vector modifiers) + : DmabufFramebuffer(card, width, height, FourCCToPixelFormat(format), fds, pitches, offsets, modifiers) +{ +} DmabufFramebuffer::DmabufFramebuffer(Card& card, uint32_t width, uint32_t height, PixelFormat format, vector fds, vector pitches, vector offsets, vector modifiers) diff --git a/py/pykms/pykmsbase.cpp b/py/pykms/pykmsbase.cpp index a55cf3a..6ed82a0 100644 --- a/py/pykms/pykmsbase.cpp +++ b/py/pykms/pykmsbase.cpp @@ -171,6 +171,8 @@ void init_pykmsbase(py::module &m) ; py::class_(m, "DmabufFramebuffer") + .def(py::init, vector, vector>(), + py::keep_alive<1, 2>()) // Keep Card alive until this is destructed .def(py::init, vector, vector>(), py::keep_alive<1, 2>()) // Keep Card alive until this is destructed ; -- cgit v1.2.3