€•âeŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ4/translations/zh_CN/userspace-api/media/v4l/standard”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/zh_TW/userspace-api/media/v4l/standard”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/it_IT/userspace-api/media/v4l/standard”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/ja_JP/userspace-api/media/v4l/standard”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/ko_KR/userspace-api/media/v4l/standard”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/pt_BR/userspace-api/media/v4l/standard”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/sp_SP/userspace-api/media/v4l/standard”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ8SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later”h]”hŒ8SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒN/var/lib/git/docbuild/linux/Documentation/userspace-api/media/v4l/standard.rst”h´KubhŒtarget”“”)”}”(hŒ .. _standard:”h]”h}”(h]”h ]”h"]”h$]”h&]”Œrefid”Œstandard”uh1hÈh´Khhh²hh³hÇubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒVideo Standards”h]”hŒVideo Standards”…””}”(hhÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhhØh²hh³hÇh´KubhŒ paragraph”“”)”}”(hXhVideo devices typically support one or more different video standards or variations of standards. Each video input and output may support another set of standards. This set is reported by the ``std`` field of struct :c:type:`v4l2_input` and struct :c:type:`v4l2_output` returned by the :ref:`VIDIOC_ENUMINPUT` and :ref:`VIDIOC_ENUMOUTPUT` ioctls, respectively.”h]”(hŒÀVideo devices typically support one or more different video standards or variations of standards. Each video input and output may support another set of standards. This set is reported by the ”…””}”(hhíh²hh³Nh´NubhŒliteral”“”)”}”(hŒ``std``”h]”hŒstd”…””}”(hh÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhhíubhŒ field of struct ”…””}”(hhíh²hh³Nh´Nubh)”}”(hŒ:c:type:`v4l2_input`”h]”hö)”}”(hj h]”hŒ v4l2_input”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”(Œxref”Œc”Œc-type”eh"]”h$]”h&]”uh1hõhj ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œ userspace-api/media/v4l/standard”Œ refdomain”jŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰Œ c:parent_key”Œsphinx.domains.c”Œ LookupKey”“”)”}”Œdata”]”j+Œ ASTIdentifier”“”)”}”Œ identifier”ŒV4L”sbN†”asbŒ reftarget”Œ v4l2_input”uh1hh³hÇh´K hhíubhŒ and struct ”…””}”(hhíh²hh³Nh´Nubh)”}”(hŒ:c:type:`v4l2_output`”h]”hö)”}”(hjAh]”hŒ v4l2_output”…””}”(hjCh²hh³Nh´Nubah}”(h]”h ]”(jjŒc-type”eh"]”h$]”h&]”uh1hõhj?ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”jŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰j*j.j9Œ v4l2_output”uh1hh³hÇh´K hhíubhŒ returned by the ”…””}”(hhíh²hh³Nh´Nubh)”}”(hŒ:ref:`VIDIOC_ENUMINPUT`”h]”hŒinline”“”)”}”(hjdh]”hŒVIDIOC_ENUMINPUT”…””}”(hjhh²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jfhjbubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”jrŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj9Œvidioc_enuminput”uh1hh³hÇh´K hhíubhŒ and ”…””}”(hhíh²hh³Nh´Nubh)”}”(hŒ:ref:`VIDIOC_ENUMOUTPUT`”h]”jg)”}”(hjŠh]”hŒVIDIOC_ENUMOUTPUT”…””}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jfhjˆubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”j–Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj9Œvidioc_enumoutput”uh1hh³hÇh´K hhíubhŒ ioctls, respectively.”…””}”(hhíh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K hhØh²hubhì)”}”(hXÓV4L2 defines one bit for each analog video standard currently in use worldwide, and sets aside bits for driver defined standards, e. g. hybrid standards to watch NTSC video tapes on PAL TVs and vice versa. Applications can use the predefined bits to select a particular standard, although presenting the user a menu of supported standards is preferred. To enumerate and query the attributes of the supported standards applications use the :ref:`VIDIOC_ENUMSTD` ioctl.”h]”(hX·V4L2 defines one bit for each analog video standard currently in use worldwide, and sets aside bits for driver defined standards, e. g. hybrid standards to watch NTSC video tapes on PAL TVs and vice versa. Applications can use the predefined bits to select a particular standard, although presenting the user a menu of supported standards is preferred. To enumerate and query the attributes of the supported standards applications use the ”…””}”(hj²h²hh³Nh´Nubh)”}”(hŒ:ref:`VIDIOC_ENUMSTD`”h]”jg)”}”(hj¼h]”hŒVIDIOC_ENUMSTD”…””}”(hj¾h²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jfhjºubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”jÈŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj9Œvidioc_enumstd”uh1hh³hÇh´Khj²ubhŒ ioctl.”…””}”(hj²h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KhhØh²hubhì)”}”(hXMany of the defined standards are actually just variations of a few major standards. The hardware may in fact not distinguish between them, or do so internal and switch automatically. Therefore enumerated standards also contain sets of one or more standard bits.”h]”hXMany of the defined standards are actually just variations of a few major standards. The hardware may in fact not distinguish between them, or do so internal and switch automatically. Therefore enumerated standards also contain sets of one or more standard bits.”…””}”(hjäh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KhhØh²hubhì)”}”(hX|Assume a hypothetic tuner capable of demodulating B/PAL, G/PAL and I/PAL signals. The first enumerated standard is a set of B and G/PAL, switched automatically depending on the selected radio frequency in UHF or VHF band. Enumeration gives a "PAL-B/G" or "PAL-I" choice. Similar a Composite input may collapse standards, enumerating "PAL-B/G/H/I", "NTSC-M" and "SECAM-D/K". [#f1]_”h]”(hXŠAssume a hypothetic tuner capable of demodulating B/PAL, G/PAL and I/PAL signals. The first enumerated standard is a set of B and G/PAL, switched automatically depending on the selected radio frequency in UHF or VHF band. Enumeration gives a “PAL-B/G†or “PAL-I†choice. Similar a Composite input may collapse standards, enumerating “PAL-B/G/H/Iâ€, “NTSC-M†and “SECAM-D/Kâ€. ”…””}”(hjòh²hh³Nh´NubhŒfootnote_reference”“”)”}”(hŒ[#f1]_”h]”hŒ1”…””}”(hjüh²hh³Nh´Nubah}”(h]”Œid1”ah ]”h"]”h$]”h&]”Œauto”KhÔŒf1”Œdocname”j$uh1júhjòŒresolved”Kubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K hhØh²hubhì)”}”(hX To query and select the standard used by the current video input or output applications call the :ref:`VIDIOC_G_STD ` and :ref:`VIDIOC_S_STD ` ioctl, respectively. The *received* standard can be sensed with the :ref:`VIDIOC_QUERYSTD` ioctl.”h]”(hŒaTo query and select the standard used by the current video input or output applications call the ”…””}”(hjh²hh³Nh´Nubh)”}”(hŒ":ref:`VIDIOC_G_STD `”h]”jg)”}”(hjh]”hŒ VIDIOC_G_STD”…””}”(hj!h²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jfhjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”j+Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj9Œ vidioc_g_std”uh1hh³hÇh´K'hjubhŒ and ”…””}”(hjh²hh³Nh´Nubh)”}”(hŒ":ref:`VIDIOC_S_STD `”h]”jg)”}”(hjCh]”hŒ VIDIOC_S_STD”…””}”(hjEh²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jfhjAubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”jOŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj9Œ vidioc_g_std”uh1hh³hÇh´K'hjubhŒ ioctl, respectively. The ”…””}”(hjh²hh³Nh´NubhŒemphasis”“”)”}”(hŒ *received*”h]”hŒreceived”…””}”(hjgh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jehjubhŒ! standard can be sensed with the ”…””}”(hjh²hh³Nh´Nubh)”}”(hŒ:ref:`VIDIOC_QUERYSTD`”h]”jg)”}”(hj{h]”hŒVIDIOC_QUERYSTD”…””}”(hj}h²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jfhjyubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”j‡Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj9Œvidioc_querystd”uh1hh³hÇh´K'hjubhŒ ioctl.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K'hhØh²hubhŒnote”“”)”}”(hXThe parameter of all these ioctls is a pointer to a :ref:`v4l2_std_id ` type (a standard set), *not* an index into the standard enumeration. Drivers must implement all video standard ioctls when the device has one or more video inputs or outputs.”h]”hì)”}”(hXThe parameter of all these ioctls is a pointer to a :ref:`v4l2_std_id ` type (a standard set), *not* an index into the standard enumeration. Drivers must implement all video standard ioctls when the device has one or more video inputs or outputs.”h]”(hŒ4The parameter of all these ioctls is a pointer to a ”…””}”(hj©h²hh³Nh´Nubh)”}”(hŒ :ref:`v4l2_std_id `”h]”jg)”}”(hj³h]”hŒ v4l2_std_id”…””}”(hjµh²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jfhj±ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”j¿Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj9Œ v4l2-std-id”uh1hh³hÇh´K/hj©ubhŒ type (a standard set), ”…””}”(hj©h²hh³Nh´Nubjf)”}”(hŒ*not*”h]”hŒnot”…””}”(hjÕh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jehj©ubhŒ’ an index into the standard enumeration. Drivers must implement all video standard ioctls when the device has one or more video inputs or outputs.”…””}”(hj©h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K/hj¥ubah}”(h]”h ]”h"]”h$]”h&]”uh1j£hhØh²hh³hÇh´Nubhì)”}”(hŒ¤Special rules apply to devices such as USB cameras where the notion of video standards makes little sense. More generally for any capture or output device which is:”h]”hŒ¤Special rules apply to devices such as USB cameras where the notion of video standards makes little sense. More generally for any capture or output device which is:”…””}”(hjóh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K4hhØh²hubhŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒVincapable of capturing fields or frames at the nominal rate of the video standard, or ”h]”hì)”}”(hŒUincapable of capturing fields or frames at the nominal rate of the video standard, or”h]”hŒUincapable of capturing fields or frames at the nominal rate of the video standard, or”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K8hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjh²hh³hÇh´Nubj)”}”(hŒ9that does not support the video standard formats at all. ”h]”hì)”}”(hŒ8that does not support the video standard formats at all.”h]”hŒ8that does not support the video standard formats at all.”…””}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K;hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jh³hÇh´K8hhØh²hubhì)”}”(hX@Here the driver shall set the ``std`` field of struct :c:type:`v4l2_input` and struct :c:type:`v4l2_output` to zero and the :ref:`VIDIOC_G_STD `, :ref:`VIDIOC_S_STD `, :ref:`VIDIOC_QUERYSTD` and :ref:`VIDIOC_ENUMSTD` ioctls shall return the ``ENOTTY`` error code or the ``EINVAL`` error code.”h]”(hŒHere the driver shall set the ”…””}”(hj@h²hh³Nh´Nubhö)”}”(hŒ``std``”h]”hŒstd”…””}”(hjHh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj@ubhŒ field of struct ”…””}”(hj@h²hh³Nh´Nubh)”}”(hŒ:c:type:`v4l2_input`”h]”hö)”}”(hj\h]”hŒ v4l2_input”…””}”(hj^h²hh³Nh´Nubah}”(h]”h ]”(jjŒc-type”eh"]”h$]”h&]”uh1hõhjZubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”jŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰j*j.j9Œ v4l2_input”uh1hh³hÇh´K=hj@ubhŒ and struct ”…””}”(hj@h²hh³Nh´Nubh)”}”(hŒ:c:type:`v4l2_output`”h]”hö)”}”(hjh]”hŒ v4l2_output”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”(jjŒc-type”eh"]”h$]”h&]”uh1hõhj}ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”jŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰j*j.j9Œ v4l2_output”uh1hh³hÇh´K=hj@ubhŒ to zero and the ”…””}”(hj@h²hh³Nh´Nubh)”}”(hŒ":ref:`VIDIOC_G_STD `”h]”jg)”}”(hj¢h]”hŒ VIDIOC_G_STD”…””}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jfhj ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”j®Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj9Œ vidioc_g_std”uh1hh³hÇh´K=hj@ubhŒ, ”…””}”(hj@h²hh³Nh´Nubh)”}”(hŒ":ref:`VIDIOC_S_STD `”h]”jg)”}”(hjÆh]”hŒ VIDIOC_S_STD”…””}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jfhjÄubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”jÒŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj9Œ vidioc_g_std”uh1hh³hÇh´K=hj@ubhŒ, ”…””}”(hj@h²hh³Nh´Nubh)”}”(hŒ:ref:`VIDIOC_QUERYSTD`”h]”jg)”}”(hjêh]”hŒVIDIOC_QUERYSTD”…””}”(hjìh²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jfhjèubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”jöŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj9Œvidioc_querystd”uh1hh³hÇh´K=hj@ubhŒ and ”…””}”(hj@h²hh³Nh´Nubh)”}”(hŒ:ref:`VIDIOC_ENUMSTD`”h]”jg)”}”(hjh]”hŒVIDIOC_ENUMSTD”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jfhj ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”jŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj9Œvidioc_enumstd”uh1hh³hÇh´K=hj@ubhŒ ioctls shall return the ”…””}”(hj@h²hh³Nh´Nubhö)”}”(hŒ ``ENOTTY``”h]”hŒENOTTY”…””}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj@ubhŒ error code or the ”…””}”(hj@h²hh³Nh´Nubhö)”}”(hŒ ``EINVAL``”h]”hŒEINVAL”…””}”(hjBh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj@ubhŒ error code.”…””}”(hj@h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K=hhØh²hubhì)”}”(hŒºApplications can make use of the :ref:`input-capabilities` and :ref:`output-capabilities` flags to determine whether the video standard ioctls can be used with the given input or output.”h]”(hŒ!Applications can make use of the ”…””}”(hjZh²hh³Nh´Nubh)”}”(hŒ:ref:`input-capabilities`”h]”jg)”}”(hjdh]”hŒinput-capabilities”…””}”(hjfh²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jfhjbubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”jpŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj9Œinput-capabilities”uh1hh³hÇh´KChjZubhŒ and ”…””}”(hjZh²hh³Nh´Nubh)”}”(hŒ:ref:`output-capabilities`”h]”jg)”}”(hjˆh]”hŒoutput-capabilities”…””}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jfhj†ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j$Œ refdomain”j”Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj9Œoutput-capabilities”uh1hh³hÇh´KChjZubhŒa flags to determine whether the video standard ioctls can be used with the given input or output.”…””}”(hjZh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KChhØh²hubh×)”}”(hhh]”(hÜ)”}”(hŒ5Example: Information about the current video standard”h]”hŒ5Example: Information about the current video standard”…””}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj°h²hh³hÇh´KHubhŒ literal_block”“”)”}”(hXDv4l2_std_id std_id; struct v4l2_standard standard; if (-1 == ioctl(fd, VIDIOC_G_STD, &std_id)) { /* Note when VIDIOC_ENUMSTD always returns ENOTTY this is no video device or it falls under the USB exception, and VIDIOC_G_STD returning ENOTTY is no error. */ perror("VIDIOC_G_STD"); exit(EXIT_FAILURE); } memset(&standard, 0, sizeof(standard)); standard.index = 0; while (0 == ioctl(fd, VIDIOC_ENUMSTD, &standard)) { if (standard.id & std_id) { printf("Current video standard: %s\\n", standard.name); exit(EXIT_SUCCESS); } standard.index++; } /* EINVAL indicates the end of the enumeration, which cannot be empty unless this device falls under the USB exception. */ if (errno == EINVAL || standard.index == 0) { perror("VIDIOC_ENUMSTD"); exit(EXIT_FAILURE); }”h]”hXDv4l2_std_id std_id; struct v4l2_standard standard; if (-1 == ioctl(fd, VIDIOC_G_STD, &std_id)) { /* Note when VIDIOC_ENUMSTD always returns ENOTTY this is no video device or it falls under the USB exception, and VIDIOC_G_STD returning ENOTTY is no error. */ perror("VIDIOC_G_STD"); exit(EXIT_FAILURE); } memset(&standard, 0, sizeof(standard)); standard.index = 0; while (0 == ioctl(fd, VIDIOC_ENUMSTD, &standard)) { if (standard.id & std_id) { printf("Current video standard: %s\\n", standard.name); exit(EXIT_SUCCESS); } standard.index++; } /* EINVAL indicates the end of the enumeration, which cannot be empty unless this device falls under the USB exception. */ if (errno == EINVAL || standard.index == 0) { perror("VIDIOC_ENUMSTD"); exit(EXIT_FAILURE); }”…””}”hjÃsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆŒforce”‰Œlanguage”jŒhighlight_args”}”uh1jÁh³hÇh´KJhj°h²hubeh}”(h]”Œ4example-information-about-the-current-video-standard”ah ]”h"]”Œ5example: information about the current video standard”ah$]”h&]”uh1hÖhhØh²hh³hÇh´KHubh×)”}”(hhh]”(hÜ)”}”(hŒCExample: Listing the video standards supported by the current input”h]”hŒCExample: Listing the video standards supported by the current input”…””}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjÝh²hh³hÇh´KmubjÂ)”}”(hX%struct v4l2_input input; struct v4l2_standard standard; memset(&input, 0, sizeof(input)); if (-1 == ioctl(fd, VIDIOC_G_INPUT, &input.index)) { perror("VIDIOC_G_INPUT"); exit(EXIT_FAILURE); } if (-1 == ioctl(fd, VIDIOC_ENUMINPUT, &input)) { perror("VIDIOC_ENUM_INPUT"); exit(EXIT_FAILURE); } printf("Current input %s supports:\\n", input.name); memset(&standard, 0, sizeof(standard)); standard.index = 0; while (0 == ioctl(fd, VIDIOC_ENUMSTD, &standard)) { if (standard.id & input.std) printf("%s\\n", standard.name); standard.index++; } /* EINVAL indicates the end of the enumeration, which cannot be empty unless this device falls under the USB exception. */ if (errno != EINVAL || standard.index == 0) { perror("VIDIOC_ENUMSTD"); exit(EXIT_FAILURE); }”h]”hX%struct v4l2_input input; struct v4l2_standard standard; memset(&input, 0, sizeof(input)); if (-1 == ioctl(fd, VIDIOC_G_INPUT, &input.index)) { perror("VIDIOC_G_INPUT"); exit(EXIT_FAILURE); } if (-1 == ioctl(fd, VIDIOC_ENUMINPUT, &input)) { perror("VIDIOC_ENUM_INPUT"); exit(EXIT_FAILURE); } printf("Current input %s supports:\\n", input.name); memset(&standard, 0, sizeof(standard)); standard.index = 0; while (0 == ioctl(fd, VIDIOC_ENUMSTD, &standard)) { if (standard.id & input.std) printf("%s\\n", standard.name); standard.index++; } /* EINVAL indicates the end of the enumeration, which cannot be empty unless this device falls under the USB exception. */ if (errno != EINVAL || standard.index == 0) { perror("VIDIOC_ENUMSTD"); exit(EXIT_FAILURE); }”…””}”hjîsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjщjÒjjÓ}”uh1jÁh³hÇh´KohjÝh²hubeh}”(h]”ŒBexample-listing-the-video-standards-supported-by-the-current-input”ah ]”h"]”ŒCexample: listing the video standards supported by the current input”ah$]”h&]”uh1hÖhhØh²hh³hÇh´Kmubh×)”}”(hhh]”(hÜ)”}”(hŒ'Example: Selecting a new video standard”h]”hŒ'Example: Selecting a new video standard”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjh²hh³hÇh´K•ubjÂ)”}”(hXzstruct v4l2_input input; v4l2_std_id std_id; memset(&input, 0, sizeof(input)); if (-1 == ioctl(fd, VIDIOC_G_INPUT, &input.index)) { perror("VIDIOC_G_INPUT"); exit(EXIT_FAILURE); } if (-1 == ioctl(fd, VIDIOC_ENUMINPUT, &input)) { perror("VIDIOC_ENUM_INPUT"); exit(EXIT_FAILURE); } if (0 == (input.std & V4L2_STD_PAL_BG)) { fprintf(stderr, "Oops. B/G PAL is not supported.\\n"); exit(EXIT_FAILURE); } /* Note this is also supposed to work when only B or G/PAL is supported. */ std_id = V4L2_STD_PAL_BG; if (-1 == ioctl(fd, VIDIOC_S_STD, &std_id)) { perror("VIDIOC_S_STD"); exit(EXIT_FAILURE); }”h]”hXzstruct v4l2_input input; v4l2_std_id std_id; memset(&input, 0, sizeof(input)); if (-1 == ioctl(fd, VIDIOC_G_INPUT, &input.index)) { perror("VIDIOC_G_INPUT"); exit(EXIT_FAILURE); } if (-1 == ioctl(fd, VIDIOC_ENUMINPUT, &input)) { perror("VIDIOC_ENUM_INPUT"); exit(EXIT_FAILURE); } if (0 == (input.std & V4L2_STD_PAL_BG)) { fprintf(stderr, "Oops. B/G PAL is not supported.\\n"); exit(EXIT_FAILURE); } /* Note this is also supposed to work when only B or G/PAL is supported. */ std_id = V4L2_STD_PAL_BG; if (-1 == ioctl(fd, VIDIOC_S_STD, &std_id)) { perror("VIDIOC_S_STD"); exit(EXIT_FAILURE); }”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjщjÒjjÓ}”uh1jÁh³hÇh´K—hjh²hubhŒfootnote”“”)”}”(hŒÃSome users are already confused by technical terms PAL, NTSC and SECAM. There is no point asking them to distinguish between B, G, D, or K when the software or hardware can do that automatically.”h]”(hŒlabel”“”)”}”(hhh]”hŒ1”…””}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j+hj'h²hh³Nh´Nubhì)”}”(hŒÃSome users are already confused by technical terms PAL, NTSC and SECAM. There is no point asking them to distinguish between B, G, D, or K when the software or hardware can do that automatically.”h]”hŒÃSome users are already confused by technical terms PAL, NTSC and SECAM. There is no point asking them to distinguish between B, G, D, or K when the software or hardware can do that automatically.”…””}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K¸hj'ubeh}”(h]”j ah ]”h"]”Œf1”ah$]”h&]”jaj Kj j$uh1j%h³hÇh´K·hjh²hubeh}”(h]”Œ&example-selecting-a-new-video-standard”ah ]”h"]”Œ'example: selecting a new video standard”ah$]”h&]”uh1hÖhhØh²hh³hÇh´K•ubeh}”(h]”(Œvideo-standards”hÕeh ]”h"]”(Œvideo standards”Œstandard”eh$]”h&]”uh1hÖhhh²hh³hÇh´KŒexpect_referenced_by_name”}”j]hÊsŒexpect_referenced_by_id”}”hÕhÊsubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÛNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j‡Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œf1”]”jüasŒrefids”}”(hÕ]”hÊaj ]”jüauŒnameids”}”(j]hÕj\jYjÚj×jjÿjTjQjLj uŒ nametypes”}”(j]ˆj\‰jÚ‰j‰jT‰jLˆuh}”(hÕhØjYhØjjüj×j°jÿjÝjQjj j'uŒ footnote_refs”}”jÇ]”jüasŒ citation_refs”}”Œ autofootnotes”]”j'aŒautofootnote_refs”]”jüaŒsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”j•Ks…”R”Œparse_messages”]”Œtransform_messages”]”hŒsystem_message”“”)”}”(hhh]”hì)”}”(hhh]”hŒ.Hyperlink target "standard" is not referenced.”…””}”hjõsbah}”(h]”h ]”h"]”h$]”h&]”uh1hëhjòubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”hÇŒline”Kuh1jðubaŒ transformer”NŒ include_log”]”Œ decoration”Nh²hub.