Vietnamese (machine translation)

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:

ioctl VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT

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/.

7.66. ioctl VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT

7.66.1. Tên

VIDIOC_SUBSCRIBE_EVENT - VIDIOC_UNSUBSCRIBE_EVENT - Đăng ký hoặc hủy đăng ký sự kiện

7.66.2. Tóm tắt

VIDIOC_SUBSCRIBE_EVENT

ZZ0000ZZ

VIDIOC_UNSUBSCRIBE_EVENT

ZZ0000ZZ

7.66.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.

7.66.4. Sự miêu tả

Đăng ký hoặc hủy đăng ký sự kiện V4L2. Các sự kiện đã đăng ký được loại bỏ bởi sử dụng ZZ0000ZZ ioctl.

type v4l2_event_subscription
struct v4l2_event_subscription

__u32

type

Type of the event, see Event Types.

Lưu ý

V4L2_EVENT_ALL can be used with VIDIOC_UNSUBSCRIBE_EVENT for unsubscribing all events at once.

__u32

id

ID of the event source. If there is no ID associated with the event source, then set this to 0. Whether or not an event needs an ID depends on the event type.

__u32

flags

Event flags, see Event Flags.

__u32

reserved[5]

Reserved for future extensions. Drivers and applications must set the array to zero.

Event Flags

V4L2_EVENT_SUB_FL_SEND_INITIAL

0x0001

When this event is subscribed an initial event will be sent containing the current status. This only makes sense for events that are triggered by a status change such as V4L2_EVENT_CTRL. Other events will ignore this flag.

V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK

0x0002

If set, then events directly caused by an ioctl will also be sent to the filehandle that called that ioctl. For example, changing a control using VIDIOC_S_CTRL will cause a V4L2_EVENT_CTRL to be sent back to that same filehandle. Normally such events are suppressed to prevent feedback loops where an application changes a control to a one value and then another, and then receives an event telling it that that control has changed to the first value.

Since it can’t tell whether that event was caused by another application or by the VIDIOC_S_CTRL call it is hard to decide whether to set the control to the value in the event, or ignore it.

Think carefully when you set this flag so you won’t get into situations like that.

7.66.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.