#include <icy/av/devicemanager.h>Represents a system audio, video or render device.
| Return | Name | Description |
|---|---|---|
Type | type | |
std::string | id | |
std::string | name | |
bool | isDefault | |
bool | isConnected | |
bool | isInUse | |
std::vector< VideoCapability > | videoCapabilities | |
std::vector< AudioCapability > | audioCapabilities |
Type type {}std::string idstd::string namebool isDefault {false}bool isConnected {true}bool isInUse {false}std::vector< VideoCapability > videoCapabilitiesstd::vector< AudioCapability > audioCapabilities| Return | Name | Description |
|---|---|---|
Device | Construct a device with Unknown type and empty fields. | |
Device | Construct a device with explicit fields. | |
void | print const | Print device details (type, id, name, capabilities) to the given stream. |
bool | operator== const inline | Equality based on type, id, and name. |
VideoCapability | bestVideoCapability const inline | Find the video capability closest to the requested parameters. |
AudioCapability | bestAudioCapability const inline | Find the audio capability closest to the requested parameters. |
Device()Construct a device with Unknown type and empty fields.
Device(Type type, const std::string & id, const std::string & name, bool isDefault)Construct a device with explicit fields.
type The device type (VideoInput, AudioInput, etc.).
id The platform-specific device identifier.
name The human-readable device name.
isDefault True if this is the system default device of its type.
const
void print(std::ostream & os) constPrint device details (type, id, name, capabilities) to the given stream.
os The output stream to write to.const inline
inline bool operator==(const Device & that) constEquality based on type, id, and name.
const inline
inline VideoCapability bestVideoCapability(int width, int height, double fps) constFind the video capability closest to the requested parameters.
Scoring: resolution match weighted 70%, fps match weighted 30%. Both dimensions are normalised to [0,1] so the weights are meaningful. Prefers capabilities that are >= the requested resolution (upscaling is worse than slight downscaling).
Returns a default capability with the requested values if none are available (allows callers to skip the empty check).
const inline
inline AudioCapability bestAudioCapability(int sampleRate, int channels) constFind the audio capability closest to the requested parameters.
Scoring: sample rate match weighted 70%, channel count weighted 30%. Both dimensions are normalised to [0,1].
Returns a default capability with the requested values if none are available.
| Name | Description |
|---|---|
Type |
enum Type| Value | Description |
|---|---|
Unknown | |
VideoInput | |
VideoOutput | |
AudioInput | |
AudioOutput |