summaryrefslogtreecommitdiff
path: root/src/py/cam/cam_kms.py
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2022-05-18 16:13:23 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-05-18 17:52:30 +0300
commitfa7bda46f8a44e1d228489b37744d1eac8373b56 (patch)
tree78027ab9b2e3658960a667be24b3b3399371b9af /src/py/cam/cam_kms.py
parent11a271b29234e0271c9cf83aefc529dc1e0b3cc3 (diff)
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 <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/py/cam/cam_kms.py')
-rw-r--r--src/py/cam/cam_kms.py10
1 files changed, 1 insertions, 9 deletions
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)