From fa7bda46f8a44e1d228489b37744d1eac8373b56 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 18 May 2022 16:13:23 +0300 Subject: py: Implement PixelFormat class Implement PixelFormat bindings properly with a PixelFormat class. Change the bindings to use the new class instead of a string. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Laurent Pinchart --- src/py/cam/cam_kms.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/py/cam/cam_kms.py') diff --git a/src/py/cam/cam_kms.py b/src/py/cam/cam_kms.py index d8ff0284..04381da1 100644 --- a/src/py/cam/cam_kms.py +++ b/src/py/cam/cam_kms.py @@ -5,14 +5,6 @@ import pykms import selectors import sys -FMT_MAP = { - 'RGB888': pykms.PixelFormat.RGB888, - 'YUYV': pykms.PixelFormat.YUYV, - 'ARGB8888': pykms.PixelFormat.ARGB8888, - 'XRGB8888': pykms.PixelFormat.XRGB8888, - 'NV12': pykms.PixelFormat.NV12, -} - class KMSRenderer: def __init__(self, state): @@ -120,7 +112,7 @@ class KMSRenderer: cfg = stream.configuration fmt = cfg.pixel_format - fmt = FMT_MAP[fmt] + fmt = pykms.PixelFormat(fmt.fourcc) plane = self.resman.reserve_generic_plane(self.crtc, fmt) assert(plane is not None) -- cgit v1.2.1