€• |Œ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”Œ=/translations/zh_CN/userspace-api/media/v4l/extended-controls”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ=/translations/zh_TW/userspace-api/media/v4l/extended-controls”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ=/translations/it_IT/userspace-api/media/v4l/extended-controls”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ=/translations/ja_JP/userspace-api/media/v4l/extended-controls”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ=/translations/ko_KR/userspace-api/media/v4l/extended-controls”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ=/translations/pt_BR/userspace-api/media/v4l/extended-controls”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ=/translations/sp_SP/userspace-api/media/v4l/extended-controls”Œ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³ŒW/var/lib/git/docbuild/linux/Documentation/userspace-api/media/v4l/extended-controls.rst”h´KubhŒtarget”“”)”}”(hŒ.. _extended-controls:”h]”h}”(h]”h ]”h"]”h$]”h&]”Œrefid”Œextended-controls”uh1hÈh´Khhh²hh³hÇubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒExtended Controls API”h]”hŒExtended Controls API”…””}”(hhÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhhØh²hh³hÇh´Kubh×)”}”(hhh]”(hÜ)”}”(hŒ Introduction”h]”hŒ Introduction”…””}”(hhîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhhëh²hh³hÇh´K ubhŒ paragraph”“”)”}”(hX The control mechanism as originally designed was meant to be used for user settings (brightness, saturation, etc). However, it turned out to be a very useful model for implementing more complicated driver APIs where each driver implements only a subset of a larger API.”h]”hX The control mechanism as originally designed was meant to be used for user settings (brightness, saturation, etc). However, it turned out to be a very useful model for implementing more complicated driver APIs where each driver implements only a subset of a larger API.”…””}”(hhþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Khhëh²hubhý)”}”(hXõThe MPEG encoding API was the driving force behind designing and implementing this extended control mechanism: the MPEG standard is quite large and the currently supported hardware MPEG encoders each only implement a subset of this standard. Further more, many parameters relating to how the video is encoded into an MPEG stream are specific to the MPEG encoding chip since the MPEG standard only defines the format of the resulting MPEG stream, not how the video is actually encoded into that format.”h]”hXõThe MPEG encoding API was the driving force behind designing and implementing this extended control mechanism: the MPEG standard is quite large and the currently supported hardware MPEG encoders each only implement a subset of this standard. Further more, many parameters relating to how the video is encoded into an MPEG stream are specific to the MPEG encoding chip since the MPEG standard only defines the format of the resulting MPEG stream, not how the video is actually encoded into that format.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Khhëh²hubhý)”}”(hŒ¬Unfortunately, the original control API lacked some features needed for these new uses and so it was extended into the (not terribly originally named) extended control API.”h]”hŒ¬Unfortunately, the original control API lacked some features needed for these new uses and so it was extended into the (not terribly originally named) extended control API.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Khhëh²hubhý)”}”(hX0Even though the MPEG encoding API was the first effort to use the Extended Control API, nowadays there are also other classes of Extended Controls, such as Camera Controls and FM Transmitter Controls. The Extended Controls API as well as all Extended Controls classes are described in the following text.”h]”hX0Even though the MPEG encoding API was the first effort to use the Extended Control API, nowadays there are also other classes of Extended Controls, such as Camera Controls and FM Transmitter Controls. The Extended Controls API as well as all Extended Controls classes are described in the following text.”…””}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K hhëh²hubeh}”(h]”Œ introduction”ah ]”h"]”Œ introduction”ah$]”h&]”uh1hÖhhØh²hh³hÇh´K ubh×)”}”(hhh]”(hÜ)”}”(hŒThe Extended Control API”h]”hŒThe Extended Control API”…””}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj>h²hh³hÇh´K(ubhý)”}”(hX»Three new ioctls are available: :ref:`VIDIOC_G_EXT_CTRLS `, :ref:`VIDIOC_S_EXT_CTRLS ` and :ref:`VIDIOC_TRY_EXT_CTRLS `. These ioctls act on arrays of controls (as opposed to the :ref:`VIDIOC_G_CTRL ` and :ref:`VIDIOC_S_CTRL ` ioctls that act on a single control). This is needed since it is often required to atomically change several controls at once.”h]”(hŒ Three new ioctls are available: ”…””}”(hjOh²hh³Nh´Nubh)”}”(hŒ.:ref:`VIDIOC_G_EXT_CTRLS `”h]”hŒinline”“”)”}”(hjYh]”hŒVIDIOC_G_EXT_CTRLS”…””}”(hj]h²hh³Nh´Nubah}”(h]”h ]”(Œxref”Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j[hjWubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œ)userspace-api/media/v4l/extended-controls”Œ refdomain”jhŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆŒ reftarget”Œvidioc_g_ext_ctrls”uh1hh³hÇh´K*hjOubhŒ, ”…””}”(hjOh²hh³Nh´Nubh)”}”(hŒ.:ref:`VIDIOC_S_EXT_CTRLS `”h]”j\)”}”(hj‚h]”hŒVIDIOC_S_EXT_CTRLS”…””}”(hj„h²hh³Nh´Nubah}”(h]”h ]”(jgŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j[hj€ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”jŽŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjzŒvidioc_g_ext_ctrls”uh1hh³hÇh´K*hjOubhŒ and ”…””}”(hjOh²hh³Nh´Nubh)”}”(hŒ0:ref:`VIDIOC_TRY_EXT_CTRLS `”h]”j\)”}”(hj¦h]”hŒVIDIOC_TRY_EXT_CTRLS”…””}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”(jgŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j[hj¤ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”j²Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjzŒvidioc_g_ext_ctrls”uh1hh³hÇh´K*hjOubhŒ<. These ioctls act on arrays of controls (as opposed to the ”…””}”(hjOh²hh³Nh´Nubh)”}”(hŒ$:ref:`VIDIOC_G_CTRL `”h]”j\)”}”(hjÊh]”hŒ VIDIOC_G_CTRL”…””}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”(jgŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j[hjÈubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”jÖŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjzŒ vidioc_g_ctrl”uh1hh³hÇh´K*hjOubhŒ and ”…””}”hjOsbh)”}”(hŒ$:ref:`VIDIOC_S_CTRL `”h]”j\)”}”(hjîh]”hŒ VIDIOC_S_CTRL”…””}”(hjðh²hh³Nh´Nubah}”(h]”h ]”(jgŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j[hjìubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”júŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjzŒ vidioc_g_ctrl”uh1hh³hÇh´K*hjOubhŒ ioctls that act on a single control). This is needed since it is often required to atomically change several controls at once.”…””}”(hjOh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K*hj>h²hubhý)”}”(hXEach of the new ioctls expects a pointer to a struct :c:type:`v4l2_ext_controls`. This structure contains a pointer to the control array, a count of the number of controls in that array and a control class. Control classes are used to group similar controls into a single class. For example, control class ``V4L2_CTRL_CLASS_USER`` contains all user controls (i. e. all controls that can also be set using the old :ref:`VIDIOC_S_CTRL ` ioctl). Control class ``V4L2_CTRL_CLASS_CODEC`` contains controls relating to codecs.”h]”(hŒ5Each of the new ioctls expects a pointer to a struct ”…””}”(hjh²hh³Nh´Nubh)”}”(hŒ:c:type:`v4l2_ext_controls`”h]”hŒliteral”“”)”}”(hj h]”hŒv4l2_ext_controls”…””}”(hj$h²hh³Nh´Nubah}”(h]”h ]”(jgŒc”Œc-type”eh"]”h$]”h&]”uh1j"hjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”j.Œreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰Œ c:parent_key”Œsphinx.domains.c”Œ LookupKey”“”)”}”Œdata”]”j@Œ ASTIdentifier”“”)”}”Œ identifier”ŒV4L”sbN†”asbjzŒv4l2_ext_controls”uh1hh³hÇh´K4hjubhŒâ. This structure contains a pointer to the control array, a count of the number of controls in that array and a control class. Control classes are used to group similar controls into a single class. For example, control class ”…””}”(hjh²hh³Nh´Nubj#)”}”(hŒ``V4L2_CTRL_CLASS_USER``”h]”hŒV4L2_CTRL_CLASS_USER”…””}”(hjSh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjubhŒS contains all user controls (i. e. all controls that can also be set using the old ”…””}”(hjh²hh³Nh´Nubh)”}”(hŒ$:ref:`VIDIOC_S_CTRL `”h]”j\)”}”(hjgh]”hŒ VIDIOC_S_CTRL”…””}”(hjih²hh³Nh´Nubah}”(h]”h ]”(jgŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j[hjeubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”jsŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjzŒ vidioc_g_ctrl”uh1hh³hÇh´K4hjubhŒ ioctl). Control class ”…””}”(hjh²hh³Nh´Nubj#)”}”(hŒ``V4L2_CTRL_CLASS_CODEC``”h]”hŒV4L2_CTRL_CLASS_CODEC”…””}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjubhŒ& contains controls relating to codecs.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K4hj>h²hubhý)”}”(hŒ{All controls in the control array must belong to the specified control class. An error is returned if this is not the case.”h]”hŒ{All controls in the control array must belong to the specified control class. An error is returned if this is not the case.”…””}”(hj¡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K>hj>h²hubhý)”}”(hŒ}It is also possible to use an empty control array (``count`` == 0) to check whether the specified control class is supported.”h]”(hŒ3It is also possible to use an empty control array (”…””}”(hj¯h²hh³Nh´Nubj#)”}”(hŒ ``count``”h]”hŒcount”…””}”(hj·h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hj¯ubhŒA == 0) to check whether the specified control class is supported.”…””}”(hj¯h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KAhj>h²hubhý)”}”(hŒìThe control array is a struct :c:type:`v4l2_ext_control` array. The struct :c:type:`v4l2_ext_control` is very similar to struct :c:type:`v4l2_control`, except for the fact that it also allows for 64-bit values and pointers to be passed.”h]”(hŒThe control array is a struct ”…””}”(hjÏh²hh³Nh´Nubh)”}”(hŒ:c:type:`v4l2_ext_control`”h]”j#)”}”(hjÙh]”hŒv4l2_ext_control”…””}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”(jgj.Œc-type”eh"]”h$]”h&]”uh1j"hj×ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”j.Œreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰j?jCjzŒv4l2_ext_control”uh1hh³hÇh´KDhjÏubhŒ array. The struct ”…””}”(hjÏh²hh³Nh´Nubh)”}”(hŒ:c:type:`v4l2_ext_control`”h]”j#)”}”(hjüh]”hŒv4l2_ext_control”…””}”(hjþh²hh³Nh´Nubah}”(h]”h ]”(jgj.Œc-type”eh"]”h$]”h&]”uh1j"hjúubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”j.Œreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰j?jCjzŒv4l2_ext_control”uh1hh³hÇh´KDhjÏubhŒ is very similar to struct ”…””}”(hjÏh²hh³Nh´Nubh)”}”(hŒ:c:type:`v4l2_control`”h]”j#)”}”(hjh]”hŒ v4l2_control”…””}”(hj!h²hh³Nh´Nubah}”(h]”h ]”(jgj.Œc-type”eh"]”h$]”h&]”uh1j"hjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”j.Œreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰j?jCjzŒ v4l2_control”uh1hh³hÇh´KDhjÏubhŒV, except for the fact that it also allows for 64-bit values and pointers to be passed.”…””}”(hjÏh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KDhj>h²hubhý)”}”(hX‰Since the struct :c:type:`v4l2_ext_control` supports pointers it is now also possible to have controls with compound types such as N-dimensional arrays and/or structures. You need to specify the ``V4L2_CTRL_FLAG_NEXT_COMPOUND`` when enumerating controls to actually be able to see such compound controls. In other words, these controls with compound types should only be used programmatically.”h]”(hŒSince the struct ”…””}”(hjFh²hh³Nh´Nubh)”}”(hŒ:c:type:`v4l2_ext_control`”h]”j#)”}”(hjPh]”hŒv4l2_ext_control”…””}”(hjRh²hh³Nh´Nubah}”(h]”h ]”(jgj.Œc-type”eh"]”h$]”h&]”uh1j"hjNubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”j.Œreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰j?jCjzŒv4l2_ext_control”uh1hh³hÇh´KJhjFubhŒ˜ supports pointers it is now also possible to have controls with compound types such as N-dimensional arrays and/or structures. You need to specify the ”…””}”(hjFh²hh³Nh´Nubj#)”}”(hŒ ``V4L2_CTRL_FLAG_NEXT_COMPOUND``”h]”hŒV4L2_CTRL_FLAG_NEXT_COMPOUND”…””}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjFubhŒ¦ when enumerating controls to actually be able to see such compound controls. In other words, these controls with compound types should only be used programmatically.”…””}”(hjFh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KJhj>h²hubhý)”}”(hXPSince such compound controls need to expose more information about themselves than is possible with :ref:`VIDIOC_QUERYCTRL ` the :ref:`VIDIOC_QUERY_EXT_CTRL ` ioctl was added. In particular, this ioctl gives the dimensions of the N-dimensional array if this control consists of more than one element.”h]”(hŒdSince such compound controls need to expose more information about themselves than is possible with ”…””}”(hj‰h²hh³Nh´Nubh)”}”(hŒ*:ref:`VIDIOC_QUERYCTRL `”h]”j\)”}”(hj“h]”hŒVIDIOC_QUERYCTRL”…””}”(hj•h²hh³Nh´Nubah}”(h]”h ]”(jgŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j[hj‘ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”jŸŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjzŒvidioc_queryctrl”uh1hh³hÇh´KQhj‰ubhŒ the ”…””}”(hj‰h²hh³Nh´Nubh)”}”(hŒ/:ref:`VIDIOC_QUERY_EXT_CTRL `”h]”j\)”}”(hj·h]”hŒVIDIOC_QUERY_EXT_CTRL”…””}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”(jgŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j[hjµubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”jÃŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjzŒvidioc_queryctrl”uh1hh³hÇh´KQhj‰ubhŒŽ ioctl was added. In particular, this ioctl gives the dimensions of the N-dimensional array if this control consists of more than one element.”…””}”(hj‰h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KQhj>h²hubhŒnote”“”)”}”(hX:#. It is important to realize that due to the flexibility of controls it is necessary to check whether the control you want to set actually is supported in the driver and what the valid range of values is. So use :ref:`VIDIOC_QUERYCTRL` to check this. #. It is possible that some of the menu indices in a control of type ``V4L2_CTRL_TYPE_MENU`` may not be supported (``VIDIOC_QUERYMENU`` will return an error). A good example is the list of supported MPEG audio bitrates. Some drivers only support one or two bitrates, others support a wider range.”h]”hŒenumerated_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒùIt is important to realize that due to the flexibility of controls it is necessary to check whether the control you want to set actually is supported in the driver and what the valid range of values is. So use :ref:`VIDIOC_QUERYCTRL` to check this. ”h]”hý)”}”(hŒøIt is important to realize that due to the flexibility of controls it is necessary to check whether the control you want to set actually is supported in the driver and what the valid range of values is. So use :ref:`VIDIOC_QUERYCTRL` to check this.”h]”(hŒÒIt is important to realize that due to the flexibility of controls it is necessary to check whether the control you want to set actually is supported in the driver and what the valid range of values is. So use ”…””}”(hjðh²hh³Nh´Nubh)”}”(hŒ:ref:`VIDIOC_QUERYCTRL`”h]”j\)”}”(hjúh]”hŒVIDIOC_QUERYCTRL”…””}”(hjüh²hh³Nh´Nubah}”(h]”h ]”(jgŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j[hjøubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”jŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆjzŒvidioc_queryctrl”uh1hh³hÇh´KYhjðubhŒ to check this.”…””}”(hjðh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KYhjìubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhjçubjë)”}”(hX%It is possible that some of the menu indices in a control of type ``V4L2_CTRL_TYPE_MENU`` may not be supported (``VIDIOC_QUERYMENU`` will return an error). A good example is the list of supported MPEG audio bitrates. Some drivers only support one or two bitrates, others support a wider range.”h]”hý)”}”(hX%It is possible that some of the menu indices in a control of type ``V4L2_CTRL_TYPE_MENU`` may not be supported (``VIDIOC_QUERYMENU`` will return an error). A good example is the list of supported MPEG audio bitrates. Some drivers only support one or two bitrates, others support a wider range.”h]”(hŒBIt is possible that some of the menu indices in a control of type ”…””}”(hj,h²hh³Nh´Nubj#)”}”(hŒ``V4L2_CTRL_TYPE_MENU``”h]”hŒV4L2_CTRL_TYPE_MENU”…””}”(hj4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hj,ubhŒ may not be supported (”…””}”(hj,h²hh³Nh´Nubj#)”}”(hŒ``VIDIOC_QUERYMENU``”h]”hŒVIDIOC_QUERYMENU”…””}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hj,ubhŒ¡ will return an error). A good example is the list of supported MPEG audio bitrates. Some drivers only support one or two bitrates, others support a wider range.”…””}”(hj,h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K^hj(ubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhjçubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ.”uh1jåhjáubah}”(h]”h ]”h"]”h$]”h&]”uh1jßhj>h²hh³Nh´Nubhý)”}”(hŒ$All controls use machine endianness.”h]”hŒ$All controls use machine endianness.”…””}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Kdhj>h²hubeh}”(h]”Œthe-extended-control-api”ah ]”h"]”Œthe extended control api”ah$]”h&]”uh1hÖhhØh²hh³hÇh´K(ubh×)”}”(hhh]”(hÜ)”}”(hŒEnumerating Extended Controls”h]”hŒEnumerating Extended Controls”…””}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj‹h²hh³hÇh´Khubhý)”}”(hŒšThe recommended way to enumerate over the extended controls is by using :ref:`VIDIOC_QUERYCTRL` in combination with the ``V4L2_CTRL_FLAG_NEXT_CTRL`` flag:”h]”(hŒHThe recommended way to enumerate over the extended controls is by using ”…””}”(hjœh²hh³Nh´Nubh)”}”(hŒ:ref:`VIDIOC_QUERYCTRL`”h]”j\)”}”(hj¦h]”hŒVIDIOC_QUERYCTRL”…””}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”(jgŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j[hj¤ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”j²Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆjzŒvidioc_queryctrl”uh1hh³hÇh´KjhjœubhŒ in combination with the ”…””}”(hjœh²hh³Nh´Nubj#)”}”(hŒ``V4L2_CTRL_FLAG_NEXT_CTRL``”h]”hŒV4L2_CTRL_FLAG_NEXT_CTRL”…””}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjœubhŒ flag:”…””}”(hjœh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Kjhj‹h²hubhŒ literal_block”“”)”}”(hŒ°struct v4l2_queryctrl qctrl; qctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL; while (0 == ioctl (fd, VIDIOC_QUERYCTRL, &qctrl)) { /* ... */ qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL; }”h]”hŒ°struct v4l2_queryctrl qctrl; qctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL; while (0 == ioctl (fd, VIDIOC_QUERYCTRL, &qctrl)) { /* ... */ qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL; }”…””}”hjâsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆŒforce”‰Œlanguage”j.Œhighlight_args”}”uh1jàh³hÇh´Kohj‹h²hubhý)”}”(hŒïThe initial control ID is set to 0 ORed with the ``V4L2_CTRL_FLAG_NEXT_CTRL`` flag. The ``VIDIOC_QUERYCTRL`` ioctl will return the first control with a higher ID than the specified one. When no such controls are found an error is returned.”h]”(hŒ1The initial control ID is set to 0 ORed with the ”…””}”(hjôh²hh³Nh´Nubj#)”}”(hŒ``V4L2_CTRL_FLAG_NEXT_CTRL``”h]”hŒV4L2_CTRL_FLAG_NEXT_CTRL”…””}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjôubhŒ flag. The ”…””}”(hjôh²hh³Nh´Nubj#)”}”(hŒ``VIDIOC_QUERYCTRL``”h]”hŒVIDIOC_QUERYCTRL”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjôubhŒƒ ioctl will return the first control with a higher ID than the specified one. When no such controls are found an error is returned.”…””}”(hjôh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Kyhj‹h²hubhý)”}”(hŒçIf you want to get all controls within a specific control class, then you can set the initial ``qctrl.id`` value to the control class and add an extra check to break out of the loop when a control of another control class is found:”h]”(hŒ^If you want to get all controls within a specific control class, then you can set the initial ”…””}”(hj&h²hh³Nh´Nubj#)”}”(hŒ ``qctrl.id``”h]”hŒqctrl.id”…””}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hj&ubhŒ} value to the control class and add an extra check to break out of the loop when a control of another control class is found:”…””}”(hj&h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K~hj‹h²hubjá)”}”(hŒ÷qctrl.id = V4L2_CTRL_CLASS_CODEC | V4L2_CTRL_FLAG_NEXT_CTRL; while (0 == ioctl(fd, VIDIOC_QUERYCTRL, &qctrl)) { if (V4L2_CTRL_ID2CLASS(qctrl.id) != V4L2_CTRL_CLASS_CODEC) break; /* ... */ qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL; }”h]”hŒ÷qctrl.id = V4L2_CTRL_CLASS_CODEC | V4L2_CTRL_FLAG_NEXT_CTRL; while (0 == ioctl(fd, VIDIOC_QUERYCTRL, &qctrl)) { if (V4L2_CTRL_ID2CLASS(qctrl.id) != V4L2_CTRL_CLASS_CODEC) break; /* ... */ qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL; }”…””}”hjFsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjð‰jñj.jò}”uh1jàh³hÇh´K„hj‹h²hubhý)”}”(hXWThe 32-bit ``qctrl.id`` value is subdivided into three bit ranges: the top 4 bits are reserved for flags (e. g. ``V4L2_CTRL_FLAG_NEXT_CTRL``) and are not actually part of the ID. The remaining 28 bits form the control ID, of which the most significant 12 bits define the control class and the least significant 16 bits identify the control within the control class. It is guaranteed that these last 16 bits are always non-zero for controls. The range of 0x1000 and up are reserved for driver-specific controls. The macro ``V4L2_CTRL_ID2CLASS(id)`` returns the control class ID based on a control ID.”h]”(hŒ The 32-bit ”…””}”(hjUh²hh³Nh´Nubj#)”}”(hŒ ``qctrl.id``”h]”hŒqctrl.id”…””}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjUubhŒY value is subdivided into three bit ranges: the top 4 bits are reserved for flags (e. g. ”…””}”(hjUh²hh³Nh´Nubj#)”}”(hŒ``V4L2_CTRL_FLAG_NEXT_CTRL``”h]”hŒV4L2_CTRL_FLAG_NEXT_CTRL”…””}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjUubhX}) and are not actually part of the ID. The remaining 28 bits form the control ID, of which the most significant 12 bits define the control class and the least significant 16 bits identify the control within the control class. It is guaranteed that these last 16 bits are always non-zero for controls. The range of 0x1000 and up are reserved for driver-specific controls. The macro ”…””}”(hjUh²hh³Nh´Nubj#)”}”(hŒ``V4L2_CTRL_ID2CLASS(id)``”h]”hŒV4L2_CTRL_ID2CLASS(id)”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjUubhŒ4 returns the control class ID based on a control ID.”…””}”(hjUh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KŽhj‹h²hubhý)”}”(hXdIf the driver does not support extended controls, then ``VIDIOC_QUERYCTRL`` will fail when used in combination with ``V4L2_CTRL_FLAG_NEXT_CTRL``. In that case the old method of enumerating control should be used (see :ref:`enum_all_controls`). But if it is supported, then it is guaranteed to enumerate over all controls, including driver-private controls.”h]”(hŒ7If the driver does not support extended controls, then ”…””}”(hj™h²hh³Nh´Nubj#)”}”(hŒ``VIDIOC_QUERYCTRL``”h]”hŒVIDIOC_QUERYCTRL”…””}”(hj¡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hj™ubhŒ) will fail when used in combination with ”…””}”(hj™h²hh³Nh´Nubj#)”}”(hŒ``V4L2_CTRL_FLAG_NEXT_CTRL``”h]”hŒV4L2_CTRL_FLAG_NEXT_CTRL”…””}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hj™ubhŒI. In that case the old method of enumerating control should be used (see ”…””}”(hj™h²hh³Nh´Nubh)”}”(hŒ:ref:`enum_all_controls`”h]”j\)”}”(hjÇh]”hŒenum_all_controls”…””}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”(jgŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j[hjÅubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”jÓŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆjzŒenum_all_controls”uh1hh³hÇh´K˜hj™ubhŒs). But if it is supported, then it is guaranteed to enumerate over all controls, including driver-private controls.”…””}”(hj™h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K˜hj‹h²hubeh}”(h]”Œenumerating-extended-controls”ah ]”h"]”Œenumerating extended controls”ah$]”h&]”uh1hÖhhØh²hh³hÇh´Khubh×)”}”(hhh]”(hÜ)”}”(hŒCreating Control Panels”h]”hŒCreating Control Panels”…””}”(hjúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj÷h²hh³hÇh´K¡ubhý)”}”(hX¢It is possible to create control panels for a graphical user interface where the user can select the various controls. Basically you will have to iterate over all controls using the method described above. Each control class starts with a control of type ``V4L2_CTRL_TYPE_CTRL_CLASS``. ``VIDIOC_QUERYCTRL`` will return the name of this control class which can be used as the title of a tab page within a control panel.”h]”(hŒÿIt is possible to create control panels for a graphical user interface where the user can select the various controls. Basically you will have to iterate over all controls using the method described above. Each control class starts with a control of type ”…””}”(hjh²hh³Nh´Nubj#)”}”(hŒ``V4L2_CTRL_TYPE_CTRL_CLASS``”h]”hŒV4L2_CTRL_TYPE_CTRL_CLASS”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjubhŒ. ”…””}”(hjh²hh³Nh´Nubj#)”}”(hŒ``VIDIOC_QUERYCTRL``”h]”hŒVIDIOC_QUERYCTRL”…””}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j"hjubhŒp will return the name of this control class which can be used as the title of a tab page within a control panel.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K£hj÷h²hubhý)”}”(hŒ´The flags field of struct :ref:`v4l2_queryctrl ` also contains hints on the behavior of the control. See the :ref:`VIDIOC_QUERYCTRL` documentation for more details.”h]”(hŒThe flags field of struct ”…””}”(hj:h²hh³Nh´Nubh)”}”(hŒ&:ref:`v4l2_queryctrl `”h]”j\)”}”(hjDh]”hŒv4l2_queryctrl”…””}”(hjFh²hh³Nh´Nubah}”(h]”h ]”(jgŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j[hjBubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”jPŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjzŒv4l2-queryctrl”uh1hh³hÇh´K«hj:ubhŒ= also contains hints on the behavior of the control. See the ”…””}”(hj:h²hh³Nh´Nubh)”}”(hŒ:ref:`VIDIOC_QUERYCTRL`”h]”j\)”}”(hjhh]”hŒVIDIOC_QUERYCTRL”…””}”(hjjh²hh³Nh´Nubah}”(h]”h ]”(jgŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j[hjfubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jtŒ refdomain”jtŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆjzŒvidioc_queryctrl”uh1hh³hÇh´K«hj:ubhŒ documentation for more details.”…””}”(hj:h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K«hj÷h²hubeh}”(h]”Œcreating-control-panels”ah ]”h"]”Œcreating control panels”ah$]”h&]”uh1hÖhhØh²hh³hÇh´K¡ubeh}”(h]”(Œextended-controls-api”hÕeh ]”h"]”(Œextended controls api”Œextended-controls”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”}”Œrefids”}”hÕ]”hÊasŒnameids”}”(jžhÕjjšj;j8jˆj…jôjñj•j’uŒ nametypes”}”(jžˆj‰j;‰jˆ‰jô‰j•‰uh}”(hÕhØjšhØj8hëj…j>jñj‹j’j÷uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”hŒsystem_message”“”)”}”(hhh]”hý)”}”(hhh]”hŒ7Hyperlink target "extended-controls" is not referenced.”…””}”hj2sbah}”(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.