€•ùdŒ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Œ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â)”}”(hh÷h]”hŒ v4l2_input”…””}”(hhùhžhhŸNh Nubah}”(h]”h ]”(Œxref”Œc”Œc-type”eh"]”h$]”h&]”uh1háhhõ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â)”}”(hj-h]”hŒ v4l2_output”…””}”(hj/hž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”‰jjj%Œ v4l2_output”uh1hhŸh³h K hhÙubhŒ returned by the ”…””}”(hhÙhžhhŸNh Nubh)”}”(hŒ:ref:`VIDIOC_ENUMINPUT`”h]”hŒinline”“”)”}”(hjPh]”hŒVIDIOC_ENUMINPUT”…””}”(hjThžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jRhjNubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j^Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj%Œvidioc_enuminput”uh1hhŸh³h K hhÙubhŒ and ”…””}”(hhÙhžhhŸNh Nubh)”}”(hŒ:ref:`VIDIOC_ENUMOUTPUT`”h]”jS)”}”(hjvh]”hŒVIDIOC_ENUMOUTPUT”…””}”(hjxhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jRhjtubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j‚Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj%Œ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]”jS)”}”(hj¨h]”hŒVIDIOC_ENUMSTD”…””}”(hjªhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jRhj¦ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j´Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj%Œ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”juh1jæ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]”jS)”}”(hj h]”hŒ VIDIOC_G_STD”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jRhj ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj%Œ vidioc_g_std”uh1hhŸh³h K'hjubhŒ and ”…””}”(hjhžhhŸNh Nubh)”}”(hŒ":ref:`VIDIOC_S_STD `”h]”jS)”}”(hj/h]”hŒ VIDIOC_S_STD”…””}”(hj1hžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jRhj-ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j;Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj%Œ vidioc_g_std”uh1hhŸh³h K'hjubhŒ ioctl, respectively. The ”…””}”(hjhžhhŸNh NubhŒemphasis”“”)”}”(hŒ *received*”h]”hŒreceived”…””}”(hjShžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jQhjubhŒ! standard can be sensed with the ”…””}”(hjhžhhŸNh Nubh)”}”(hŒ:ref:`VIDIOC_QUERYSTD`”h]”jS)”}”(hjgh]”hŒVIDIOC_QUERYSTD”…””}”(hjihžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jRhjeubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jsŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj%Œ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]”jS)”}”(hjŸh]”hŒ v4l2_std_id”…””}”(hj¡hžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jRhjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j«Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj%Œ v4l2-std-id”uh1hhŸh³h K/hj•ubhŒ type (a standard set), ”…””}”(hj•hžhhŸNh NubjR)”}”(hŒ*not*”h]”hŒnot”…””}”(hjÁhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jQhj•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&]”uh1jhhÄ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 K8hjôubah}”(h]”h ]”h"]”h$]”h&]”uh1jòhjïhž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.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h K;hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jòhjïhžhhŸh³h Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jíhŸ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”…””}”(hj4hž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â)”}”(hjHh]”hŒ v4l2_input”…””}”(hjJhžhhŸNh Nubah}”(h]”h ]”(jjŒc-type”eh"]”h$]”h&]”uh1háhjFubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰jjj%Œ v4l2_input”uh1hhŸh³h K=hj,ubhŒ and struct ”…””}”(hj,hžhhŸNh Nubh)”}”(hŒ:c:type:`v4l2_output`”h]”hâ)”}”(hjkh]”hŒ v4l2_output”…””}”(hjmhžhhŸNh Nubah}”(h]”h ]”(jjŒc-type”eh"]”h$]”h&]”uh1háhjiubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰jjj%Œ v4l2_output”uh1hhŸh³h K=hj,ubhŒ to zero and the ”…””}”(hj,hžhhŸNh Nubh)”}”(hŒ":ref:`VIDIOC_G_STD `”h]”jS)”}”(hjŽh]”hŒ VIDIOC_G_STD”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jRhjŒubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jšŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj%Œ vidioc_g_std”uh1hhŸh³h K=hj,ubhŒ, ”…””}”(hj,hžhhŸNh Nubh)”}”(hŒ":ref:`VIDIOC_S_STD `”h]”jS)”}”(hj²h]”hŒ VIDIOC_S_STD”…””}”(hj´hžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jRhj°ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j¾Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj%Œ vidioc_g_std”uh1hhŸh³h K=hj,ubhŒ, ”…””}”(hj,hžhhŸNh Nubh)”}”(hŒ:ref:`VIDIOC_QUERYSTD`”h]”jS)”}”(hjÖh]”hŒVIDIOC_QUERYSTD”…””}”(hjØhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jRhjÔubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jâŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj%Œvidioc_querystd”uh1hhŸh³h K=hj,ubhŒ and ”…””}”(hj,hžhhŸNh Nubh)”}”(hŒ:ref:`VIDIOC_ENUMSTD`”h]”jS)”}”(hjúh]”hŒVIDIOC_ENUMSTD”…””}”(hjühžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jRhjøubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj%Œvidioc_enumstd”uh1hhŸh³h K=hj,ubhŒ ioctls shall return the ”…””}”(hj,hžhhŸNh Nubhâ)”}”(hŒ ``ENOTTY``”h]”hŒENOTTY”…””}”(hjhž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”…””}”(hj.hž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 ”…””}”(hjFhžhhŸNh Nubh)”}”(hŒ:ref:`input-capabilities`”h]”jS)”}”(hjPh]”hŒinput-capabilities”…””}”(hjRhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jRhjNubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j\Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj%Œinput-capabilities”uh1hhŸh³h KChjFubhŒ and ”…””}”(hjFhžhhŸNh Nubh)”}”(hŒ:ref:`output-capabilities`”h]”jS)”}”(hjth]”hŒoutput-capabilities”…””}”(hjvhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jRhjrubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j€Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj%Œoutput-capabilities”uh1hhŸh³h KChjFubhŒa flags to determine whether the video standard ioctls can be used with the given input or output.”…””}”(hjFhž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”…””}”(hjôhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÇhjñhž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—hjñhž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”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjhž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¸hjubeh}”(h]”jøah ]”h"]”Œf1”ah$]”h&]”jòaj÷Kjùjuh1jhŸh³h K·hjñhž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”}”jIh¶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”jsŒ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”}”(jIhÁjHjEjÆjÃjîjëj@j=j8jøuŒ nametypes”}”(jIˆjH‰jƉjî‰j@‰j8ˆuh}”(hÁhÄjEhÄjòjèjÃjœjëjÉj=jñjøjuŒ footnote_refs”}”j³]”jèasŒ citation_refs”}”Œ autofootnotes”]”jaŒautofootnote_refs”]”jèaŒsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”jKs…”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.