Hsphinx.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-openmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/zh_TW/userspace-api/media/v4l/func-openmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/it_IT/userspace-api/media/v4l/func-openmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/ja_JP/userspace-api/media/v4l/func-openmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/ko_KR/userspace-api/media/v4l/func-openmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/sp_SP/userspace-api/media/v4l/func-openmodnameN 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-open.rsthKubhtarget)}(h.. _func-open:h]h}(h]h ]h"]h$]h&]refid func-openuh1hhKhhhhhhubhsection)}(hhh](htitle)}(h V4L2 open()h]h V4L2 open()}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hNameh]hName}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh paragraph)}(hv4l2-open - Open a V4L2 deviceh]hv4l2-open - Open a V4L2 device}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubeh}(h]nameah ]h"]nameah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hSynopsish]hSynopsis}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh literal_block)}(h#include h]h#include }hjsbah}(h]h ]h"]h$]h&]hhforcelanguagechighlight_args}uh1jhhhKhjhhubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singleV4L.open (C function) c.V4L.openhNtauh1j&hjhhhNhNubhdesc)}(hhh](hdesc_signature)}(h.int open( const char *device_name, int flags )h]hdesc_signature_line)}(h,int open(const char *device_name, int flags)h](hdesc_sig_keyword_type)}(hinth]hint}(hjJhhhNhNubah}(h]h ]ktah"]h$]h&]uh1jHhjDhhhhhKubhdesc_sig_space)}(h h]h }(hj[hhhNhNubah}(h]h ]wah"]h$]h&]uh1jYhjDhhhhhKubh desc_name)}(hopenh]h desc_sig_name)}(hopenh]hopen}(hjrhhhNhNubah}(h]h ]nah"]h$]h&]uh1jphjlubah}(h]h ](sig-namedescnameeh"]h$]h&]hhuh1jjhjDhhhhhKubhdesc_parameterlist)}(h$(const char *device_name, int flags)h](hdesc_parameter)}(hconst char *device_nameh](hdesc_sig_keyword)}(hconsth]hconst}(hjhhhNhNubah}(h]h ]kah"]h$]h&]uh1jhjubjZ)}(h h]h }(hjhhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhjubjI)}(hcharh]hchar}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjubjZ)}(h h]h }(hjhhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhjubhdesc_sig_punctuation)}(h*h]h*}(hjhhhNhNubah}(h]h ]pah"]h$]h&]uh1jhjubjq)}(h device_nameh]h device_name}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubj)}(h int flagsh](jI)}(hinth]hint}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjubjZ)}(h h]h }(hjhhhNhNubah}(h]h ]jfah"]h$]h&]uh1jYhjubjq)}(hflagsh]hflags}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jphjubeh}(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&]uh1jEhj9hhhhhKubeh}(h]h ](j#functioneh"]h$]h&]domainj#objtypejSdesctypejSnoindex noindexentrynocontentsentryuh1j7hhhjhNhNubeh}(h]synopsisah ]h"]synopsisah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Argumentsh]h Arguments}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjehhhhhKubhdefinition_list)}(hhh](hdefinition_list_item)}(h%``device_name`` Device to be opened. h](hterm)}(h``device_name``h]hliteral)}(hjh]h device_name}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhj}ubh definition)}(hhh]h)}(hDevice to be opened.h]hDevice to be opened.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhj}ubeh}(h]h ]h"]h$]h&]uh1j{hhhKhjxubj|)}(hX5``flags`` Open flags. Access mode must be ``O_RDWR``. This is just a technicality, input devices still support only reading and output devices only writing. When the ``O_NONBLOCK`` flag is given, the :c:func:`read()` function and the :ref:`VIDIOC_DQBUF ` ioctl will return the ``EAGAIN`` error code when no data is available or no buffer is in the driver outgoing queue, otherwise these functions block until data becomes available. All V4L2 drivers exchanging data with applications must support the ``O_NONBLOCK`` flag. Other flags have no effect. h](j)}(h ``flags``h]j)}(hjh]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhK*hjubj)}(hhh](h)}(hOpen flags. Access mode must be ``O_RDWR``. This is just a technicality, input devices still support only reading and output devices only writing.h](h Open flags. Access mode must be }(hjhhhNhNubj)}(h ``O_RDWR``h]hO_RDWR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhh. This is just a technicality, input devices still support only reading and output devices only writing.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hXyWhen the ``O_NONBLOCK`` flag is given, the :c:func:`read()` function and the :ref:`VIDIOC_DQBUF ` ioctl will return the ``EAGAIN`` error code when no data is available or no buffer is in the driver outgoing queue, otherwise these functions block until data becomes available. All V4L2 drivers exchanging data with applications must support the ``O_NONBLOCK`` flag.h](h When the }(hjhhhNhNubj)}(h``O_NONBLOCK``h]h O_NONBLOCK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flag is given, the }(hjhhhNhNubh)}(h:c:func:`read()`h]j)}(hjh]hread()}(hjhhhNhNubah}(h]h ](xrefj#c-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdoc!userspace-api/media/v4l/func-open refdomainj#reftypefunc refexplicitrefwarn c:parent_keysphinx.domains.c LookupKey)}data]j4 ASTIdentifier)} identifierV4LsbNasb reftargetreaduh1hhhhK#hjubh function and the }(hjhhhNhNubh)}(h!:ref:`VIDIOC_DQBUF `h]hinline)}(hjJh]h VIDIOC_DQBUF}(hjNhhhNhNubah}(h]h ](j!stdstd-refeh"]h$]h&]uh1jLhjHubah}(h]h ]h"]h$]h&]refdocj- refdomainjXreftyperef refexplicitrefwarnjB vidioc_qbufuh1hhhhK#hjubh ioctl will return the }(hjhhhNhNubj)}(h ``EAGAIN``h]hEAGAIN}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh error code when no data is available or no buffer is in the driver outgoing queue, otherwise these functions block until data becomes available. All V4L2 drivers exchanging data with applications must support the }(hjhhhNhNubj)}(h``O_NONBLOCK``h]h O_NONBLOCK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flag.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK#hjubh)}(hOther flags have no effect.h]hOther flags have no effect.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhK*hjxhhubeh}(h]h ]h"]h$]h&]uh1jvhjehhhhhNubeh}(h] argumentsah ]h"] argumentsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Descriptionh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK-ubh)}(hXnTo open a V4L2 device applications call :c:func:`open()` with the desired device name. This function has no side effects; all data format parameters, current input or output, control values or other properties remain unchanged. At the first :c:func:`open()` call after loading the driver they will be reset to default values, drivers are never in an undefined state.h](h(To open a V4L2 device applications call }(hjhhhNhNubh)}(h:c:func:`open()`h]j)}(hjh]hopen()}(hjhhhNhNubah}(h]h ](j!j#c-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj- refdomainj#reftypefunc refexplicitrefwarnj3j7jBopenuh1hhhhK/hjubh with the desired device name. This function has no side effects; all data format parameters, current input or output, control values or other properties remain unchanged. At the first }(hjhhhNhNubh)}(h:c:func:`open()`h]j)}(hjh]hopen()}(hjhhhNhNubah}(h]h ](j!j#c-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj- refdomainj#reftypefunc refexplicitrefwarnj3j7jBopenuh1hhhhK/hjubhm call after loading the driver they will be reset to default values, drivers are never in an undefined state.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK/hjhhubeh}(h] descriptionah ]h"] descriptionah$]h&]uh1hhhhhhhhK-ubh)}(hhh](h)}(h Return Valueh]h Return Value}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj-hhhhhK7ubh)}(hOn success :c:func:`open()` returns the new file descriptor. On error -1 is returned, and the ``errno`` variable is set appropriately. Possible error codes are:h](h On success }(hj>hhhNhNubh)}(h:c:func:`open()`h]j)}(hjHh]hopen()}(hjJhhhNhNubah}(h]h ](j!j#c-funceh"]h$]h&]uh1jhjFubah}(h]h ]h"]h$]h&]refdocj- refdomainj#reftypefunc refexplicitrefwarnj3j7jBopenuh1hhhhK9hj>ubhC returns the new file descriptor. On error -1 is returned, and the }(hj>hhhNhNubj)}(h ``errno``h]herrno}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1jhj>ubh9 variable is set appropriately. Possible error codes are:}(hj>hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK9hj-hhubjw)}(hhh](j|)}(h:EACCES The caller has no permission to access the device. h](j)}(hEACCESh]hEACCES}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK>hjubj)}(hhh]h)}(h2The caller has no permission to access the device.h]h2The caller has no permission to access the device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhK>hjubj|)}(hSEBUSY The driver does not support multiple opens and the device is already in use. h](j)}(hEBUSYh]hEBUSY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKBhjubj)}(hhh]h)}(hLThe driver does not support multiple opens and the device is already in use.h]hLThe driver does not support multiple opens and the device is already in use.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhKBhjhhubj|)}(h(ENODEV Device not found or was removed. h](j)}(hENODEVh]hENODEV}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKEhjubj)}(hhh]h)}(h Device not found or was removed.h]h Device not found or was removed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhKEhjhhubj|)}(hGENOMEM Not enough kernel memory was available to complete the request. h](j)}(hENOMEMh]hENOMEM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKHhjubj)}(hhh]h)}(h?Not enough kernel memory was available to complete the request.h]h?Not enough kernel memory was available to complete the request.}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKHhj#ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhKHhjhhubj|)}(hAEMFILE The process already has the maximum number of files open. h](j)}(hEMFILEh]hEMFILE}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKKhj@ubj)}(hhh]h)}(h9The process already has the maximum number of files open.h]h9The process already has the maximum number of files open.}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKKhjRubah}(h]h ]h"]h$]h&]uh1jhj@ubeh}(h]h ]h"]h$]h&]uh1j{hhhKKhjhhubj|)}(hRENFILE The limit on the total number of files open on the system has been reached.h](j)}(hENFILEh]hENFILE}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKNhjoubj)}(hhh]h)}(hKThe limit on the total number of files open on the system has been reached.h]hKThe limit on the total number of files open on the system has been reached.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhjubah}(h]h ]h"]h$]h&]uh1jhjoubeh}(h]h ]h"]h$]h&]uh1j{hhhKNhjhhubeh}(h]h ]h"]h$]h&]uh1jvhj-hhhhhNubeh}(h] return-valueah ]h"] return valueah$]h&]uh1hhhhhhhhK7ubeh}(h]( v4l2-openheh ]h"]( v4l2 open() func-openeh$]h&]uh1hhhhhhhhKexpect_referenced_by_name}jhsexpect_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_handlerjerror_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}(jhjjhhjbj_jjj*j'jju nametypes}(jjhjbjj*juh}(hhjhhhj_jj5j>jjej'jjj-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-open" is not referenced.}hjFsbah}(h]h ]h"]h$]h&]uh1hhjCubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1jAuba transformerN include_log] decorationNhhub.