€•a-Œ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”ŒE/translations/zh_CN/userspace-api/media/v4l/selection-api-vs-crop-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”ŒE/translations/zh_TW/userspace-api/media/v4l/selection-api-vs-crop-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”ŒE/translations/it_IT/userspace-api/media/v4l/selection-api-vs-crop-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”ŒE/translations/ja_JP/userspace-api/media/v4l/selection-api-vs-crop-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”ŒE/translations/ko_KR/userspace-api/media/v4l/selection-api-vs-crop-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”ŒE/translations/pt_BR/userspace-api/media/v4l/selection-api-vs-crop-api”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”ŒE/translations/sp_SP/userspace-api/media/v4l/selection-api-vs-crop-api”Œ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³Œ_/var/lib/git/docbuild/linux/Documentation/userspace-api/media/v4l/selection-api-vs-crop-api.rst”h´KubhŒtarget”“”)”}”(hŒ.. _selection-vs-crop:”h]”h}”(h]”h ]”h"]”h$]”h&]”Œrefid”Œselection-vs-crop”uh1hÈh´Khhh²hh³hÇubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ Comparison with old cropping API”h]”hŒ Comparison with old cropping API”…””}”(hhÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhhØh²hh³hÇh´KubhŒ paragraph”“”)”}”(hXThe selection API was introduced to cope with deficiencies of the older :ref:`CROP API `, that was designed to control simple capture devices. Later the cropping API was adopted by video output drivers. The ioctls are used to select a part of the display were the video signal is inserted. It should be considered as an API abuse because the described operation is actually the composing. The selection API makes a clear distinction between composing and cropping operations by setting the appropriate targets.”h]”(hŒHThe selection API was introduced to cope with deficiencies of the older ”…””}”(hhíh²hh³Nh´Nubh)”}”(hŒ:ref:`CROP API `”h]”hŒinline”“”)”}”(hh÷h]”hŒCROP API”…””}”(hhûh²hh³Nh´Nubah}”(h]”h ]”(Œxref”Œstd”Œstd-ref”eh"]”h$]”h&]”uh1hùhhõubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œ1userspace-api/media/v4l/selection-api-vs-crop-api”Œ refdomain”jŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆŒ reftarget”Œcrop”uh1hh³hÇh´K hhíubhX¦, that was designed to control simple capture devices. Later the cropping API was adopted by video output drivers. The ioctls are used to select a part of the display were the video signal is inserted. It should be considered as an API abuse because the described operation is actually the composing. The selection API makes a clear distinction between composing and cropping operations by setting the appropriate targets.”…””}”(hhíh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K hhØh²hubhì)”}”(hXyThe CROP API lacks any support for composing to and cropping from an image inside a memory buffer. The application could configure a capture device to fill only a part of an image by abusing V4L2 API. Cropping a smaller image from a larger one is achieved by setting the field ``bytesperline`` at struct :c:type:`v4l2_pix_format`. Introducing an image offsets could be done by modifying field ``m_userptr`` at struct :c:type:`v4l2_buffer` before calling :ref:`VIDIOC_QBUF `. Those operations should be avoided because they are not portable (endianness), and do not work for macroblock and Bayer formats and mmap buffers.”h]”(hXThe CROP API lacks any support for composing to and cropping from an image inside a memory buffer. The application could configure a capture device to fill only a part of an image by abusing V4L2 API. Cropping a smaller image from a larger one is achieved by setting the field ”…””}”(hj$h²hh³Nh´NubhŒliteral”“”)”}”(hŒ``bytesperline``”h]”hŒ bytesperline”…””}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j,hj$ubhŒ at struct ”…””}”(hj$h²hh³Nh´Nubh)”}”(hŒ:c:type:`v4l2_pix_format`”h]”j-)”}”(hjBh]”hŒv4l2_pix_format”…””}”(hjDh²hh³Nh´Nubah}”(h]”h ]”(jŒc”Œc-type”eh"]”h$]”h&]”uh1j,hj@ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jNŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰Œ c:parent_key”Œsphinx.domains.c”Œ LookupKey”“”)”}”Œdata”]”j`Œ ASTIdentifier”“”)”}”Œ identifier”ŒV4L”sbN†”asbjŒv4l2_pix_format”uh1hh³hÇh´Khj$ubhŒ@. Introducing an image offsets could be done by modifying field ”…””}”(hj$h²hh³Nh´Nubj-)”}”(hŒ ``m_userptr``”h]”hŒ m_userptr”…””}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j,hj$ubhŒ at struct ”…””}”hj$sbh)”}”(hŒ:c:type:`v4l2_buffer`”h]”j-)”}”(hj‡h]”hŒ v4l2_buffer”…””}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”(jjNŒc-type”eh"]”h$]”h&]”uh1j,hj…ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jNŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰j_jcjŒ v4l2_buffer”uh1hh³hÇh´Khj$ubhŒ before calling ”…””}”(hj$h²hh³Nh´Nubh)”}”(hŒ :ref:`VIDIOC_QBUF `”h]”hú)”}”(hjªh]”hŒ VIDIOC_QBUF”…””}”(hj¬h²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hùhj¨ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j¶Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒ vidioc_qbuf”uh1hh³hÇh´Khj$ubhŒ“. Those operations should be avoided because they are not portable (endianness), and do not work for macroblock and Bayer formats and mmap buffers.”…””}”(hj$h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KhhØh²hubhì)”}”(hXÃThe selection API deals with configuration of buffer cropping/composing in a clear, intuitive and portable way. Next, with the selection API the concepts of the padded target and constraints flags are introduced. Finally, struct :c:type:`v4l2_crop` and struct :c:type:`v4l2_cropcap` have no reserved fields. Therefore there is no way to extend their functionality. The new struct :c:type:`v4l2_selection` provides a lot of place for future extensions.”h]”(hŒåThe selection API deals with configuration of buffer cropping/composing in a clear, intuitive and portable way. Next, with the selection API the concepts of the padded target and constraints flags are introduced. Finally, struct ”…””}”(hjÒh²hh³Nh´Nubh)”}”(hŒ:c:type:`v4l2_crop`”h]”j-)”}”(hjÜh]”hŒ v4l2_crop”…””}”(hjÞh²hh³Nh´Nubah}”(h]”h ]”(jjNŒc-type”eh"]”h$]”h&]”uh1j,hjÚubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jNŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰j_jcjŒ v4l2_crop”uh1hh³hÇh´KhjÒubhŒ and struct ”…””}”(hjÒh²hh³Nh´Nubh)”}”(hŒ:c:type:`v4l2_cropcap`”h]”j-)”}”(hjÿh]”hŒ v4l2_cropcap”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”(jjNŒc-type”eh"]”h$]”h&]”uh1j,hjýubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jNŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰j_jcjŒ v4l2_cropcap”uh1hh³hÇh´KhjÒubhŒb have no reserved fields. Therefore there is no way to extend their functionality. The new struct ”…””}”(hjÒh²hh³Nh´Nubh)”}”(hŒ:c:type:`v4l2_selection`”h]”j-)”}”(hj"h]”hŒv4l2_selection”…””}”(hj$h²hh³Nh´Nubah}”(h]”h ]”(jjNŒc-type”eh"]”h$]”h&]”uh1j,hj ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jNŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰j_jcjŒv4l2_selection”uh1hh³hÇh´KhjÒubhŒ/ provides a lot of place for future extensions.”…””}”(hjÒh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KhhØh²hubhì)”}”(hŒDriver developers are encouraged to implement only selection API. The former cropping API would be simulated using the new one.”h]”hŒDriver developers are encouraged to implement only selection API. The former cropping API would be simulated using the new one.”…””}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K'hhØh²hubeh}”(h]”(Œ comparison-with-old-cropping-api”hÕeh ]”h"]”(Œ comparison with old cropping api”Œselection-vs-crop”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Õj\jYuŒ nametypes”}”(j]ˆj\‰uh}”(hÕhØjYhØ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 "selection-vs-crop" 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.