← Documents Documentation/userspace-api/media/v4l/querycap.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / V4L

V4L2 기능 조회

VIDIOC_QUERYCAP으로 장치 호환성과 기능을 확인하는 원칙을 설명합니다.

Source pathDocumentation/userspace-api/media/v4l/querycap.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

querycap.rst:1-34

VIDIOC_QUERYCAP으로 장치 호환성과 기능을 확인하는 원칙을 설명합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2
3 .. _querycap:
4
5 *********************
6 Querying Capabilities
7 *********************
8
9 Because V4L2 covers a wide variety of devices not all aspects of the API
10 are equally applicable to all types of devices. Furthermore devices of
11 the same type have different capabilities and this specification permits
12 the omission of a few complicated and less important parts of the API.
13
14 The :ref:`VIDIOC_QUERYCAP` ioctl is available to
15 check if the kernel device is compatible with this specification, and to
16 query the :ref:`functions <devices>` and :ref:`I/O methods <io>`
17 supported by the device.
18
19 Starting with kernel version 3.1, :ref:`VIDIOC_QUERYCAP`
20 will return the V4L2 API version used by the driver, with generally
21 matches the Kernel version. There's no need of using
22 :ref:`VIDIOC_QUERYCAP` to check if a specific ioctl
23 is supported, the V4L2 core now returns ``ENOTTY`` if a driver doesn't
24 provide support for an ioctl.
25
26 Other features can be queried by calling the respective ioctl, for
27 example :ref:`VIDIOC_ENUMINPUT` to learn about the
28 number, types and names of video connectors on the device. Although
29 abstraction is a major objective of this API, the
30 :ref:`VIDIOC_QUERYCAP` ioctl also allows driver
31 specific applications to reliably identify the driver.
32
33 All V4L2 drivers must support :ref:`VIDIOC_QUERYCAP`.
34 Applications should always call this ioctl after opening the device.
35

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

장치 호환성과 기능 확인

1-24

V4L2는 매우 다양한 장치를 포괄하므로 API의 모든 부분이 모든 장치에 똑같이 적용되지는 않습니다. 같은 종류의 장치도 기능이 다르며, 명세는 복잡하고 덜 중요한 일부 API를 생략할 수 있게 합니다.

`VIDIOC_QUERYCAP` ioctl은 커널 장치가 이 명세와 호환되는지 확인하고, 장치가 제공하는 기능과 I/O 방법을 조회합니다. 커널 3.1부터 드라이버가 사용하는 V4L2 API 버전도 반환하며 대체로 커널 버전과 일치합니다. 개별 ioctl 지원 여부는 호출 결과로 확인하면 됩니다. 드라이버가 지원하지 않으면 V4L2 코어가 `ENOTTY`를 반환합니다.

장치 개방 직후 확인
장치를 연 뒤 항상 `VIDIOC_QUERYCAP`을 호출합니다.반환된 장치 기능과 지원 I/O 방법을 확인합니다.개별 ioctl은 직접 호출하고 `ENOTTY`로 미지원 여부를 판단합니다.

기능 비트와 실제 ioctl 결과를 역할별로 사용합니다.

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later

.. _querycap:

*********************
Querying Capabilities
*********************

Because V4L2 covers a wide variety of devices not all aspects of the API
are equally applicable to all types of devices. Furthermore devices of
the same type have different capabilities and this specification permits
the omission of a few complicated and less important parts of the API.

The :ref:`VIDIOC_QUERYCAP` ioctl is available to
check if the kernel device is compatible with this specification, and to
query the :ref:`functions <devices>` and :ref:`I/O methods <io>`
supported by the device.

Starting with kernel version 3.1, :ref:`VIDIOC_QUERYCAP`
will return the V4L2 API version used by the driver, with generally
matches the Kernel version. There's no need of using
:ref:`VIDIOC_QUERYCAP` to check if a specific ioctl
is supported, the V4L2 core now returns ``ENOTTY`` if a driver doesn't
provide support for an ioctl.

다른 기능의 열거와 드라이버 식별

25-34

그 밖의 기능은 해당 ioctl로 조회합니다. 예를 들어 `VIDIOC_ENUMINPUT`은 비디오 커넥터의 수, 유형과 이름을 알려 줍니다.

API가 장치 추상화를 목표로 하더라도 `VIDIOC_QUERYCAP`은 드라이버 전용 애플리케이션이 드라이버를 신뢰성 있게 식별하도록 지원합니다. 모든 V4L2 드라이버는 이 ioctl을 지원해야 하며 애플리케이션은 장치를 연 직후 항상 호출해야 합니다.


Other features can be queried by calling the respective ioctl, for
example :ref:`VIDIOC_ENUMINPUT` to learn about the
number, types and names of video connectors on the device. Although
abstraction is a major objective of this API, the
:ref:`VIDIOC_QUERYCAP` ioctl also allows driver
specific applications to reliably identify the driver.

All V4L2 drivers must support :ref:`VIDIOC_QUERYCAP`.
Applications should always call this ioctl after opening the device.