···116116Those functions operate just like glibc117117open/close/dup/ioctl/read/mmap/munmap:118118119119-- :c:type:`int v4l2_open(const char *file, int oflag, ...)` - operates like the120120- standard :ref:`open() <func-open>` function.119119+.. c:function:: int v4l2_open(const char *file, int oflag, ...)121120122122-- :c:type:`int v4l2_close(int fd)` - operates like the standard123123- :ref:`close() <func-close>` function.121121+ operates like the standard :ref:`open() <func-open>` function.124122125125-- :c:type:`int v4l2_dup(int fd)` - operates like the standard dup() function,126126- duplicating a file handler.123123+.. c:function:: int v4l2_close(int fd)127124128128-- :c:type:`int v4l2_ioctl (int fd, unsigned long int request, ...)` - operates129129- like the standard :ref:`ioctl() <func-ioctl>` function.125125+ operates like the standard :ref:`close() <func-close>` function.130126131131-- :c:type:`int v4l2_read (int fd, void* buffer, size_t n)` - operates like the132132- standard :ref:`read() <func-read>` function.127127+.. c:function:: int v4l2_dup(int fd)133128134134-- :c:type:`void v4l2_mmap(void *start, size_t length, int prot, int flags, int135135- fd, int64_t offset);` - operates like the standard136136- :ref:`mmap() <func-mmap>` function.129129+ operates like the standard dup() function, duplicating a file handler.137130138138-- :c:type:`int v4l2_munmap(void *_start, size_t length);` - operates like the139139- standard :ref:`munmap() <func-munmap>` function.131131+.. c:function:: int v4l2_ioctl (int fd, unsigned long int request, ...)132132+133133+ operates like the standard :ref:`ioctl() <func-ioctl>` function.134134+135135+.. c:function:: int v4l2_read (int fd, void* buffer, size_t n)136136+137137+ operates like the standard :ref:`read() <func-read>` function.138138+139139+.. c:function:: void v4l2_mmap(void *start, size_t length, int prot, int flags, int fd, int64_t offset);140140+141141+ operates like the standard :ref:`mmap() <func-mmap>` function.142142+143143+.. c:function:: int v4l2_munmap(void *_start, size_t length);144144+ operates like the standard :ref:`munmap() <func-munmap>` function.140145141146Those functions provide additional control:142147143143-- :c:type:`int v4l2_fd_open(int fd, int v4l2_flags)` - opens an already opened144144- fd for further use through v4l2lib and possibly modify libv4l2's145145- default behavior through the v4l2_flags argument. Currently,146146- v4l2_flags can be ``V4L2_DISABLE_CONVERSION``, to disable format147147- conversion.148148+.. c:function:: int v4l2_fd_open(int fd, int v4l2_flags)148149149149-- :c:type:`int v4l2_set_control(int fd, int cid, int value)` - This function150150- takes a value of 0 - 65535, and then scales that range to the actual151151- range of the given v4l control id, and then if the cid exists and is150150+ opens an already opened fd for further use through v4l2lib and possibly151151+ modify libv4l2's default behavior through the v4l2_flags argument.152152+ Currently, v4l2_flags can be ``V4L2_DISABLE_CONVERSION``, to disable153153+ format conversion.154154+155155+.. c:function:: int v4l2_set_control(int fd, int cid, int value)156156+157157+ This function takes a value of 0 - 65535, and then scales that range to the158158+ actual range of the given v4l control id, and then if the cid exists and is152159 not locked sets the cid to the scaled value.153160154154-- :c:type:`int v4l2_get_control(int fd, int cid)` - This function returns a155155- value of 0 - 65535, scaled to from the actual range of the given v4l156156- control id. when the cid does not exist, could not be accessed for157157- some reason, or some error occurred 0 is returned.161161+.. c:function:: int v4l2_get_control(int fd, int cid)162162+163163+ This function returns a value of 0 - 65535, scaled to from the actual range164164+ of the given v4l control id. when the cid does not exist, could not be165165+ accessed for some reason, or some error occurred 0 is returned.158166159167160168v4l1compat.so wrapper library