summaryrefslogtreecommitdiff
path: root/src/py/cam/cam_kms.py
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2022-05-27 17:44:27 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-05-27 22:03:30 +0300
commit6eb1143e27d284200a672f957c8e5efbf87aafcc (patch)
tree9748228da511accd82eccd984c2b2ec22ded2133 /src/py/cam/cam_kms.py
parentbb1cbd53d267d45bcb8a8336a9daef5339e28f1a (diff)
py: cam: Convert ctx and state to classes
Convert ctx and state dicts to classes. No functional changes. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@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.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/py/cam/cam_kms.py b/src/py/cam/cam_kms.py
index 74cd3b38..213e0b03 100644
--- a/src/py/cam/cam_kms.py
+++ b/src/py/cam/cam_kms.py
@@ -10,8 +10,8 @@ class KMSRenderer:
def __init__(self, state):
self.state = state
- self.cm = state['cm']
- self.contexts = state['contexts']
+ self.cm = state.cm
+ self.contexts = state.contexts
self.running = False
card = pykms.Card()
@@ -92,7 +92,7 @@ class KMSRenderer:
if old:
req = old['camreq']
ctx = old['camctx']
- self.state['request_prcessed'](ctx, req)
+ self.state.request_processed(ctx, req)
def queue(self, drmreq):
if not self.next:
@@ -108,7 +108,7 @@ class KMSRenderer:
idx = 0
for ctx in self.contexts:
- for stream in ctx['streams']:
+ for stream in ctx.streams:
cfg = stream.configuration
fmt = cfg.pixel_format
@@ -125,7 +125,7 @@ class KMSRenderer:
'size': cfg.size,
})
- for fb in ctx['allocator'].buffers(stream):
+ for fb in ctx.allocator.buffers(stream):
w = cfg.size.width
h = cfg.size.height
fds = []
@@ -148,7 +148,7 @@ class KMSRenderer:
self.handle_page_flip(ev.seq, ev.time)
def readcam(self, fd):
- self.running = self.state['event_handler'](self.state)
+ self.running = self.state.event_handler()
def readkey(self, fileobj):
sys.stdin.readline()