package zbar

  1. Overview
  2. Docs
type t

Type of a video device (encapsulate the C type zbar_video_t *).

Initialisation

Low level interface

val create : unit -> t

Create the video device structure.

val request_size : t -> int -> int -> unit

Request a preferred size for the video image from the device. Must be called before open_.

val request_interface : t -> int -> unit

Request a preferred driver interface version for debug/testing. Must be called before open_.

val request_iomode : t -> int -> unit

Request a preferred I/O mode for debug/testing. Must be called before open_.

val open_ : t -> string -> unit

open_ h dev opens the video device dev.

High level interface

val opendev : ?dev:string -> unit -> t

opendev ~dev () creates a video device reading its frames from ~dev (default /dev/video0) and opens it with the default settings. It is equivalent to call create, then open_.

Using the video device

val closedev : t -> unit
val stream : t -> Image.t Lwt_stream.t

stream d starts the video capture and returns the stream of images from the video device structure d.

val disable : t -> unit

disable d stops the video capture on device structure d.