Lazy range that probes every compiled device type.
More...
#include <hwcontext.h>
|
| class | iterator |
| | Forward iterator that creates and destroys one device per step. More...
|
A probe creates a temporary device context and destroys it immediately. Availability is reported per type. Creation is the only reliable check: av_hwdevice_iterate_types() lists compiled backends, not present hardware.
- Parameters
-
| device | Backend-specific device selector passed to av_hwdevice_ctx_create(). It is a string and not std::filesystem::path on purpose: the value identifies a device, and it is not necessarily a node in the filesystem. Depending on the backend it can be:
- a filesystem path (VAAPI, DRM: "/dev/dri/renderD128");
- a numeric index (CUDA: "1");
- a display or adapter name (D3D11VA, VideoToolbox);
- an empty string or nullptr for the default device. A path type would wrongly imply a filesystem node and cannot represent the other forms.
|
- Note
- The const char* overload borrows the pointer. The caller must keep the string alive for the whole iteration. The std::string overload stores a copy inside the range.
- See also
- isDeviceAvailable(), allDeviceTypes()
◆ DeviceProbeRange() [1/4]
| av::hw::DeviceProbeRange::DeviceProbeRange |
( |
const char * | device | ) |
|
|
inlineexplicitnoexcept |
- Parameters
-
| device | backend-specific selector; must outlive the range |
◆ DeviceProbeRange() [2/4]
| av::hw::DeviceProbeRange::DeviceProbeRange |
( |
const std::string & | device | ) |
|
|
inlineexplicit |
- Parameters
-
| device | backend-specific selector; a copy is kept |
◆ DeviceProbeRange() [3/4]
| av::hw::DeviceProbeRange::DeviceProbeRange |
( |
const DeviceProbeRange & | other | ) |
|
|
inline |
◆ DeviceProbeRange() [4/4]
| av::hw::DeviceProbeRange::DeviceProbeRange |
( |
DeviceProbeRange && | other | ) |
|
|
inlinenoexcept |
- Parameters
-
| other | the range to move from; left empty |
◆ begin()
| iterator av::hw::DeviceProbeRange::begin |
( |
| ) |
const |
|
inline |
- Returns
- an iterator at the first compiled type, already probed
◆ end()
| iterator av::hw::DeviceProbeRange::end |
( |
| ) |
const |
|
inline |
- Returns
- the past-the-end iterator
◆ operator=()
- Parameters
-
| other | the range to assign from |
- Returns
- this range
◆ swap()
- Parameters
-
| other | the range to swap with |
The documentation for this class was generated from the following file: