(use-modules (oop goops) (ice-9 rdelim) (aiscm v4l2) (aiscm core))
(define (select formats)
  (for-each (lambda (i mode) (format #t "~a: ~a~%" i mode))
            (iota (length formats))
            formats)
  (format #t "> ") (list-ref formats (string->number (read-line (current-input-port)))))
(define v (make <v4l2> #:device "/dev/video0" #:channel 0 #:select select))
(read-image v)
(destroy v)
