summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rw-r--r--py/pykms/pykmsbase.cpp16
-rwxr-xr-xpy/tests/test.py2
2 files changed, 9 insertions, 9 deletions
diff --git a/py/pykms/pykmsbase.cpp b/py/pykms/pykmsbase.cpp
index b4dc090..c039833 100644
--- a/py/pykms/pykmsbase.cpp
+++ b/py/pykms/pykmsbase.cpp
@@ -122,14 +122,14 @@ void init_pykmsbase(py::module &m)
;
py::class_<Blob>(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!");
+ .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!");
- new (&instance) Blob(card, info.ptr, info.size * info.itemsize);
- },
- py::keep_alive<1, 3>()) // Keep Card alive until this is destructed
+ 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)
@@ -167,7 +167,7 @@ void init_pykmsbase(py::module &m)
.def("offset", &DumbFramebuffer::offset)
;
- py::class_<ExtFramebuffer, Framebuffer>(m, "ExtFramebuffer")
+ py::class_<DmabufFramebuffer, Framebuffer>(m, "DmabufFramebuffer")
.def(py::init<Card&, uint32_t, uint32_t, PixelFormat, vector<int>, vector<uint32_t>, vector<uint32_t>>(),
py::keep_alive<1, 2>()) // Keep Card alive until this is destructed
;
diff --git a/py/tests/test.py b/py/tests/test.py
index 83cf16a..3f9e205 100755
--- a/py/tests/test.py
+++ b/py/tests/test.py
@@ -28,7 +28,7 @@ else:
origfb = pykms.DumbFramebuffer(card, mode.hdisplay, mode.vdisplay, "XR24");
if args.dmabuf:
- fb = pykms.ExtFramebuffer(card, origfb.width, origfb.height, origfb.format,
+ fb = pykms.DmabufFramebuffer(card, origfb.width, origfb.height, origfb.format,
[origfb.fd(0)], [origfb.stride(0)], [origfb.offset(0)])
else:
fb = origfb