1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2024 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use BorrowedFd;
/// Trait allowing sessions of a device to signal when they have an event pending.
///
/// The worker that runs a `V4l2ProxyDevice` typically polls on file descriptors for available
/// CAPTURE buffers and outstanding session events. However V4L2's poll logic returns with the
/// `POLLERR` flag if a CAPTURE queue is polled while not streaming or if zero CAPTURE buffers have
/// been queued. To avoid this, the device needs to disable polling when this would happen, and
/// re-enable it when conditions are adequate.
///
/// If the worker does not need such a feature, `()` can be passed as a no-op type that implements
/// this interface.
/// No-op implementation of `SessionPoller`. This should only be used when using
/// `VirtioMediaDeviceRunner` with a device that doesn't need to be polled, otherwise the methods
/// might be called, which will make the program panic.