class V4L2::Device
- V4L2::Device
- Reference
- Object
Overview
Represents an opened V4L2 device.
Included Modules
Defined in:
v4l2/device.crConstructors
-
.new(fd : Int32)
Initializes the device with the previously opened file descriptor.
-
.open(path) : Device
Opens the V4L2 device at the given path.
Class Method Summary
-
.open(path, &block : Device -> )
Opens the V4L2 device at the given path, yields it, then closes it.
Instance Method Summary
-
#audio : Audio
Retrieves the current audio input.
-
#audio=(new_audio : Audio) : Audio
Sets the current audio input.
-
#capability : Capability
The capabilities of the V4L2 device.
-
#close
Closes the V4L2 device.
-
#closed? : Bool
Determines whether the V4L2 device is closed.
-
#each_audio(&) : self
Enumerates over each audio input supported by the V4L2 device, yielding each Audio object.
-
#each_audio_out(&) : self
Enumerates over each audio output supported by the V4L2 device, yielding each AudioOut object.
-
#each_input(&) : self
Enumerates over the video inputs, yielding each Input object.
-
#each_output(&) : self
Enumerates over the video outputs supported by the V4L2 device, yielding each Output object.
-
#each_standard(&) : self
Enumerates over the supported video standards for the V4L2 device, yielding each Standard object.
-
#fd : Int32
The underlying file descriptor.
-
#finalize
Ensures the V4L2 device gets closed.
-
#frame_buffer : Linux::V4L2FrameBuffer
Retrieves the current frame buffer.
-
#frame_buffer=(new_fb)
Sets the current frame buffer.
-
#frequency(tuner : UInt32)
Retrieves the current tuner or modulator radio frequency, given the tuner or modulator index number.
-
#frequency=(frequency : Frequency)
Sets the current tuner or modulator frequency.
-
#input : Int32
Queries the video input number.
-
#input=(new_input : Int32) : Int32
Sets the video input number.
-
#log_status
Log driver status information.
-
#meta_capture
The
META_CAPTURE
stream. -
#meta_output
The
META_OUTPUT
stream. -
#modulator(index : UInt32 = 0) : Modulator
Retrieves the current modulator.
-
#modulator=(modulator : Modulator)
Sets the current modulator.
-
#output : LibC::Int
Queries the current video output number.
-
#output=(new_output : Int32)
Sets the current video output number.
-
#overlay=(start_or_stop : Bool) : Bool
Starts or stops video overlay I/O.
-
#priority : Priority
Queries the access priority of the V4L2 device.
-
#priority=(new_priority : Priority) : Priority
Sets the access priority of the device.
-
#query_capability : Capability
Queries the V4L2 device capabilities.
-
#read(buffer : Slice(UInt8)) : Int32
Reads data directly from the V4L2 device's file descriptor.
-
#read_timeout : Time::Span
Queries the read timeout for the V4L2 device's file descriptor.
-
#read_timeout=(new_timeout : Time::Span)
Sets the read timeout for the V4L2 device's file descriptor.
-
#sdr_capture
The
SDR_CAPTURE
stream. -
#sdr_output
The
SDR_OUTPUT
stream. -
#sliced_vbi_capture
The
SLICED_VBI_CAPTURE
stream. -
#sliced_vbi_output
The
SLICED_VBI_OUTPUT
stream. -
#standard : StandardID
Queries the current video standard.
-
#standard=(new_std_id : StandardID)
Sets the current video standard.
-
#to_unsafe : Int32
Returns the underlying file descriptor for the V4L2 device.
-
#try_format(new_format : Format) : Bool
Attempts to change the current format of the V4L2 device, but does not actually change the current format.
-
#vbi_capture
The
VBI_CAPTURE
stream. -
#vbi_output
The
VBI_OUTPUT
stream. -
#video_capture
The
VIDEO_CAPTURE
stream. -
#video_capture_mplane
The
VIDEO_CAPTURE_MPLANE
stream. -
#video_output
The
VIDEO_OUTPUT
stream. -
#video_output_mplane
The
VIDEO_OUTPUT_MPLANE
stream. -
#video_output_overlay
The
VIDEO_OUTPUT_OVERLAY
stream. -
#video_overlay
The
VIDEO_OVERLAY
stream. -
#wait_readable
Waits for the V4L2 device to indicate data is available for reading.
-
#write(buffer : Slice(UInt8))
Writes data directly to the V4L2 device's file descriptor.
Constructor Detail
Opens the V4L2 device at the given path.
V4L2::Device.open("/dev/video0")
Class Method Detail
Opens the V4L2 device at the given path, yields it, then closes it.
V4L2::Device.open("/dev/video0") do |video|
# ...
end
Instance Method Detail
Enumerates over each audio input supported by the V4L2 device, yielding each Audio object.
Enumerates over each audio output supported by the V4L2 device, yielding each AudioOut object.
Enumerates over the video outputs supported by the V4L2 device, yielding each Output object.
Enumerates over the supported video standards for the V4L2 device, yielding each Standard object.
Retrieves the current tuner or modulator radio frequency, given the tuner or modulator index number.
Sets the current tuner or modulator frequency.
Log driver status information.
Note: This ioctl is optional and not all drivers support it. It was introduced in Linux 2.6.15.
Sets the access priority of the device.
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.
Sets the read timeout for the V4L2 device's file descriptor.
Attempts to change the current format of the V4L2 device, but does not actually change the current format.