From 37a76a53ddf8c740b479f773d7d10ad7ca074d83 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 6 Nov 2019 11:29:32 +0200 Subject: Split dmabuf support from ExtFramebuffer into DmabufFramebuffer Signed-off-by: Tomi Valkeinen --- py/pykms/pykmsbase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/pykms') diff --git a/py/pykms/pykmsbase.cpp b/py/pykms/pykmsbase.cpp index b4dc090..5f39faa 100644 --- a/py/pykms/pykmsbase.cpp +++ b/py/pykms/pykmsbase.cpp @@ -167,7 +167,7 @@ void init_pykmsbase(py::module &m) .def("offset", &DumbFramebuffer::offset) ; - py::class_(m, "ExtFramebuffer") + py::class_(m, "DmabufFramebuffer") .def(py::init, vector, vector>(), py::keep_alive<1, 2>()) // Keep Card alive until this is destructed ; -- cgit v1.2.3 From 77c1805d043b8b7692eb5aaae3732c4bd1e7af76 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 6 Nov 2019 15:26:15 +0200 Subject: pykmsbase: upgrade Blob __init__ to fix deprecation warning --- py/pykms/pykmsbase.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'py/pykms') diff --git a/py/pykms/pykmsbase.cpp b/py/pykms/pykmsbase.cpp index 5f39faa..c039833 100644 --- a/py/pykms/pykmsbase.cpp +++ b/py/pykms/pykmsbase.cpp @@ -122,14 +122,14 @@ void init_pykmsbase(py::module &m) ; py::class_(m, "Blob") - .def("__init__", [](Blob& instance, Card& card, py::buffer buf) { - py::buffer_info info = buf.request(); - if (info.ndim != 1) - throw std::runtime_error("Incompatible buffer dimension!"); - - new (&instance) Blob(card, info.ptr, info.size * info.itemsize); - }, - py::keep_alive<1, 3>()) // Keep Card alive until this is destructed + .def(py::init([](Card& card, py::buffer buf) { + py::buffer_info info = buf.request(); + if (info.ndim != 1) + throw std::runtime_error("Incompatible buffer dimension!"); + + return new Blob(card, info.ptr, info.size * info.itemsize); + }), + py::keep_alive<1, 2>()) // Keep Card alive until this is destructed .def_property_readonly("data", &Blob::data) -- cgit v1.2.3