summaryrefslogtreecommitdiff
path: root/py/tests
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2020-03-11 09:48:10 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2020-04-21 11:44:35 +0300
commit4091a630137400dfac389215a7ec8c43b191ec5f (patch)
tree8c35dc97de8860c96c8f6826ce339c666a44901d /py/tests
parent50b2b57ba6df5b0ef327e219390cac8aae8e28fe (diff)
py/cam.py: get w & h from cmdline
Diffstat (limited to 'py/tests')
-rwxr-xr-xpy/tests/cam.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/py/tests/cam.py b/py/tests/cam.py
index c813b2f..b7294ed 100755
--- a/py/tests/cam.py
+++ b/py/tests/cam.py
@@ -3,11 +3,20 @@
import sys
import selectors
import pykms
+import argparse
+import time
-w = 640
-h = 480
+parser = argparse.ArgumentParser()
+parser.add_argument("width", type=int)
+parser.add_argument("height", type=int)
+args = parser.parse_args()
+
+w = args.width
+h = args.height
fmt = pykms.PixelFormat.YUYV
+print("Capturing in {}x{}".format(w, h))
+
card = pykms.Card()
res = pykms.ResourceManager(card)
conn = res.reserve_connector()