sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget5/translations/zh_CN/userspace-api/media/v4l/func-mmapmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/zh_TW/userspace-api/media/v4l/func-mmapmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/it_IT/userspace-api/media/v4l/func-mmapmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/ja_JP/userspace-api/media/v4l/func-mmapmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/ko_KR/userspace-api/media/v4l/func-mmapmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/sp_SP/userspace-api/media/v4l/func-mmapmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h8SPDX-License-Identifier: GFDL-1.1-no-invariants-or-laterh]h8SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhO/var/lib/git/docbuild/linux/Documentation/userspace-api/media/v4l/func-mmap.rsthKubhtarget)}(h.. _func-mmap:h]h}(h]h ]h"]h$]h&]refid func-mmapuh1hhKhhhhhhubhsection)}(hhh](htitle)}(h V4L2 mmap()h]h V4L2 mmap()}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hNameh]hName}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh paragraph)}(h #include h]h)#include #include }hjsbah}(h]h ]h"]h$]h&]hhforcelanguagechighlight_args}uh1jhhhKhjhhubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singleV4L.mmap (C function) c.V4L.mmaphNtauh1j&hjhhhNhNubhdesc)}(hhh](hdesc_signature)}(hSvoid *mmap( void *start, size_t length, int prot, int flags, int fd, off_t offset )h]hdesc_signature_line)}(hQvoid *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)h](hdesc_sig_keyword_type)}(hvoidh]hvoid}(hjJhhhNhNubah}(h]h ]ktah"]h$]h&]uh1jHhjDhhhhhKubhdesc_sig_space)}(h h]h }(hj[hhhNhNubah}(h]h ]wah"]h$]h&]uh1jYhjDhhhhhKubhdesc_sig_punctuation)}(h*h]h*}(hjlhhhNhNubah}(h]h ]pah"]h$]h&]uh1jjhjDhhhhhKubh desc_name)}(hmmaph]h desc_sig_name)}(hmmaph]hmmap}(hjhhhNhNubah}(h]h ]nah"]h$]h&]uh1jhj}ubah}(h]h ](sig-namedescnameeh"]h$]h&]hhuh1j{hjDhhhhhKubhdesc_parameterlist)}(hG(void *start, size_t length, int prot, int flags, int fd, off_t offset)h](hdesc_parameter)}(h void *starth](jI)}(hvoidh]hvoid}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjubjZ)}(h h]h }(hjhhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhjubjk)}(hjnh]h*}(hjhhhNhNubah}(h]h ]jwah"]h$]h&]uh1jjhjubj)}(hstarth]hstart}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubj)}(h size_t lengthh](h)}(hhh]j)}(hsize_th]hsize_t}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainj#reftype identifier reftargetjmodnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data](j ASTIdentifier)}jV4LsbNj)}jjsb c.V4L.mmapesbuh1hhjubjZ)}(h h]h }(hjhhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhjubj)}(hlengthh]hlength}(hj%hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubj)}(hint proth](jI)}(hinth]hint}(hj>hhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhj:ubjZ)}(h h]h }(hjLhhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhj:ubj)}(hproth]hprot}(hjZhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubj)}(h int flagsh](jI)}(hinth]hint}(hjshhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjoubjZ)}(h h]h }(hjhhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhjoubj)}(hflagsh]hflags}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjoubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubj)}(hint fdh](jI)}(hinth]hint}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjubjZ)}(h h]h }(hjhhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhjubj)}(hfdh]hfd}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubj)}(h off_t offseth](h)}(hhh]j)}(hoff_th]hoff_t}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainj#reftypej reftargetjmodnameN classnameNjj)}j ](jNj c.V4L.mmapesbuh1hhjubjZ)}(h h]h }(hjhhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhjubj)}(hoffseth]hoffset}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubeh}(h]h ]h"]h$]h&]hhuh1jhjDhhhhhKubeh}(h]h ]h"]h$]h&]hh add_permalinkuh1jBsphinx_line_type declaratorhj>hhhhhKubah}(h]j5ah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1j<hhhKhj9hhubh desc_content)}(hhh]h}(h]h ]h"]h$]h&]uh1j<hj9hhhhhKubeh}(h]h ](j#functioneh"]h$]h&]domainj#objtypejJdesctypejJnoindex noindexentrynocontentsentryuh1j7hhhjhNhNubeh}(h]synopsisah ]h"]synopsisah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Argumentsh]h Arguments}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj\hhhhhKubhdefinition_list)}(hhh](hdefinition_list_item)}(hX?``start`` Map the buffer to this address in the application's address space. When the ``MAP_FIXED`` flag is specified, ``start`` must be a multiple of the pagesize and mmap will fail when the specified address cannot be used. Use of this option is discouraged; applications should just specify a ``NULL`` pointer here. h](hterm)}(h ``start``h]hliteral)}(hj|h]hstart}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjzubah}(h]h ]h"]h$]h&]uh1jxhhhK!hjtubh definition)}(hhh]h)}(hX4Map the buffer to this address in the application's address space. When the ``MAP_FIXED`` flag is specified, ``start`` must be a multiple of the pagesize and mmap will fail when the specified address cannot be used. Use of this option is discouraged; applications should just specify a ``NULL`` pointer here.h](hNMap the buffer to this address in the application’s address space. When the }(hjhhhNhNubj)}(h ``MAP_FIXED``h]h MAP_FIXED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh flag is specified, }(hjhhhNhNubj)}(h ``start``h]hstart}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh must be a multiple of the pagesize and mmap will fail when the specified address cannot be used. Use of this option is discouraged; applications should just specify a }(hjhhhNhNubj)}(h``NULL``h]hNULL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh pointer here.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjtubeh}(h]h ]h"]h$]h&]uh1jrhhhK!hjoubjs)}(hX.``length`` Length of the memory area to map. This must be the same value as returned by the driver in the struct :c:type:`v4l2_buffer` ``length`` field for the single-planar API, and the same value as returned by the driver in the struct :c:type:`v4l2_plane` ``length`` field for the multi-planar API. h](jy)}(h ``length``h]j)}(hjh]hlength}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubah}(h]h ]h"]h$]h&]uh1jxhhhK)hjubj)}(hhh]h)}(hX"Length of the memory area to map. This must be the same value as returned by the driver in the struct :c:type:`v4l2_buffer` ``length`` field for the single-planar API, and the same value as returned by the driver in the struct :c:type:`v4l2_plane` ``length`` field for the multi-planar API.h](hfLength of the memory area to map. This must be the same value as returned by the driver in the struct }(hjhhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hjh]h v4l2_buffer}(hjhhhNhNubah}(h]h ](xrefj#c-typeeh"]h$]h&]uh1j~hjubah}(h]h ]h"]h$]h&]refdoc!userspace-api/media/v4l/func-mmap refdomainj#reftypetype refexplicitrefwarnjj)}j ]jNasb reftarget v4l2_bufferuh1hhhhK$hjubh }(hjhhhNhNubj)}(h ``length``h]hlength}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh] field for the single-planar API, and the same value as returned by the driver in the struct }(hjhhhNhNubh)}(h:c:type:`v4l2_plane`h]j)}(hjLh]h v4l2_plane}(hjNhhhNhNubah}(h]h ](jj#c-typeeh"]h$]h&]uh1j~hjJubah}(h]h ]h"]h$]h&]refdocj( refdomainj#reftypetype refexplicitrefwarnjj.j2 v4l2_planeuh1hhhhK$hjubh }hjsbj)}(h ``length``h]hlength}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh field for the multi-planar API.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK$hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jrhhhK)hjohhubjs)}(hXH``prot`` The ``prot`` argument describes the desired memory protection. Regardless of the device type and the direction of data exchange it should be set to ``PROT_READ`` | ``PROT_WRITE``, permitting read and write access to image buffers. Drivers should support at least this combination of flags. .. note:: #. The Linux ``videobuf`` kernel module, which is used by some drivers supports only ``PROT_READ`` | ``PROT_WRITE``. When the driver does not support the desired protection, the :c:func:`mmap()` function fails. #. Device memory accesses (e. g. the memory on a graphics card with video capturing hardware) may incur a performance penalty compared to main memory accesses, or reads may be significantly slower than writes or vice versa. Other I/O methods may be more efficient in such case. h](jy)}(h``prot``h]j)}(hjh]hprot}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubah}(h]h ]h"]h$]h&]uh1jxhhhK=hjubj)}(hhh](h)}(hX!The ``prot`` argument describes the desired memory protection. Regardless of the device type and the direction of data exchange it should be set to ``PROT_READ`` | ``PROT_WRITE``, permitting read and write access to image buffers. Drivers should support at least this combination of flags.h](hThe }(hjhhhNhNubj)}(h``prot``h]hprot}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh argument describes the desired memory protection. Regardless of the device type and the direction of data exchange it should be set to }(hjhhhNhNubj)}(h ``PROT_READ``h]h PROT_READ}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh | }(hjhhhNhNubj)}(h``PROT_WRITE``h]h PROT_WRITE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubho, permitting read and write access to image buffers. Drivers should support at least this combination of flags.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK,hjubhnote)}(hX#. The Linux ``videobuf`` kernel module, which is used by some drivers supports only ``PROT_READ`` | ``PROT_WRITE``. When the driver does not support the desired protection, the :c:func:`mmap()` function fails. #. Device memory accesses (e. g. the memory on a graphics card with video capturing hardware) may incur a performance penalty compared to main memory accesses, or reads may be significantly slower than writes or vice versa. Other I/O methods may be more efficient in such case.h]henumerated_list)}(hhh](h list_item)}(hThe Linux ``videobuf`` kernel module, which is used by some drivers supports only ``PROT_READ`` | ``PROT_WRITE``. When the driver does not support the desired protection, the :c:func:`mmap()` function fails. h]h)}(hThe Linux ``videobuf`` kernel module, which is used by some drivers supports only ``PROT_READ`` | ``PROT_WRITE``. When the driver does not support the desired protection, the :c:func:`mmap()` function fails.h](h The Linux }(hjhhhNhNubj)}(h ``videobuf``h]hvideobuf}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh< kernel module, which is used by some drivers supports only }(hjhhhNhNubj)}(h ``PROT_READ``h]h PROT_READ}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh | }(hjhhhNhNubj)}(h``PROT_WRITE``h]h PROT_WRITE}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh?. When the driver does not support the desired protection, the }(hjhhhNhNubh)}(h:c:func:`mmap()`h]j)}(hjDh]hmmap()}(hjFhhhNhNubah}(h]h ](jj#c-funceh"]h$]h&]uh1j~hjBubah}(h]h ]h"]h$]h&]refdocj( refdomainj#reftypefunc refexplicitrefwarnjj.j2mmapuh1hhhhK4hjubh function fails.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK4hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hXDevice memory accesses (e. g. the memory on a graphics card with video capturing hardware) may incur a performance penalty compared to main memory accesses, or reads may be significantly slower than writes or vice versa. Other I/O methods may be more efficient in such case.h]h)}(hXDevice memory accesses (e. g. the memory on a graphics card with video capturing hardware) may incur a performance penalty compared to main memory accesses, or reads may be significantly slower than writes or vice versa. Other I/O methods may be more efficient in such case.h]hXDevice memory accesses (e. g. the memory on a graphics card with video capturing hardware) may incur a performance penalty compared to main memory accesses, or reads may be significantly slower than writes or vice versa. Other I/O methods may be more efficient in such case.}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK9hjqubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jrhhhK=hjohhubjs)}(hX``flags`` The ``flags`` parameter specifies the type of the mapped object, mapping options and whether modifications made to the mapped copy of the page are private to the process or are to be shared with other references. ``MAP_FIXED`` requests that the driver selects no other address than the one specified. If the specified address cannot be used, :c:func:`mmap()` will fail. If ``MAP_FIXED`` is specified, ``start`` must be a multiple of the pagesize. Use of this option is discouraged. One of the ``MAP_SHARED`` or ``MAP_PRIVATE`` flags must be set. ``MAP_SHARED`` allows applications to share the mapped memory with other (e. g. child-) processes. .. note:: The Linux ``videobuf`` module which is used by some drivers supports only ``MAP_SHARED``. ``MAP_PRIVATE`` requests copy-on-write semantics. V4L2 applications should not set the ``MAP_PRIVATE``, ``MAP_DENYWRITE``, ``MAP_EXECUTABLE`` or ``MAP_ANON`` flags. h](jy)}(h ``flags``h]j)}(hjh]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubah}(h]h ]h"]h$]h&]uh1jxhhhKUhjubj)}(hhh](h)}(hThe ``flags`` parameter specifies the type of the mapped object, mapping options and whether modifications made to the mapped copy of the page are private to the process or are to be shared with other references.h](hThe }(hjhhhNhNubj)}(h ``flags``h]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh parameter specifies the type of the mapped object, mapping options and whether modifications made to the mapped copy of the page are private to the process or are to be shared with other references.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK@hjubh)}(hX ``MAP_FIXED`` requests that the driver selects no other address than the one specified. If the specified address cannot be used, :c:func:`mmap()` will fail. If ``MAP_FIXED`` is specified, ``start`` must be a multiple of the pagesize. Use of this option is discouraged.h](j)}(h ``MAP_FIXED``h]h MAP_FIXED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubht requests that the driver selects no other address than the one specified. If the specified address cannot be used, }(hjhhhNhNubh)}(h:c:func:`mmap()`h]j)}(hjh]hmmap()}(hjhhhNhNubah}(h]h ](jj#c-funceh"]h$]h&]uh1j~hjubah}(h]h ]h"]h$]h&]refdocj( refdomainj#reftypefunc refexplicitrefwarnjj.j2mmapuh1hhhhKEhjubh will fail. If }(hjhhhNhNubj)}(h ``MAP_FIXED``h]h MAP_FIXED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh is specified, }(hjhhhNhNubj)}(h ``start``h]hstart}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubhG must be a multiple of the pagesize. Use of this option is discouraged.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKEhjubh)}(hOne of the ``MAP_SHARED`` or ``MAP_PRIVATE`` flags must be set. ``MAP_SHARED`` allows applications to share the mapped memory with other (e. g. child-) processes.h](h One of the }(hjGhhhNhNubj)}(h``MAP_SHARED``h]h MAP_SHARED}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjGubh or }(hjGhhhNhNubj)}(h``MAP_PRIVATE``h]h MAP_PRIVATE}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjGubh flags must be set. }(hjGhhhNhNubj)}(h``MAP_SHARED``h]h MAP_SHARED}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjGubhT allows applications to share the mapped memory with other (e. g. child-) processes.}(hjGhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKKhjubj)}(hThe Linux ``videobuf`` module which is used by some drivers supports only ``MAP_SHARED``. ``MAP_PRIVATE`` requests copy-on-write semantics. V4L2 applications should not set the ``MAP_PRIVATE``, ``MAP_DENYWRITE``, ``MAP_EXECUTABLE`` or ``MAP_ANON`` flags.h]h)}(hThe Linux ``videobuf`` module which is used by some drivers supports only ``MAP_SHARED``. ``MAP_PRIVATE`` requests copy-on-write semantics. V4L2 applications should not set the ``MAP_PRIVATE``, ``MAP_DENYWRITE``, ``MAP_EXECUTABLE`` or ``MAP_ANON`` flags.h](h The Linux }(hjhhhNhNubj)}(h ``videobuf``h]hvideobuf}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh5 module which is used by some drivers supports only }(hjhhhNhNubj)}(h``MAP_SHARED``h]h MAP_SHARED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh. }(hjhhhNhNubj)}(h``MAP_PRIVATE``h]h MAP_PRIVATE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubhH requests copy-on-write semantics. V4L2 applications should not set the }(hjhhhNhNubj)}(h``MAP_PRIVATE``h]h MAP_PRIVATE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh, }(hjhhhNhNubj)}(h``MAP_DENYWRITE``h]h MAP_DENYWRITE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh, }hjsbj)}(h``MAP_EXECUTABLE``h]hMAP_EXECUTABLE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh or }(hjhhhNhNubj)}(h ``MAP_ANON``h]hMAP_ANON}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh flags.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKQhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jrhhhKUhjohhubjs)}(h5``fd`` File descriptor returned by :c:func:`open()`. h](jy)}(h``fd``h]j)}(hj3h]hfd}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hj1ubah}(h]h ]h"]h$]h&]uh1jxhhhKXhj-ubj)}(hhh]h)}(h-File descriptor returned by :c:func:`open()`.h](hFile descriptor returned by }(hjKhhhNhNubh)}(h:c:func:`open()`h]j)}(hjUh]hopen()}(hjWhhhNhNubah}(h]h ](jj#c-funceh"]h$]h&]uh1j~hjSubah}(h]h ]h"]h$]h&]refdocj( refdomainj#reftypefunc refexplicitrefwarnjj.j2openuh1hhhhKXhjKubh.}(hjKhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKXhjHubah}(h]h ]h"]h$]h&]uh1jhj-ubeh}(h]h ]h"]h$]h&]uh1jrhhhKXhjohhubjs)}(hXO``offset`` Offset of the buffer in device memory. This must be the same value as returned by the driver in the struct :c:type:`v4l2_buffer` ``m`` union ``offset`` field for the single-planar API, and the same value as returned by the driver in the struct :c:type:`v4l2_plane` ``m`` union ``mem_offset`` field for the multi-planar API. h](jy)}(h ``offset``h]j)}(hjh]hoffset}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubah}(h]h ]h"]h$]h&]uh1jxhhhK`hjubj)}(hhh]h)}(hXCOffset of the buffer in device memory. This must be the same value as returned by the driver in the struct :c:type:`v4l2_buffer` ``m`` union ``offset`` field for the single-planar API, and the same value as returned by the driver in the struct :c:type:`v4l2_plane` ``m`` union ``mem_offset`` field for the multi-planar API.h](hkOffset of the buffer in device memory. This must be the same value as returned by the driver in the struct }(hjhhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hjh]h v4l2_buffer}(hjhhhNhNubah}(h]h ](jj#c-typeeh"]h$]h&]uh1j~hjubah}(h]h ]h"]h$]h&]refdocj( refdomainj#reftypetype refexplicitrefwarnjj.j2 v4l2_bufferuh1hhhhK[hjubh }(hjhhhNhNubj)}(h``m``h]hm}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh union }(hjhhhNhNubj)}(h ``offset``h]hoffset}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh] field for the single-planar API, and the same value as returned by the driver in the struct }(hjhhhNhNubh)}(h:c:type:`v4l2_plane`h]j)}(hjh]h v4l2_plane}(hjhhhNhNubah}(h]h ](jj#c-typeeh"]h$]h&]uh1j~hjubah}(h]h ]h"]h$]h&]refdocj( refdomainj#reftypetype refexplicitrefwarnjj.j2 v4l2_planeuh1hhhhK[hjubh }hjsbj)}(h``m``h]hm}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh union }(hjhhhNhNubj)}(h``mem_offset``h]h mem_offset}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjubh field for the multi-planar API.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK[hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jrhhhK`hjohhubeh}(h]h ]h"]h$]h&]uh1jmhj\hhhhhNubeh}(h] argumentsah ]h"] argumentsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Descriptionh]h Description}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj\hhhhhKcubh)}(hX The :c:func:`mmap()` function asks to map ``length`` bytes starting at ``offset`` in the memory of the device specified by ``fd`` into the application address space, preferably at address ``start``. This latter address is a hint only, and is usually specified as 0.h](hThe }(hjmhhhNhNubh)}(h:c:func:`mmap()`h]j)}(hjwh]hmmap()}(hjyhhhNhNubah}(h]h ](jj#c-funceh"]h$]h&]uh1j~hjuubah}(h]h ]h"]h$]h&]refdocj( refdomainj#reftypefunc refexplicitrefwarnjj.j2mmapuh1hhhhKehjmubh function asks to map }(hjmhhhNhNubj)}(h ``length``h]hlength}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjmubh bytes starting at }(hjmhhhNhNubj)}(h ``offset``h]hoffset}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjmubh* in the memory of the device specified by }(hjmhhhNhNubj)}(h``fd``h]hfd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjmubh; into the application address space, preferably at address }(hjmhhhNhNubj)}(h ``start``h]hstart}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjmubhD. This latter address is a hint only, and is usually specified as 0.}(hjmhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKehj\hhubh)}(hSuitable length and offset parameters are queried with the :ref:`VIDIOC_QUERYBUF` ioctl. Buffers must be allocated with the :ref:`VIDIOC_REQBUFS` ioctl before they can be queried.h](h;Suitable length and offset parameters are queried with the }(hjhhhNhNubh)}(h:ref:`VIDIOC_QUERYBUF`h]hinline)}(hjh]hVIDIOC_QUERYBUF}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj( refdomainjreftyperef refexplicitrefwarnj2vidioc_querybufuh1hhhhKjhjubh+ ioctl. Buffers must be allocated with the }(hjhhhNhNubh)}(h:ref:`VIDIOC_REQBUFS`h]j)}(hj h]hVIDIOC_REQBUFS}(hj hhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj( refdomainj" reftyperef refexplicitrefwarnj2vidioc_reqbufsuh1hhhhKjhjubh" ioctl before they can be queried.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKjhj\hhubh)}(h9To unmap buffers the :c:func:`munmap()` function is used.h](hTo unmap buffers the }(hj> hhhNhNubh)}(h:c:func:`munmap()`h]j)}(hjH h]hmunmap()}(hjJ hhhNhNubah}(h]h ](jj#c-funceh"]h$]h&]uh1j~hjF ubah}(h]h ]h"]h$]h&]refdocj( refdomainj#reftypefunc refexplicitrefwarnjj.j2munmapuh1hhhhKohj> ubh function is used.}(hj> hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKohj\hhubeh}(h] descriptionah ]h"] descriptionah$]h&]uh1hhhhhhhhKcubh)}(hhh](h)}(h Return Valueh]h Return Value}(hjz hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjw hhhhhKrubh)}(hOn success :c:func:`mmap()` returns a pointer to the mapped buffer. On error ``MAP_FAILED`` (-1) is returned, and the ``errno`` variable is set appropriately. Possible error codes are:h](h On success }(hj hhhNhNubh)}(h:c:func:`mmap()`h]j)}(hj h]hmmap()}(hj hhhNhNubah}(h]h ](jj#c-funceh"]h$]h&]uh1j~hj ubah}(h]h ]h"]h$]h&]refdocj( refdomainj#reftypefunc refexplicitrefwarnjj.j2mmapuh1hhhhKthj ubh2 returns a pointer to the mapped buffer. On error }(hj hhhNhNubj)}(h``MAP_FAILED``h]h MAP_FAILED}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hj ubh (-1) is returned, and the }(hj hhhNhNubj)}(h ``errno``h]herrno}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hj ubh9 variable is set appropriately. Possible error codes are:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKthjw hhubjn)}(hhh](js)}(h-EBADF ``fd`` is not a valid file descriptor. h](jy)}(hEBADFh]hEBADF}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jxhhhKyhj ubj)}(hhh]h)}(h&``fd`` is not a valid file descriptor.h](j)}(h``fd``h]hfd}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hj ubh is not a valid file descriptor.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKyhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jrhhhKyhj ubjs)}(h3EACCES ``fd`` is not open for reading and writing. h](jy)}(hEACCESh]hEACCES}(hj! hhhNhNubah}(h]h ]h"]h$]h&]uh1jxhhhK|hj ubj)}(hhh]h)}(h+``fd`` is not open for reading and writing.h](j)}(h``fd``h]hfd}(hj6 hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hj2 ubh% is not open for reading and writing.}(hj2 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK|hj/ ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jrhhhK|hj hhubjs)}(hXEINVAL The ``start`` or ``length`` or ``offset`` are not suitable. (E. g. they are too large, or not aligned on a ``PAGESIZE`` boundary.) The ``flags`` or ``prot`` value is not supported. No buffers have been allocated with the :ref:`VIDIOC_REQBUFS` ioctl. h](jy)}(hEINVALh]hEINVAL}(hj^ hhhNhNubah}(h]h ]h"]h$]h&]uh1jxhhhKhjZ ubj)}(hhh](h)}(hThe ``start`` or ``length`` or ``offset`` are not suitable. (E. g. they are too large, or not aligned on a ``PAGESIZE`` boundary.)h](hThe }(hjo hhhNhNubj)}(h ``start``h]hstart}(hjw hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjo ubh or }(hjo hhhNhNubj)}(h ``length``h]hlength}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjo ubh or }hjo sbj)}(h ``offset``h]hoffset}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjo ubhB are not suitable. (E. g. they are too large, or not aligned on a }(hjo hhhNhNubj)}(h ``PAGESIZE``h]hPAGESIZE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hjo ubh boundary.)}(hjo hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjl ubh)}(h1The ``flags`` or ``prot`` value is not supported.h](hThe }(hj hhhNhNubj)}(h ``flags``h]hflags}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hj ubh or }(hj hhhNhNubj)}(h``prot``h]hprot}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j~hj ubh value is not supported.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjl ubh)}(hDNo buffers have been allocated with the :ref:`VIDIOC_REQBUFS` ioctl.h](h(No buffers have been allocated with the }(hj hhhNhNubh)}(h:ref:`VIDIOC_REQBUFS`h]j)}(hj h]hVIDIOC_REQBUFS}(hj hhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj( refdomainj reftyperef refexplicitrefwarnj2vidioc_reqbufsuh1hhhhKhj ubh ioctl.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjl ubeh}(h]h ]h"]h$]h&]uh1jhjZ ubeh}(h]h ]h"]h$]h&]uh1jrhhhKhj hhubjs)}(hSENOMEM Not enough physical or virtual memory was available to complete the request.h](jy)}(hENOMEMh]hENOMEM}(hj9 hhhNhNubah}(h]h ]h"]h$]h&]uh1jxhhhKhj5 ubj)}(hhh]h)}(hLNot enough physical or virtual memory was available to complete the request.h]hLNot enough physical or virtual memory was available to complete the request.}(hjJ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjG ubah}(h]h ]h"]h$]h&]uh1jhj5 ubeh}(h]h ]h"]h$]h&]uh1jrhhhKhj hhubeh}(h]h ]h"]h$]h&]uh1jmhjw hhhhhNubeh}(h] return-valueah ]h"] return valueah$]h&]uh1hhhhhhhhKrubeh}(h]( v4l2-mmapheh ]h"]( v4l2 mmap() func-mmapeh$]h&]uh1hhhhhhhhKexpect_referenced_by_name}jx hsexpect_referenced_by_id}hhsubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}h]hasnameids}(jx hjw jt hhjYjVjYjVjt jq jo jl u nametypes}(jx jw hjYjYjt jo uh}(hhjt hhhjVjj5j>jVj\jq j\jl jw u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages]hsystem_message)}(hhh]h)}(hhh]h/Hyperlink target "func-mmap" is not referenced.}hj sbah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1j uba transformerN include_log] decorationNhhub.