V4L2 common functions and data structures
v4l2_ctrl_query_fill() #
int Fill in a struct v4l2_queryctrl
Parameters
struct v4l2_queryctrl *qctrl: pointer to thestruct v4l2_queryctrlto be filleds32 min: minimum value for the controls32 max: maximum value for the controls32 step: control steps32 def: default value for the control
Description
Fills the struct v4l2_queryctrl fields for the query control.
Returns -EINVAL if the control is not known by the V4L2 core, 0 on success.
enum v4l2_i2c_tuner_type #
specifies the range of tuner address that should be used when seeking for I2C devices.
Constants
ADDRS_RADIO: Radio tuner addresses. Represent the following I2C addresses: 0x10 (if compiled with tea5761 support) and 0x60.ADDRS_DEMOD: Demod tuner addresses. Represent the following I2C addresses: 0x42, 0x43, 0x4a and 0x4b.ADDRS_TV: TV tuner addresses. Represent the following I2C addresses: 0x42, 0x43, 0x4a, 0x4b, 0x60, 0x61, 0x62, 0x63 and 0x64.ADDRS_TV_WITH_DEMOD: TV tuner addresses if demod is present, this excludes addresses used by the demodulator from the list of candidates. Represent the following I2C addresses: 0x60, 0x61, 0x62, 0x63 and 0x64.
NOTE
All I2C addresses above use the 7-bit notation.
v4l2_i2c_new_subdev() #
struct v4l2_subdev * Load an i2c module and return an initialized struct v4l2_subdev.
Parameters
struct v4l2_device *v4l2_dev: pointer tostruct v4l2_devicestruct i2c_adapter *adapter: pointer to struct i2c_adapterconst char *client_type: name of the chip that's on the adapter.u8 addr: I2C address. If zero, it will use probe_addrsconst unsigned short *probe_addrs: array with a list of address. The last entry at such array should beI2C_CLIENT_END.
Description
returns a struct v4l2_subdev pointer.
v4l2_i2c_new_subdev_board() #
struct v4l2_subdev * Load an i2c module and return an initialized struct v4l2_subdev.
Parameters
struct v4l2_device *v4l2_dev: pointer tostruct v4l2_devicestruct i2c_adapter *adapter: pointer to struct i2c_adapterstruct i2c_board_info *info: pointer to struct i2c_board_info used to replace the irq, platform_data and addr arguments.const unsigned short *probe_addrs: array with a list of address. The last entry at such array should beI2C_CLIENT_END.
Description
returns a struct v4l2_subdev pointer.
v4l2_i2c_subdev_set_name() #
void Set name for an I²C sub-device
Parameters
struct v4l2_subdev *sd: pointer tostruct v4l2_subdevstruct i2c_client *client: pointer to struct i2c_clientconst char *devname: the name of the device; if NULL, the I²C device drivers's name will be usedconst char *postfix: sub-device specific string to put right after the I²C device name; may be NULL
v4l2_i2c_subdev_init() #
void Initializes a struct v4l2_subdev with data from an i2c_client struct.
Parameters
struct v4l2_subdev *sd: pointer tostruct v4l2_subdevstruct i2c_client *client: pointer to struct i2c_clientconst struct v4l2_subdev_ops *ops: pointer tostruct v4l2_subdev_ops
v4l2_i2c_subdev_addr() #
unsigned short returns i2c client address of struct v4l2_subdev.
Parameters
struct v4l2_subdev *sd: pointer tostruct v4l2_subdev
Description
Returns the address of an I2C sub-device
v4l2_i2c_tuner_addrs() #
const unsigned short * Return a list of I2C tuner addresses to probe.
Parameters
enum v4l2_i2c_tuner_type type: type of the tuner to seek, as defined byenum v4l2_i2c_tuner_type.
NOTE
Use only if the tuner addresses are unknown.
v4l2_i2c_subdev_unregister() #
void Unregister a v4l2_subdev
Parameters
struct v4l2_subdev *sd: pointer tostruct v4l2_subdev
v4l2_spi_new_subdev() #
struct v4l2_subdev * Load an spi module and return an initialized struct v4l2_subdev.
Parameters
struct v4l2_device *v4l2_dev: pointer tostruct v4l2_device.struct spi_controller *ctlr: pointer to struct spi_controller.struct spi_board_info *info: pointer to struct spi_board_info.
Description
returns a struct v4l2_subdev pointer.
v4l2_spi_subdev_init() #
void Initialize a v4l2_subdev with data from an spi_device struct.
Parameters
struct v4l2_subdev *sd: pointer tostruct v4l2_subdevstruct spi_device *spi: pointer to struct spi_device.const struct v4l2_subdev_ops *ops: pointer tostruct v4l2_subdev_ops
v4l2_spi_subdev_unregister() #
void Unregister a v4l2_subdev
Parameters
struct v4l2_subdev *sd: pointer tostruct v4l2_subdev
v4l_bound_align_image() #
void adjust video dimensions according to a given constraints.
Parameters
unsigned int *width: pointer to width that will be adjusted if needed.unsigned int wmin: minimum width.unsigned int wmax: maximum width.unsigned int walign: least significant bit on width.unsigned int *height: pointer to height that will be adjusted if needed.unsigned int hmin: minimum height.unsigned int hmax: maximum height.unsigned int halign: least significant bit on height.unsigned int salign: least significant bit for the image size (e. g. width * height).
Description
Clip an image to have width between wmin and wmax, and height between hmin and hmax, inclusive.
Additionally, the width will be a multiple of 2^{walign}, the height will be a multiple of 2^{halign}, and the overall size width * height will be a multiple of 2^{salign}.
v4l2_find_nearest_size_conditional() #
Find the nearest size among a discrete set of resolutions contained in an array of a driver specific struct, with conditionally exlusion of certain modes
Parameters
array: a driver specific array of image sizesarray_size: the length of the driver specific array of image sizeswidth_field: the name of the width field in the driver specific structheight_field: the name of the height field in the driver specific structwidth: desired widthheight: desired heightfunc: ignores mode if returns falsecontext: context for the function
Description
Finds the closest resolution to minimize the width and height differences between what requested and the supported resolutions. The size of the width and height fields in the driver specific must equal to that of u32, i.e. four bytes. func is called for each mode considered, a mode is ignored if func returns false for it.
Returns the best match or NULL if the length of the array is zero.
v4l2_find_nearest_size() #
Find the nearest size among a discrete set of resolutions contained in an array of a driver specific struct
Parameters
array: a driver specific array of image sizesarray_size: the length of the driver specific array of image sizeswidth_field: the name of the width field in the driver specific structheight_field: the name of the height field in the driver specific structwidth: desired widthheight: desired height
Description
Finds the closest resolution to minimize the width and height differences between what requested and the supported resolutions. The size of the width and height fields in the driver specific must equal to that of u32, i.e. four bytes.
Returns the best match or NULL if the length of the array is zero.
v4l2_g_parm_cap() #
int helper routine for vidioc_g_parm to fill this in by calling the get_frame_interval op of the given subdev. It only works for V4L2_BUF_TYPE_VIDEO_CAPTURE(_MPLANE), hence the _cap in the function name.
Parameters
struct video_device *vdev: the struct video_device pointer. Used to determine the device caps.struct v4l2_subdev *sd: the sub-device pointer.struct v4l2_streamparm *a: the VIDIOC_G_PARM argument.
v4l2_s_parm_cap() #
int helper routine for vidioc_s_parm to fill this in by calling the set_frame_interval op of the given subdev. It only works for V4L2_BUF_TYPE_VIDEO_CAPTURE(_MPLANE), hence the _cap in the function name.
Parameters
struct video_device *vdev: the struct video_device pointer. Used to determine the device caps.struct v4l2_subdev *sd: the sub-device pointer.struct v4l2_streamparm *a: the VIDIOC_S_PARM argument.
enum v4l2_pixel_encoding #
specifies the pixel encoding value
Constants
V4L2_PIXEL_ENC_UNKNOWN: Pixel encoding is unknown/un-initializedV4L2_PIXEL_ENC_YUV: Pixel encoding is YUVV4L2_PIXEL_ENC_RGB: Pixel encoding is RGBV4L2_PIXEL_ENC_BAYER: Pixel encoding is Bayer
struct v4l2_format_info #
information about a V4L2 format
Definition
;
Members
format: 4CC format identifier (V4L2_PIX_FMT_*)pixel_enc: Pixel encoding (see enum v4l2_pixel_encoding above)mem_planes: Number of memory planes, which includes the alpha plane (1 to 4).comp_planes: Number of component planes, which includes the alpha plane (1 to 4).bpp: Array of per-plane bytes per pixelbpp_div: Array of per-plane bytes per pixel divisors to support fractional pixel sizes.hdiv: Horizontal chroma subsampling factorvdiv: Vertical chroma subsampling factorblock_w: Per-plane macroblock pixel width (optional)block_h: Per-plane macroblock pixel height (optional)
v4l2_get_link_freq() #
s64 Get link rate from transmitter
Parameters
const struct media_pad *pad: The transmitter's media padunsigned int mul: The multiplier between pixel rate and link frequency. Bits per pixel on D-PHY, samples per clock on parallel. 0 otherwise.unsigned int div: The divisor between pixel rate and link frequency. Number of data lanes times two on D-PHY, 1 on parallel. 0 otherwise.
Description
This function obtains and returns the link frequency from the transmitter sub-device's pad. The link frequency is retrieved using the get_mbus_config sub-device pad operation. If this fails, the function falls back to obtaining the frequency either directly from the V4L2_CID_LINK_FREQ control if implemented by the transmitter, or by calculating it from the pixel rate obtained from the V4L2_CID_PIXEL_RATE control.
Return
-
0: Link frequency
-ENOENT: Link frequency or pixel rate control not found-EINVAL: Invalid link frequency value
v4l2_get_active_data_lanes() #
int Get number of active data lanes from driver
Parameters
const struct media_pad *pad: The transmitter's media pad.unsigned int max_data_lanes: The maximum number of active data lanes supported by the MIPI CSI link in hardware.
Description
This function is intended for obtaining the number of data lanes that are actively being used by the driver for a MIPI CSI-2 device on a given media pad. This information is derived from a mbus_config fetched from a device driver using the get_mbus_config v4l2_subdev pad op.
Return
-
0: Number of active data lanes
-EINVAL: Number of active data lanes is invalid, as it exceeds the maximum supported data lanes.
v4l2_link_freq_to_bitmap() #
int Figure out platform-supported link frequencies
Parameters
struct device *dev: The struct deviceconst u64 *fw_link_freqs: Array of link frequencies from firmwareunsigned int num_of_fw_link_freqs: Number of entries in fw_link_freqsconst s64 *driver_link_freqs: Array of link frequencies supported by the driverunsigned int num_of_driver_link_freqs: Number of entries in driver_link_freqsunsigned long *bitmap: Bitmap of driver-supported link frequencies found in fw_link_freqs
Description
This function checks which driver-supported link frequencies are enabled in system firmware and sets the corresponding bits in bitmap (after first zeroing it).
Return
0: Success-ENOENT: No match found between driver-supported link frequencies and those available in firmware.-ENODATA: No link frequencies were specified in firmware.
devm_v4l2_sensor_clk_get() #
struct clk * lookup and obtain a reference to a clock producer for a camera sensor
Parameters
struct device *dev: device for v4l2 sensor clock "consumer"const char *id: clock consumer ID
Description
This function behaves the same way as devm_clk_get() except where there
is no clock producer like in ACPI-based platforms.
For ACPI-based platforms, the function will read the "clock-frequency" ACPI _DSD property and register a fixed-clock with the frequency indicated in the property.
This function also handles the special ACPI-based system case where:
- The clock-frequency _DSD property is present.
- A reference to the clock producer is present, where the clock is provided by a camera sensor PMIC driver (e.g. int3472/tps68470.c)
In this case try to set the clock-frequency value to the provided clock.
As the name indicates, this function may only be used on camera sensor devices. This is because generally only camera sensors do need a clock to query the frequency from, due to the requirement to configure the PLL for a given CSI-2 interface frequency where the sensor's external clock frequency is a factor. Additionally, the clock frequency tends to be available on ACPI firmware based systems for camera sensors specifically (if e.g. DisCo for Imaging compliant).
Returns a pointer to a struct clk on success or an error pointer on failure.
devm_v4l2_sensor_clk_get_legacy() #
struct clk * lookup and obtain a reference to a clock producer for a camera sensor.
Parameters
struct device *dev: device for v4l2 sensor clock "consumer"const char *id: clock consumer IDbool fixed_rate: interpret the clk_rate as a fixed rate or default rateunsigned long clk_rate: the clock rate
Description
This function behaves the same way as devm_v4l2_sensor_clk_get() except that
it extends the behaviour on ACPI platforms to all platforms.
The function also provides the ability to set the clock rate to a fixed frequency by setting fixed_rate to true and specifying the fixed frequency in clk_rate, or to use a default clock rate when the "clock-frequency" property is absent by setting fixed_rate to false and specifying the default frequency in clk_rate. Setting fixed_rate to true and clk_rate to 0 is an error.
This function is meant to support legacy behaviour in existing drivers only. It must not be used in any new driver.
Returns a pointer to a struct clk on success or an error pointer on failure.
struct v4l2_ioctl_ops #
describe operations for each V4L2 ioctl
Definition
;
Members
vidioc_querycap: pointer to the function that implements VIDIOC_QUERYCAP ioctlvidioc_enum_fmt_vid_cap: pointer to the function that implements VIDIOC_ENUM_FMT ioctl logic for video capture in single and multi plane modevidioc_enum_fmt_vid_overlay: pointer to the function that implements VIDIOC_ENUM_FMT ioctl logic for video overlayvidioc_enum_fmt_vid_out: pointer to the function that implements VIDIOC_ENUM_FMT ioctl logic for video output in single and multi plane modevidioc_enum_fmt_sdr_cap: pointer to the function that implements VIDIOC_ENUM_FMT ioctl logic for Software Defined Radio capturevidioc_enum_fmt_sdr_out: pointer to the function that implements VIDIOC_ENUM_FMT ioctl logic for Software Defined Radio outputvidioc_enum_fmt_meta_cap: pointer to the function that implements VIDIOC_ENUM_FMT ioctl logic for metadata capturevidioc_enum_fmt_meta_out: pointer to the function that implements VIDIOC_ENUM_FMT ioctl logic for metadata outputvidioc_g_fmt_vid_cap: pointer to the function that implements VIDIOC_G_FMT ioctl logic for video capture in single plane modevidioc_g_fmt_vid_overlay: pointer to the function that implements VIDIOC_G_FMT ioctl logic for video overlayvidioc_g_fmt_vid_out: pointer to the function that implements VIDIOC_G_FMT ioctl logic for video out in single plane modevidioc_g_fmt_vid_out_overlay: pointer to the function that implements VIDIOC_G_FMT ioctl logic for video overlay outputvidioc_g_fmt_vbi_cap: pointer to the function that implements VIDIOC_G_FMT ioctl logic for raw VBI capturevidioc_g_fmt_vbi_out: pointer to the function that implements VIDIOC_G_FMT ioctl logic for raw VBI outputvidioc_g_fmt_sliced_vbi_cap: pointer to the function that implements VIDIOC_G_FMT ioctl logic for sliced VBI capturevidioc_g_fmt_sliced_vbi_out: pointer to the function that implements VIDIOC_G_FMT ioctl logic for sliced VBI outputvidioc_g_fmt_vid_cap_mplane: pointer to the function that implements VIDIOC_G_FMT ioctl logic for video capture in multiple plane modevidioc_g_fmt_vid_out_mplane: pointer to the function that implements VIDIOC_G_FMT ioctl logic for video out in multiplane plane modevidioc_g_fmt_sdr_cap: pointer to the function that implements VIDIOC_G_FMT ioctl logic for Software Defined Radio capturevidioc_g_fmt_sdr_out: pointer to the function that implements VIDIOC_G_FMT ioctl logic for Software Defined Radio outputvidioc_g_fmt_meta_cap: pointer to the function that implements VIDIOC_G_FMT ioctl logic for metadata capturevidioc_g_fmt_meta_out: pointer to the function that implements VIDIOC_G_FMT ioctl logic for metadata outputvidioc_s_fmt_vid_cap: pointer to the function that implements VIDIOC_S_FMT ioctl logic for video capture in single plane modevidioc_s_fmt_vid_overlay: pointer to the function that implements VIDIOC_S_FMT ioctl logic for video overlayvidioc_s_fmt_vid_out: pointer to the function that implements VIDIOC_S_FMT ioctl logic for video out in single plane modevidioc_s_fmt_vid_out_overlay: pointer to the function that implements VIDIOC_S_FMT ioctl logic for video overlay outputvidioc_s_fmt_vbi_cap: pointer to the function that implements VIDIOC_S_FMT ioctl logic for raw VBI capturevidioc_s_fmt_vbi_out: pointer to the function that implements VIDIOC_S_FMT ioctl logic for raw VBI outputvidioc_s_fmt_sliced_vbi_cap: pointer to the function that implements VIDIOC_S_FMT ioctl logic for sliced VBI capturevidioc_s_fmt_sliced_vbi_out: pointer to the function that implements VIDIOC_S_FMT ioctl logic for sliced VBI outputvidioc_s_fmt_vid_cap_mplane: pointer to the function that implements VIDIOC_S_FMT ioctl logic for video capture in multiple plane modevidioc_s_fmt_vid_out_mplane: pointer to the function that implements VIDIOC_S_FMT ioctl logic for video out in multiplane plane modevidioc_s_fmt_sdr_cap: pointer to the function that implements VIDIOC_S_FMT ioctl logic for Software Defined Radio capturevidioc_s_fmt_sdr_out: pointer to the function that implements VIDIOC_S_FMT ioctl logic for Software Defined Radio outputvidioc_s_fmt_meta_cap: pointer to the function that implements VIDIOC_S_FMT ioctl logic for metadata capturevidioc_s_fmt_meta_out: pointer to the function that implements VIDIOC_S_FMT ioctl logic for metadata outputvidioc_try_fmt_vid_cap: pointer to the function that implements VIDIOC_TRY_FMT ioctl logic for video capture in single plane modevidioc_try_fmt_vid_overlay: pointer to the function that implements VIDIOC_TRY_FMT ioctl logic for video overlayvidioc_try_fmt_vid_out: pointer to the function that implements VIDIOC_TRY_FMT ioctl logic for video out in single plane modevidioc_try_fmt_vid_out_overlay: pointer to the function that implements VIDIOC_TRY_FMT ioctl logic for video overlay outputvidioc_try_fmt_vbi_cap: pointer to the function that implements VIDIOC_TRY_FMT ioctl logic for raw VBI capturevidioc_try_fmt_vbi_out: pointer to the function that implements VIDIOC_TRY_FMT ioctl logic for raw VBI outputvidioc_try_fmt_sliced_vbi_cap: pointer to the function that implements VIDIOC_TRY_FMT ioctl logic for sliced VBI capturevidioc_try_fmt_sliced_vbi_out: pointer to the function that implements VIDIOC_TRY_FMT ioctl logic for sliced VBI outputvidioc_try_fmt_vid_cap_mplane: pointer to the function that implements VIDIOC_TRY_FMT ioctl logic for video capture in multiple plane modevidioc_try_fmt_vid_out_mplane: pointer to the function that implements VIDIOC_TRY_FMT ioctl logic for video out in multiplane plane modevidioc_try_fmt_sdr_cap: pointer to the function that implements VIDIOC_TRY_FMT ioctl logic for Software Defined Radio capturevidioc_try_fmt_sdr_out: pointer to the function that implements VIDIOC_TRY_FMT ioctl logic for Software Defined Radio outputvidioc_try_fmt_meta_cap: pointer to the function that implements VIDIOC_TRY_FMT ioctl logic for metadata capturevidioc_try_fmt_meta_out: pointer to the function that implements VIDIOC_TRY_FMT ioctl logic for metadata outputvidioc_reqbufs: pointer to the function that implements VIDIOC_REQBUFS ioctlvidioc_querybuf: pointer to the function that implements VIDIOC_QUERYBUF ioctlvidioc_qbuf: pointer to the function that implements VIDIOC_QBUF ioctlvidioc_expbuf: pointer to the function that implements VIDIOC_EXPBUF ioctlvidioc_dqbuf: pointer to the function that implements VIDIOC_DQBUF ioctlvidioc_create_bufs: pointer to the function that implements VIDIOC_CREATE_BUFS ioctlvidioc_prepare_buf: pointer to the function that implements VIDIOC_PREPARE_BUF ioctlvidioc_remove_bufs: pointer to the function that implements VIDIOC_REMOVE_BUFS ioctlvidioc_overlay: pointer to the function that implements VIDIOC_OVERLAY ioctlvidioc_g_fbuf: pointer to the function that implements VIDIOC_G_FBUF ioctlvidioc_s_fbuf: pointer to the function that implements VIDIOC_S_FBUF ioctlvidioc_streamon: pointer to the function that implements VIDIOC_STREAMON ioctlvidioc_streamoff: pointer to the function that implements VIDIOC_STREAMOFF ioctlvidioc_g_std: pointer to the function that implements VIDIOC_G_STD ioctlvidioc_s_std: pointer to the function that implements VIDIOC_S_STD ioctlvidioc_querystd: pointer to the function that implements VIDIOC_QUERYSTD ioctlvidioc_enum_input: pointer to the function that implements VIDIOC_ENUM_INPUT ioctlvidioc_g_input: pointer to the function that implements VIDIOC_G_INPUT ioctlvidioc_s_input: pointer to the function that implements VIDIOC_S_INPUT ioctlvidioc_enum_output: pointer to the function that implements VIDIOC_ENUM_OUTPUT ioctlvidioc_g_output: pointer to the function that implements VIDIOC_G_OUTPUT ioctlvidioc_s_output: pointer to the function that implements VIDIOC_S_OUTPUT ioctlvidioc_query_ext_ctrl: pointer to the function that implements VIDIOC_QUERY_EXT_CTRL ioctlvidioc_g_ext_ctrls: pointer to the function that implements VIDIOC_G_EXT_CTRLS ioctlvidioc_s_ext_ctrls: pointer to the function that implements VIDIOC_S_EXT_CTRLS ioctlvidioc_try_ext_ctrls: pointer to the function that implements VIDIOC_TRY_EXT_CTRLS ioctlvidioc_querymenu: pointer to the function that implements VIDIOC_QUERYMENU ioctlvidioc_enumaudio: pointer to the function that implements VIDIOC_ENUMAUDIO ioctlvidioc_g_audio: pointer to the function that implements VIDIOC_G_AUDIO ioctlvidioc_s_audio: pointer to the function that implements VIDIOC_S_AUDIO ioctlvidioc_enumaudout: pointer to the function that implements VIDIOC_ENUMAUDOUT ioctlvidioc_g_audout: pointer to the function that implements VIDIOC_G_AUDOUT ioctlvidioc_s_audout: pointer to the function that implements VIDIOC_S_AUDOUT ioctlvidioc_g_modulator: pointer to the function that implements VIDIOC_G_MODULATOR ioctlvidioc_s_modulator: pointer to the function that implements VIDIOC_S_MODULATOR ioctlvidioc_g_pixelaspect: pointer to the function that implements the pixelaspect part of the VIDIOC_CROPCAP ioctlvidioc_g_selection: pointer to the function that implements VIDIOC_G_SELECTION ioctlvidioc_s_selection: pointer to the function that implements VIDIOC_S_SELECTION ioctlvidioc_g_jpegcomp: pointer to the function that implements VIDIOC_G_JPEGCOMP ioctlvidioc_s_jpegcomp: pointer to the function that implements VIDIOC_S_JPEGCOMP ioctlvidioc_g_enc_index: pointer to the function that implements VIDIOC_G_ENC_INDEX ioctlvidioc_encoder_cmd: pointer to the function that implements VIDIOC_ENCODER_CMD ioctlvidioc_try_encoder_cmd: pointer to the function that implements VIDIOC_TRY_ENCODER_CMD ioctlvidioc_decoder_cmd: pointer to the function that implements VIDIOC_DECODER_CMD ioctlvidioc_try_decoder_cmd: pointer to the function that implements VIDIOC_TRY_DECODER_CMD ioctlvidioc_g_parm: pointer to the function that implements VIDIOC_G_PARM ioctlvidioc_s_parm: pointer to the function that implements VIDIOC_S_PARM ioctlvidioc_g_tuner: pointer to the function that implements VIDIOC_G_TUNER ioctlvidioc_s_tuner: pointer to the function that implements VIDIOC_S_TUNER ioctlvidioc_g_frequency: pointer to the function that implements VIDIOC_G_FREQUENCY ioctlvidioc_s_frequency: pointer to the function that implements VIDIOC_S_FREQUENCY ioctlvidioc_enum_freq_bands: pointer to the function that implements VIDIOC_ENUM_FREQ_BANDS ioctlvidioc_g_sliced_vbi_cap: pointer to the function that implements VIDIOC_G_SLICED_VBI_CAP ioctlvidioc_log_status: pointer to the function that implements VIDIOC_LOG_STATUS ioctlvidioc_s_hw_freq_seek: pointer to the function that implements VIDIOC_S_HW_FREQ_SEEK ioctlvidioc_g_register: pointer to the function that implements VIDIOC_DBG_G_REGISTER ioctlvidioc_s_register: pointer to the function that implements VIDIOC_DBG_S_REGISTER ioctlvidioc_g_chip_info: pointer to the function that implements VIDIOC_DBG_G_CHIP_INFO ioctlvidioc_enum_framesizes: pointer to the function that implements VIDIOC_ENUM_FRAMESIZES ioctlvidioc_enum_frameintervals: pointer to the function that implements VIDIOC_ENUM_FRAMEINTERVALS ioctlvidioc_s_dv_timings: pointer to the function that implements VIDIOC_S_DV_TIMINGS ioctlvidioc_g_dv_timings: pointer to the function that implements VIDIOC_G_DV_TIMINGS ioctlvidioc_query_dv_timings: pointer to the function that implements VIDIOC_QUERY_DV_TIMINGS ioctlvidioc_enum_dv_timings: pointer to the function that implements VIDIOC_ENUM_DV_TIMINGS ioctlvidioc_dv_timings_cap: pointer to the function that implements VIDIOC_DV_TIMINGS_CAP ioctlvidioc_g_edid: pointer to the function that implements VIDIOC_G_EDID ioctlvidioc_s_edid: pointer to the function that implements VIDIOC_S_EDID ioctlvidioc_subscribe_event: pointer to the function that implements VIDIOC_SUBSCRIBE_EVENT ioctlvidioc_unsubscribe_event: pointer to the function that implements VIDIOC_UNSUBSCRIBE_EVENT ioctlvidioc_default: pointed used to allow other ioctls
v4l2_norm_to_name() #
const char * Ancillary routine to analog TV standard name from its ID.
Parameters
v4l2_std_id id: analog TV standard ID.
Return
returns a string with the name of the analog TV standard. If the standard is not found or if id points to multiple standard, it returns "Unknown".
v4l2_video_std_frame_period() #
void Ancillary routine that fills a struct v4l2_fract pointer with the default framerate fraction.
Parameters
int id: analog TV standard ID.struct v4l2_fract *frameperiod: structv4l2_fractpointer to be filled
v4l2_video_std_construct() #
int Ancillary routine that fills in the fields of a v4l2_standard structure according to the id parameter.
Parameters
struct v4l2_standard *vs: structv4l2_standardpointer to be filledint id: analog TV standard ID.const char *name: name of the standard to be used
Description
v4l_video_std_enumstd() #
int Ancillary routine that fills in the fields of a v4l2_standard structure according to the id and vs->index parameters.
Parameters
struct v4l2_standard *vs: structv4l2_standardpointer to be filled.v4l2_std_id id: analog TV standard ID.
v4l_printk_ioctl() #
void Ancillary routine that prints the ioctl in a human-readable format.
Parameters
const char *prefix: prefix to be added at the ioctl prints.unsigned int cmd: ioctl name
Description
v4l2_field_names #
extern const char *v4l2_field_names;
Helper array mapping V4L2_FIELD_* to strings.
Initialization
default: v4l2_field_names
Description
Specially when printing debug messages, it is interesting to output the field order at the V4L2 buffers. This array associates all possible values of field pix format from V4L2 API into a string.
v4l2_type_names #
extern const char *v4l2_type_names;
Helper array mapping V4L2_BUF_TYPE_* to strings.
Initialization
default: v4l2_type_names
Description
When printing debug messages, it is interesting to output the V4L2 buffer type number with a name that represents its content.
v4l2_compat_ioctl32() #
long int 32 Bits compatibility layer for 64 bits processors
Parameters
struct file *file: Pointer to structfile.unsigned int cmd: Ioctl name.unsigned long arg: Ioctl argument.
v4l2_kioctl() #
typedef long
Typedef used to pass an ioctl handler.
Parameters
struct file *file: Pointer to structfile.unsigned int cmd: Ioctl name.void *arg: Ioctl argument.
video_usercopy() #
long int copies data from/to userspace memory when an ioctl is issued.
Parameters
struct file *file: Pointer to structfile.unsigned int cmd: Ioctl name.unsigned long int arg: Ioctl argument.v4l2_kioctl func: function that will handle the ioctl
Description
video_ioctl2() #
long int Handles a V4L2 ioctl.
Parameters
struct file *file: Pointer to structfile.unsigned int cmd: Ioctl name.unsigned long int arg: Ioctl argument.
Description
Method used to hancle an ioctl. Should be used to fill the
v4l2_ioctl_ops.unlocked_ioctl on all V4L2 drivers.