Lưu ý
Mục đích của file này là để độc giả tiếng Việt có thể đọc và hiểu tài liệu nhân kernel dễ dàng hơn, không phải để tạo ra một nhánh tài liệu riêng. Nếu bạn có bất kỳ nhận xét hoặc cập nhật nào cho file này, vui lòng thử cập nhật file tiếng Anh gốc trước. Nếu bạn thấy có sự khác biệt giữa bản dịch và bản gốc, hoặc có vấn đề về bản dịch, vui lòng gửi góp ý hoặc patch cho người dịch của file này, hoặc nhờ người bảo trì và người review tài liệu tiếng Việt giúp đỡ.
- Bản gốc:
- Người dịch:
Google Translate (machine translation)
- Phiên bản gốc:
8541d8f725c6
Cảnh báo
Tài liệu này được dịch tự động bằng máy và chưa được review bởi người dịch. Nội dung có thể không chính xác hoặc khó hiểu ở một số chỗ. Khi có sự khác biệt với bản gốc, bản gốc luôn là chuẩn. Bản dịch chất lượng cao (được review) được đặt trong thư mục vi_VN/.
5.5. ioctl MEDIA_IOC_G_TOPOLOGY¶
5.5.1. Tên¶
MEDIA_IOC_G_TOPOLOGY - Liệt kê các thuộc tính cấu trúc liên kết đồ thị và phần tử đồ thị
5.5.2. Tóm tắt¶
-
MEDIA_IOC_G_TOPOLOGY¶
ZZ0000ZZ
5.5.3. Đối số¶
- ZZ0001ZZ
Bộ mô tả tệp được trả về bởi ZZ0000ZZ.
- ZZ0001ZZ
Con trỏ tới cấu trúc ZZ0000ZZ.
5.5.4. Sự miêu tả¶
Cách sử dụng điển hình của ioctl này là gọi nó hai lần. Trong cuộc gọi đầu tiên,
cấu trúc được xác định tại struct
ZZ0000ZZ phải bằng 0. Tại
return, nếu không có lỗi xảy ra thì ioctl này sẽ trả về
ZZ0001ZZ và tổng số thực thể, giao diện, miếng đệm
và liên kết.
Trước lệnh gọi thứ hai, không gian người dùng sẽ phân bổ các mảng để lưu trữ các phần tử đồ thị mong muốn, đặt con trỏ tới chúng ở vị trí ptr_entities, ptr_interfaces, ptr_links và/hoặc ptr_pads, giữ nguyên các giá trị khác không bị ảnh hưởng.
Nếu ZZ0000ZZ vẫn giữ nguyên, ioctl sẽ điền vào mảng mong muốn với các phần tử biểu đồ phương tiện.
-
type media_v2_topology¶
__u64 |
|
Version of the media graph topology. When the graph is created, this field starts with zero. Every time a graph element is added or removed, this field is incremented. |
__u32 |
|
Number of entities in the graph |
__u32 |
|
Applications and drivers shall set this to 0. |
__u64 |
|
A pointer to a memory area where the entities array will be
stored, converted to a 64-bits integer. It can be zero. if zero,
the ioctl won’t store the entities. It will just update
|
__u32 |
|
Number of interfaces in the graph |
__u32 |
|
Applications and drivers shall set this to 0. |
__u64 |
|
A pointer to a memory area where the interfaces array will be
stored, converted to a 64-bits integer. It can be zero. if zero,
the ioctl won’t store the interfaces. It will just update
|
__u32 |
|
Total number of pads in the graph |
__u32 |
|
Applications and drivers shall set this to 0. |
__u64 |
|
A pointer to a memory area where the pads array will be stored,
converted to a 64-bits integer. It can be zero. if zero, the ioctl
won’t store the pads. It will just update |
__u32 |
|
Total number of data and interface links in the graph |
__u32 |
|
Applications and drivers shall set this to 0. |
__u64 |
|
A pointer to a memory area where the links array will be stored,
converted to a 64-bits integer. It can be zero. if zero, the ioctl
won’t store the links. It will just update |
-
type media_v2_entity¶
__u32 |
|
Unique ID for the entity. Do not expect that the ID will always be the same for each instance of the device. In other words, do not hardcode entity IDs in an application. |
char |
|
Entity name as an UTF-8 NULL-terminated string. This name must be unique within the media topology. |
__u32 |
|
Entity main function, see Media entity functions for details. |
__u32 |
|
Entity flags, see Media entity flags for details.
Only valid if |
__u32 |
|
Reserved for future extensions. Drivers and applications must set this array to zero. |
-
type media_v2_interface¶
__u32 |
|
Unique ID for the interface. Do not expect that the ID will always be the same for each instance of the device. In other words, do not hardcode interface IDs in an application. |
__u32 |
|
Interface type, see Media interface types for details. |
__u32 |
|
Interface flags. Currently unused. |
__u32 |
|
Reserved for future extensions. Drivers and applications must set this array to zero. |
|
Used only for device node interfaces. See
|
-
type media_v2_intf_devnode¶
__u32 |
|
Device node major number. |
__u32 |
|
Device node minor number. |
-
type media_v2_pad¶
__u32 |
|
Unique ID for the pad. Do not expect that the ID will always be the same for each instance of the device. In other words, do not hardcode pad IDs in an application. |
__u32 |
|
Unique ID for the entity where this pad belongs. |
__u32 |
|
Pad flags, see Media pad flags for more details. |
__u32 |
|
Pad index, starts at 0. Only valid if |
__u32 |
|
Reserved for future extensions. Drivers and applications must set this array to zero. |
-
type media_v2_link¶
__u32 |
|
Unique ID for the link. Do not expect that the ID will always be the same for each instance of the device. In other words, do not hardcode link IDs in an application. |
__u32 |
|
On pad to pad links: unique ID for the source pad. On interface to entity links: unique ID for the interface. |
__u32 |
|
On pad to pad links: unique ID for the sink pad. On interface to entity links: unique ID for the entity. |
__u32 |
|
Link flags, see Media link flags for more details. |
__u32 |
|
Reserved for future extensions. Drivers and applications must set this array to zero. |
5.5.5. Giá trị trả về¶
Khi thành công, trả về 0, lỗi -1 và biến ZZ0001ZZ được đặt một cách thích hợp. Các mã lỗi chung được mô tả tại Chương ZZ0000ZZ.
- ENOSPC
Điều này được trả về khi một hoặc nhiều trong số num_entities, num_interfaces, num_links hoặc num_pads khác 0 và là nhỏ hơn số phần tử thực tế bên trong biểu đồ. Cái này có thể xảy ra nếu ZZ0000ZZ thay đổi khi so sánh với lần trước ioctl này đã được gọi. Không gian người dùng thường sẽ giải phóng khu vực dành cho con trỏ, bỏ phần tử cấu trúc về 0 và gọi đây là ioctl một lần nữa.