Represents an opened V4L2 device.
Constructors
new(fd : Int32)
Initializes the device with the previously opened file descriptor.
Sourceopen(path) : Device
Opens the V4L2 device at the given path.
V4L2::Device.open("/dev/video0")
SourceClass 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
SourceInstance methods
audio
Retrieves the current audio input.
Sourceaudio=(new_audio : Audio) : Audio
Sets the current audio input.
Sourcecapability
The capabilities of the V4L2 device.
Sourceclosed?
Determines whether the V4L2 device is closed.
Sourceeach_audio
Enumerates over each audio input supported by the V4L2 device, yielding
each Audio object.
Sourceeach_audio_out
Enumerates over each audio output supported by the V4L2 device, yielding
each AudioOut object.
Sourceeach_output
Enumerates over the video outputs supported by the V4L2 device, yielding
each Output object.
Sourceeach_standard
Enumerates over the supported video standards for the V4L2 device,
yielding each Standard object.
Sourcefd
The underlying file descriptor.
Sourcefinalize
Ensures the V4L2 device gets closed.
Sourceframe_buffer
Retrieves the current frame buffer.
Sourceframe_buffer=(new_fb)
Sets the current frame buffer.
Sourcefrequency(tuner : UInt32)
Retrieves the current tuner or modulator radio frequency, given the
tuner or modulator index number.
Sourcefrequency=(frequency : Frequency)
Sets the current tuner or modulator frequency.
Sourcelog_status
Log driver status information.
Note: This ioctl is optional and not all drivers support it. It was
introduced in Linux 2.6.15.
Sourcemodulator(index : UInt32 = 0) : Modulator
Retrieves the current modulator.
Sourcemodulator=(modulator : Modulator)
Sets the current modulator.
Sourceoutput
Queries the current video output number.
Sourceoutput=(new_output : Int32)
Sets the current video output number.
Sourceoverlay=(start_or_stop : Bool) : Bool
Starts or stops video overlay I/O.
Sourcepriority
Queries the access priority of the V4L2 device.
Sourcepriority=(new_priority : Priority) : Priority
Sets the access priority of the device.
Sourcequery_capability
Queries the V4L2 device capabilities.
Sourceread(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.
Sourceread_timeout
Queries the read timeout for the V4L2 device's file descriptor.
Sourceread_timeout=(new_timeout : Time::Span)
Sets the read timeout for the V4L2 device's file descriptor.
Sourcesliced_vbi_capture
The SLICED_VBI_CAPTURE stream.
Sourcesliced_vbi_output
The SLICED_VBI_OUTPUT stream.
Sourcestandard
Queries the current video standard.
Sourcestandard=(new_std_id : StandardID)
Sets the current video standard.
Sourceto_unsafe
Returns the underlying file descriptor for the V4L2 device.
Sourcevideo_capture
The VIDEO_CAPTURE stream.
Sourcevideo_capture_mplane
The VIDEO_CAPTURE_MPLANE stream.
Sourcevideo_output_mplane
The VIDEO_OUTPUT_MPLANE stream.
Sourcevideo_output_overlay
The VIDEO_OUTPUT_OVERLAY stream.
Sourcevideo_overlay
The VIDEO_OVERLAY stream.
Sourcewait_readable
Waits for the V4L2 device to indicate data is available for reading.
Sourcewrite(buffer : Slice(UInt8))
Writes data directly to the V4L2 device's file descriptor.
Source