wsphinx.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]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/pt_BR/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 }hj'sbah}(h]h ]h"]h$]h&]hhƌforcelanguagechighlight_args}uh1j%hhhKhjhhubhindex)}(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}(hj^hhhNhNubah}(h]h ]ktah"]h$]h&]uh1j\hjXhhhhhKubhdesc_sig_space)}(h h]h }(hjohhhNhNubah}(h]h ]wah"]h$]h&]uh1jmhjXhhhhhKubhdesc_sig_punctuation)}(h*h]h*}(hjhhhNhNubah}(h]h ]pah"]h$]h&]uh1j~hjXhhhhhKubh desc_name)}(hmmaph]h desc_sig_name)}(hmmaph]hmmap}(hjhhhNhNubah}(h]h ]nah"]h$]h&]uh1jhjubah}(h]h ](sig-namedescnameeh"]h$]h&]hhuh1jhjXhhhhhKubhdesc_parameterlist)}(hG(void *start, size_t length, int prot, int flags, int fd, off_t offset)h](hdesc_parameter)}(h void *starth](j])}(hvoidh]hvoid}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjubjn)}(h h]h }(hjhhhNhNubah}(h]h ]jzah"]h$]h&]uh1jmhjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j~hjubj)}(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&] refdomainj7reftype identifier reftargetjmodnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data](j ASTIdentifier)}jV4LsbNj")}jjsb c.V4L.mmapesbuh1hhjubjn)}(h h]h }(hj+hhhNhNubah}(h]h ]jzah"]h$]h&]uh1jmhjubj)}(hlengthh]hlength}(hj9hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubj)}(hint proth](j])}(hinth]hint}(hjRhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjNubjn)}(h h]h }(hj`hhhNhNubah}(h]h ]jzah"]h$]h&]uh1jmhjNubj)}(hproth]hprot}(hjnhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjNubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubj)}(h int flagsh](j])}(hinth]hint}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjubjn)}(h h]h }(hjhhhNhNubah}(h]h ]jzah"]h$]h&]uh1jmhjubj)}(hflagsh]hflags}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubj)}(hint fdh](j])}(hinth]hint}(hjhhhNhNubah}(h]h ]jiah"]h$]h&]uh1j\hjubjn)}(h h]h }(hjhhhNhNubah}(h]h ]jzah"]h$]h&]uh1jmhjubj)}(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&] refdomainj7reftypej reftargetjmodnameN classnameNjj)}j](j#Nj' c.V4L.mmapesbuh1hhjubjn)}(h h]h }(hjhhhNhNubah}(h]h ]jzah"]h$]h&]uh1jmhjubj)}(hoffseth]hoffset}(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubeh}(h]h ]h"]h$]h&]hhuh1jhjXhhhhhKubeh}(h]h ]h"]h$]h&]hhƌ add_permalinkuh1jVsphinx_line_type declaratorhjRhhhhhKubah}(h]jIah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1jPhhhKhjMhhubh desc_content)}(hhh]h}(h]h ]h"]h$]h&]uh1jPhjMhhhhhKubeh}(h]h ](j7functioneh"]h$]h&]domainj7objtypej^desctypej^noindex noindexentrynocontentsentryuh1jKhhhjhNhNubeh}(h]synopsisah ]h"]synopsisah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Argumentsh]h Arguments}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjphhhhhKubhdefinition_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)}(hjh]hstart}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhK!hjubh 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&]uh1jhjubh flag is specified, }(hjhhhNhNubj)}(h ``start``h]hstart}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh 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&]uh1jhjubh pointer here.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK!hjubj)}(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](j)}(h ``length``h]j)}(hjh]hlength}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhK)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)}(hj$h]h v4l2_buffer}(hj&hhhNhNubah}(h]h ](xrefj7c-typeeh"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]refdoc!userspace-api/media/v4l/func-mmap refdomainj7reftypetype refexplicitrefwarnjj)}j]j#Nasb reftarget v4l2_bufferuh1hhhhK$hjubh }(hjhhhNhNubj)}(h ``length``h]hlength}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh] 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)}(hj`h]h v4l2_plane}(hjbhhhNhNubah}(h]h ](j0j7c-typeeh"]h$]h&]uh1jhj^ubah}(h]h ]h"]h$]h&]refdocj< refdomainj7reftypetype refexplicitrefwarnjjBjF v4l2_planeuh1hhhhK$hjubh }hjsbj)}(h ``length``h]hlength}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh 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&]uh1jhhhK)hjhhubj)}(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](j)}(h``prot``h]j)}(hjh]hprot}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhK=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&]uh1jhjubh 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&]uh1jhjubh | }(hjhhhNhNubj)}(h``PROT_WRITE``h]h PROT_WRITE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubho, 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&]uh1jhjubh< kernel module, which is used by some drivers supports only }(hjhhhNhNubj)}(h ``PROT_READ``h]h PROT_READ}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh | }(hjhhhNhNubj)}(h``PROT_WRITE``h]h PROT_WRITE}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh?. When the driver does not support the desired protection, the }(hjhhhNhNubh)}(h:c:func:`mmap()`h]j)}(hjXh]hmmap()}(hjZhhhNhNubah}(h]h ](j0j7c-funceh"]h$]h&]uh1jhjVubah}(h]h ]h"]h$]h&]refdocj< refdomainj7reftypefunc refexplicitrefwarnjjBjFmmapuh1hhhhK4hjubh 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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK9hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1j hj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK=hjhhubj)}(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](j)}(h ``flags``h]j)}(hjh]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKUhjubj)}(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&]uh1jhjubh 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&]uh1jhjubht 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 ](j0j7c-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj< refdomainj7reftypefunc refexplicitrefwarnjjBjFmmapuh1hhhhKEhjubh will fail. If }(hjhhhNhNubj)}(h ``MAP_FIXED``h]h MAP_FIXED}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh is specified, }(hjhhhNhNubj)}(h ``start``h]hstart}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhG 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 }(hj[hhhNhNubj)}(h``MAP_SHARED``h]h MAP_SHARED}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1jhj[ubh or }(hj[hhhNhNubj)}(h``MAP_PRIVATE``h]h MAP_PRIVATE}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj[ubh flags must be set. }(hj[hhhNhNubj)}(h``MAP_SHARED``h]h MAP_SHARED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj[ubhT allows applications to share the mapped memory with other (e. g. child-) processes.}(hj[hhhNhNubeh}(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&]uh1jhjubh5 module which is used by some drivers supports only }(hjhhhNhNubj)}(h``MAP_SHARED``h]h MAP_SHARED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh. }(hjhhhNhNubj)}(h``MAP_PRIVATE``h]h MAP_PRIVATE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhH 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&]uh1jhjubh, }(hjhhhNhNubj)}(h``MAP_DENYWRITE``h]h MAP_DENYWRITE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, }hjsbj)}(h``MAP_EXECUTABLE``h]hMAP_EXECUTABLE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh or }(hjhhhNhNubj)}(h ``MAP_ANON``h]hMAP_ANON}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh 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&]uh1jhhhKUhjhhubj)}(h5``fd`` File descriptor returned by :c:func:`open()`. h](j)}(h``fd``h]j)}(hjGh]hfd}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjEubah}(h]h ]h"]h$]h&]uh1jhhhKXhjAubj)}(hhh]h)}(h-File descriptor returned by :c:func:`open()`.h](hFile descriptor returned by }(hj_hhhNhNubh)}(h:c:func:`open()`h]j)}(hjih]hopen()}(hjkhhhNhNubah}(h]h ](j0j7c-funceh"]h$]h&]uh1jhjgubah}(h]h ]h"]h$]h&]refdocj< refdomainj7reftypefunc refexplicitrefwarnjjBjFopenuh1hhhhKXhj_ubh.}(hj_hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKXhj\ubah}(h]h ]h"]h$]h&]uh1jhjAubeh}(h]h ]h"]h$]h&]uh1jhhhKXhjhhubj)}(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](j)}(h ``offset``h]j)}(hjh]hoffset}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhK`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 ](j0j7c-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj< refdomainj7reftypetype refexplicitrefwarnjjBjF v4l2_bufferuh1hhhhK[hjubh }(hjhhhNhNubj)}(h``m``h]hm}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh union }(hjhhhNhNubj)}(h ``offset``h]hoffset}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh] 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)}(hj h]h v4l2_plane}(hj hhhNhNubah}(h]h ](j0j7c-typeeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj< refdomainj7reftypetype refexplicitrefwarnjjBjF v4l2_planeuh1hhhhK[hjubh }hjsbj)}(h``m``h]hm}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh union }(hjhhhNhNubj)}(h``mem_offset``h]h mem_offset}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh 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&]uh1jhhhK`hjhhubeh}(h]h ]h"]h$]h&]uh1jhjphhhhhNubeh}(h] argumentsah ]h"] argumentsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Descriptionh]h Description}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjphhhhhKcubh)}(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 }(hjhhhNhNubh)}(h:c:func:`mmap()`h]j)}(hjh]hmmap()}(hjhhhNhNubah}(h]h ](j0j7c-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj< refdomainj7reftypefunc refexplicitrefwarnjjBjFmmapuh1hhhhKehjubh function asks to map }(hjhhhNhNubj)}(h ``length``h]hlength}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh bytes starting at }(hjhhhNhNubj)}(h ``offset``h]hoffset}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh* in the memory of the device specified by }(hjhhhNhNubj)}(h``fd``h]hfd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh; into the application address space, preferably at address }(hjhhhNhNubj)}(h ``start``h]hstart}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhD. This latter address is a hint only, and is usually specified as 0.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKehjphhubh)}(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)}(hj h]hVIDIOC_QUERYBUF}(hj hhhNhNubah}(h]h ](j0stdstd-refeh"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]refdocj< refdomainj reftyperef refexplicitrefwarnjFvidioc_querybufuh1hhhhKjhjubh+ ioctl. Buffers must be allocated with the }(hjhhhNhNubh)}(h:ref:`VIDIOC_REQBUFS`h]j )}(hj* h]hVIDIOC_REQBUFS}(hj, hhhNhNubah}(h]h ](j0stdstd-refeh"]h$]h&]uh1j hj( ubah}(h]h ]h"]h$]h&]refdocj< refdomainj6 reftyperef refexplicitrefwarnjFvidioc_reqbufsuh1hhhhKjhjubh" ioctl before they can be queried.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKjhjphhubh)}(h9To unmap buffers the :c:func:`munmap()` function is used.h](hTo unmap buffers the }(hjR hhhNhNubh)}(h:c:func:`munmap()`h]j)}(hj\ h]hmunmap()}(hj^ hhhNhNubah}(h]h ](j0j7c-funceh"]h$]h&]uh1jhjZ ubah}(h]h ]h"]h$]h&]refdocj< refdomainj7reftypefunc refexplicitrefwarnjjBjFmunmapuh1hhhhKohjR ubh function is used.}(hjR hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKohjphhubeh}(h] descriptionah ]h"] descriptionah$]h&]uh1hhhhhhhhKcubh)}(hhh](h)}(h Return Valueh]h Return Value}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj 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 ](j0j7c-funceh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj< refdomainj7reftypefunc refexplicitrefwarnjjBjFmmapuh1hhhhKthj 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&]uh1jhj ubh (-1) is returned, and the }(hj hhhNhNubj)}(h ``errno``h]herrno}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh9 variable is set appropriately. Possible error codes are:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKthj hhubj)}(hhh](j)}(h-EBADF ``fd`` is not a valid file descriptor. h](j)}(hEBADFh]hEBADF}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKyhj ubj)}(hhh]h)}(h&``fd`` is not a valid file descriptor.h](j)}(h``fd``h]hfd}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj 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&]uh1jhhhKyhj ubj)}(h3EACCES ``fd`` is not open for reading and writing. h](j)}(hEACCESh]hEACCES}(hj5 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK|hj1 ubj)}(hhh]h)}(h+``fd`` is not open for reading and writing.h](j)}(h``fd``h]hfd}(hjJ hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjF ubh% is not open for reading and writing.}(hjF hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK|hjC ubah}(h]h ]h"]h$]h&]uh1jhj1 ubeh}(h]h ]h"]h$]h&]uh1jhhhK|hj hhubj)}(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](j)}(hEINVALh]hEINVAL}(hjr hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjn 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 }(hj hhhNhNubj)}(h ``start``h]hstart}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh or }(hj hhhNhNubj)}(h ``length``h]hlength}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh or }hj sbj)}(h ``offset``h]hoffset}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhB are not suitable. (E. g. they are too large, or not aligned on a }(hj hhhNhNubj)}(h ``PAGESIZE``h]hPAGESIZE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh boundary.)}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubh)}(h1The ``flags`` or ``prot`` value is not supported.h](hThe }(hj hhhNhNubj)}(h ``flags``h]hflags}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh or }(hj hhhNhNubj)}(h``prot``h]hprot}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh value is not supported.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj 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 ](j0stdstd-refeh"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]refdocj< refdomainj! reftyperef refexplicitrefwarnjFvidioc_reqbufsuh1hhhhKhj ubh ioctl.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubeh}(h]h ]h"]h$]h&]uh1jhjn ubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubj)}(hSENOMEM Not enough physical or virtual memory was available to complete the request.h](j)}(hENOMEMh]hENOMEM}(hjM hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjI 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.}(hj^ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj[ ubah}(h]h ]h"]h$]h&]uh1jhjI ubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubeh}(h]h ]h"]h$]h&]uh1jhj hhhhhNubeh}(h] return-valueah ]h"] return valueah$]h&]uh1hhhhhhhhKrubeh}(h]( v4l2-mmapheh ]h"]( v4l2 mmap() func-mmapeh$]h&]uh1hhhhhhhhKexpect_referenced_by_name}j 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_sourcehnj _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}(j hj j jjjmjjjmjjj j j j u nametypes}(j j jjmjmj j uh}(hhj hjhjjjjIjRjjjpj jpj j 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&]levelKtypeINFOsourcehnjlineKuh1j uba transformerN include_log] decorationNhhub.