class

V4L2::Device

Inherits V4L2::IOCTL < Reference < Object

Represents an opened V4L2 device.

Constructors

new(fd : Int32)

Initializes the device with the previously opened file descriptor.

Source
open(path) : Device

Opens the V4L2 device at the given path.

V4L2::Device.open("/dev/video0")
Source

Class methods

open(path, &block : Device -> )

Opens the V4L2 device at the given path, yields it, then closes it.

V4L2::Device.open("/dev/video0") do |video|
  # ...
end
Source

Instance methods

audio

Retrieves the current audio input.

Source
audio=(new_audio : Audio) : Audio

Sets the current audio input.

Source
capability

The capabilities of the V4L2 device.

Source
close

Closes the V4L2 device.

Source
closed?

Determines whether the V4L2 device is closed.

Source
each_audio

Enumerates over each audio input supported by the V4L2 device, yielding each Audio object.

Source
each_audio_out

Enumerates over each audio output supported by the V4L2 device, yielding each AudioOut object.

Source
each_input

Enumerates over the video inputs, yielding each Input object.

Source
each_output

Enumerates over the video outputs supported by the V4L2 device, yielding each Output object.

Source
each_standard

Enumerates over the supported video standards for the V4L2 device, yielding each Standard object.

Source
fd

The underlying file descriptor.

Source
finalize

Ensures the V4L2 device gets closed.

Source
frame_buffer

Retrieves the current frame buffer.

Source
frame_buffer=(new_fb)

Sets the current frame buffer.

Source
frequency(tuner : UInt32)

Retrieves the current tuner or modulator radio frequency, given the tuner or modulator index number.

Source
frequency=(frequency : Frequency)

Sets the current tuner or modulator frequency.

Source
input

Queries the video input number.

Source
input=(new_input : Int32) : Int32

Sets the video input number.

Source
log_status

Log driver status information.

Note: This ioctl is optional and not all drivers support it. It was introduced in Linux 2.6.15.

Source
meta_capture

The META_CAPTURE stream.

Source
meta_output

The META_OUTPUT stream.

Source
modulator(index : UInt32 = 0) : Modulator

Retrieves the current modulator.

Source
modulator=(modulator : Modulator)

Sets the current modulator.

Source
output

Queries the current video output number.

Source
output=(new_output : Int32)

Sets the current video output number.

Source
overlay=(start_or_stop : Bool) : Bool

Starts or stops video overlay I/O.

Source
priority

Queries the access priority of the V4L2 device.

Source
priority=(new_priority : Priority) : Priority

Sets the access priority of the device.

Source
query_capability

Queries the V4L2 device capabilities.

Source
read(buffer : Slice(UInt8)) : Int32

Reads data directly from the V4L2 device's file descriptor. Returns the number of bytes read. If no data is currently available, this method will wait.

Source
read_timeout

Queries the read timeout for the V4L2 device's file descriptor.

Source
read_timeout=(new_timeout : Time::Span)

Sets the read timeout for the V4L2 device's file descriptor.

Source
sdr_capture

The SDR_CAPTURE stream.

Source
sdr_output

The SDR_OUTPUT stream.

Source
sliced_vbi_capture

The SLICED_VBI_CAPTURE stream.

Source
sliced_vbi_output

The SLICED_VBI_OUTPUT stream.

Source
standard

Queries the current video standard.

Source
standard=(new_std_id : StandardID)

Sets the current video standard.

Source
to_unsafe

Returns the underlying file descriptor for the V4L2 device.

Source
try_format(new_format : Format) : Bool

Attempts to change the current format of the V4L2 device, but does not actually change the current format.

Source
vbi_capture

The VBI_CAPTURE stream.

Source
vbi_output

The VBI_OUTPUT stream.

Source
video_capture

The VIDEO_CAPTURE stream.

Source
video_capture_mplane

The VIDEO_CAPTURE_MPLANE stream.

Source
video_output

The VIDEO_OUTPUT stream.

Source
video_output_mplane

The VIDEO_OUTPUT_MPLANE stream.

Source
video_output_overlay

The VIDEO_OUTPUT_OVERLAY stream.

Source
video_overlay

The VIDEO_OVERLAY stream.

Source
wait_readable

Waits for the V4L2 device to indicate data is available for reading.

Source
write(buffer : Slice(UInt8))

Writes data directly to the V4L2 device's file descriptor.

Source

Nested types