Skip to content

Commit

Permalink
utils: simplify --type and --display handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Demon000 committed Nov 1, 2024
1 parent e906267 commit 7f6e92f
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions utils/cam.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,18 @@ def parse_args(ctx: Context):
ctx.tx = None
ctx.net_tx = None

if args.type and args.type not in ['drm', 'v4l2']:
if not args.type:
if args.display:
args.type = 'drm'
else:
args.type = 'v4l2'

if args.type not in ['drm', 'v4l2']:
print('Bad buffer type', args.type)
sys.exit(-1)

ctx.use_display = args.display

if args.type:
ctx.buf_type = args.type
else:
if args.display:
ctx.buf_type = 'drm'
else:
ctx.buf_type = 'v4l2'
ctx.buf_type = args.type

ctx.config = read_config(args.config_name, args.params)

Expand Down

0 comments on commit 7f6e92f

Please sign in to comment.