summaryrefslogtreecommitdiff
path: root/py/pykmsbase.cpp
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-05-25 14:34:23 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-05-25 14:34:42 +0300
commit2d14233bdb2302bffc1a241681f34933cb99c157 (patch)
tree8144b28596c5a3cc4e6b4755de489a126d4278c0 /py/pykmsbase.cpp
parentd30ec339a102acd479e4327f319416886c7a3473 (diff)
Add support for DRM blobs
Diffstat (limited to 'py/pykmsbase.cpp')
-rw-r--r--py/pykmsbase.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/py/pykmsbase.cpp b/py/pykmsbase.cpp
index aa86d9f..83be9d2 100644
--- a/py/pykmsbase.cpp
+++ b/py/pykmsbase.cpp
@@ -31,6 +31,9 @@ void init_pykmsbase(py::module &m)
py::class_<DrmPropObject, DrmPropObject*>(m, "DrmPropObject", py::base<DrmObject>())
.def("refresh_props", &DrmPropObject::refresh_props)
.def_property_readonly("prop_map", &DrmPropObject::get_prop_map)
+ .def("get_prop_value", (uint64_t (DrmPropObject::*)(const string&) const)&DrmPropObject::get_prop_value)
+ .def("set_prop_value",(int (DrmPropObject::*)(const string&, uint64_t)) &DrmPropObject::set_prop_value)
+ .def("get_prop_value_as_blob", &DrmPropObject::get_prop_value_as_blob)
;
py::class_<Connector, Connector*>(m, "Connector", py::base<DrmPropObject>())
@@ -69,6 +72,17 @@ void init_pykmsbase(py::module &m)
.def_property_readonly("name", &Property::name)
;
+ py::class_<Blob>(m, "Blob", py::base<DrmObject>())
+ .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);
+ })
+ .def_property_readonly("data", &Blob::data)
+ ;
+
py::class_<Framebuffer>(m, "Framebuffer", py::base<DrmObject>())
;