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/.
7.8. ioctl VIDIOC_DQEVENT¶
7.8.1. Tên¶
VIDIOC_DQEVENT - Sự kiện xếp hàng
7.8.2. Tóm tắt¶
-
VIDIOC_DQEVENT¶
ZZ0000ZZ
7.8.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.8.4. Sự miêu tả¶
Sắp xếp lại một sự kiện từ thiết bị video. Không cần đầu vào cho việc này ioctl. Tất cả các trường của cấu trúc ZZ0000ZZ cấu trúc được lấp đầy bởi người lái xe. Việc xử lý tập tin cũng sẽ nhận được các trường hợp ngoại lệ mà ứng dụng có thể nhận được, ví dụ: sử dụng hệ thống chọn lọc gọi.
-
type v4l2_event¶
__u32 |
|
Type of the event, see Event Types. |
union { |
|
|
struct |
|
Event data for event |
struct |
|
Event data for event |
struct |
|
Event data for event |
struct |
|
Event data for event V4L2_EVENT_MOTION_DET. |
struct |
|
Event data for event V4L2_EVENT_SOURCE_CHANGE. |
__u8 |
|
Event data. Defined by the event type. The |
} |
||
__u32 |
|
Number of pending events excluding this one. |
__u32 |
|
Event sequence number. The sequence number is incremented for every subscribed event that takes place. If sequence numbers are not contiguous it means that events have been lost. |
|
|
Event timestamp. The timestamp has been taken from the
|
u32 |
|
The ID associated with the event source. If the event does not have an associated ID (this depends on the event type), then this is 0. |
__u32 |
|
Reserved for future extensions. Drivers must set the array to zero. |
|
0 |
All events. V4L2_EVENT_ALL is valid only for VIDIOC_UNSUBSCRIBE_EVENT for unsubscribing all events at once. |
|
1 |
This event is triggered on the vertical sync. This event has a
struct |
|
2 |
This event is triggered when the end of a stream is reached. This is typically used with MPEG decoders to report to the application when the last of the MPEG stream has been decoded. |
|
3 |
This event requires that the If the event is generated due to a call to
VIDIOC_S_CTRL or
VIDIOC_S_EXT_CTRLS, then the
event will not be sent to the file handle that called the ioctl
function. This prevents nasty feedback loops. If you do want to
get the event, then set the This event type will ensure that no information is lost when more
events are raised than there is room internally. In that case the
struct |
|
4 |
Triggered immediately when the reception of a frame has begun.
This event has a struct
If the hardware needs to be stopped in the case of a buffer
underrun it might not be able to generate this event. In such
cases the |
|
5 |
This event is triggered when a source parameter change is detected
during runtime by the video device. It can be a runtime resolution
change triggered by a video decoder or the format change happening
on an input connector. This event requires that the This event has a struct
|
|
6 |
Triggered whenever the motion detection state for one or more of
the regions changes. This event has a struct
|
|
0x08000000 |
Base event number for driver-private events. |
-
type v4l2_event_vsync¶
__u8 |
|
The upcoming field. See enum |
-
type v4l2_event_ctrl¶
__u32 |
|
A bitmask that tells what has changed. See Control Changes. |
__u32 |
|
The type of the control. See enum
|
union { |
(anonymous) |
|
__s32 |
|
The 32-bit value of the control for 32-bit control types. This is 0 for string controls since the value of a string cannot be passed using ioctl VIDIOC_DQEVENT. |
__s64 |
|
The 64-bit value of the control for 64-bit control types. |
} |
||
__u32 |
|
The control flags. See Control Flags. |
__s32 |
|
The minimum value of the control. See struct v4l2_queryctrl. |
__s32 |
|
The maximum value of the control. See struct v4l2_queryctrl. |
__s32 |
|
The step value of the control. See struct v4l2_queryctrl. |
__s32 |
|
The default value of the control. See struct v4l2_queryctrl. |
-
type v4l2_event_frame_sync¶
__u32 |
|
The sequence number of the frame being received. |
-
type v4l2_event_src_change¶
__u32 |
|
A bitmask that tells what has changed. See Source Changes. |
-
type v4l2_event_motion_det¶
__u32 |
|
Currently only one flag is available: if
|
__u32 |
|
The sequence number of the frame being received. Only valid if the
|
__u32 |
|
The bitmask of the regions that reported motion. There is at least
one region. If this field is 0, then no motion was detected at
all. If there is no |
|
0x0001 |
This control event was triggered because the value of the control
changed. Special cases: Volatile controls do no generate this
event; If a control has the |
|
0x0002 |
This control event was triggered because the control flags changed. |
|
0x0004 |
This control event was triggered because the minimum, maximum, step or the default value of the control changed. |
|
0x0008 |
This control event was triggered because the dimensions of the control changed. Note that the number of dimensions remains the same. |
|
0x0001 |
This event gets triggered when a resolution change is detected at an input. This can come from an input connector or from a video decoder. Applications will have to query the new resolution (if any, the signal may also have been lost). For stateful decoders follow the guidelines in Memory-to-Memory Stateful Video Decoder Interface. Video Capture devices have to query the new timings using ioctl VIDIOC_QUERY_DV_TIMINGS or VIDIOC_QUERYSTD. Important: even if the new video timings appear identical to the old ones, receiving this event indicates that there was an issue with the video signal and you must stop and restart streaming (VIDIOC_STREAMOFF followed by VIDIOC_STREAMON). The reason is that many Video Capture devices are not able to recover from a temporary loss of signal and so restarting streaming I/O is required in order for the hardware to synchronize to the video signal. |
7.8.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.