omapfb: add constructor with fourcc
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 10 Feb 2017 09:13:05 +0000 (11:13 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 10 Feb 2017 09:13:05 +0000 (11:13 +0200)
kms++/inc/kms++/omap/omapframebuffer.h
kms++/src/omap/omapframebuffer.cpp
py/pykms/pykmsomap.cpp

index b39ede629fe8a7cf612d181578482059f2271132..16d6cf87dd6759934c148f0757a5af5d3a577cdf 100644 (file)
@@ -12,6 +12,7 @@ class OmapCard;
 class OmapFramebuffer : public MappedFramebuffer
 {
 public:
+       OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, const std::string& fourcc);
        OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, PixelFormat format);
        virtual ~OmapFramebuffer();
 
index a3a696d13c5192d6bfa9018d8a6c529995519b1e..e1e2234a49985e3baec60da0863b3245519c1d66 100644 (file)
@@ -22,6 +22,11 @@ using namespace std;
 namespace kms
 {
 
+OmapFramebuffer::OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, const string& fourcc)
+       : OmapFramebuffer(card, width, height, FourCCToPixelFormat(fourcc))
+{
+}
+
 OmapFramebuffer::OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, PixelFormat format)
        : MappedFramebuffer(card, width, height), m_omap_card(card), m_format(format)
 {
index 525834b06e3a415f3e53139c2298846df8b02cc3..a749f761be94b5fe1a51f916b9b158b138f3d8af 100644 (file)
@@ -15,6 +15,8 @@ void init_pykmsomap(py::module &m)
                        ;
 
        py::class_<OmapFramebuffer>(m, "OmapFramebuffer", py::base<MappedFramebuffer>())
+                       .def(py::init<OmapCard&, uint32_t, uint32_t, const string&>(),
+                            py::keep_alive<1, 2>())    // Keep Card alive until this is destructed
                        .def(py::init<OmapCard&, uint32_t, uint32_t, PixelFormat>(),
                             py::keep_alive<1, 2>())    // Keep OmapCard alive until this is destructed
                        ;