NatDevice
Search…
⌃K

MediaDeviceCriteria

static class NatML.Devices.MediaDeviceCriteria
NatDevice includes a set of pre-defined filters which are commonly used to discover devices.

Media Type

Audio Devices

/// <summary>
/// Filter for hardware audio devices.
/// </summary>
static Predicate<IMediaDevice> AudioDevice { get; }
This will filter for AudioDevice instances.

Camera Devices

/// <summary>
/// Filter for hardware camera devices.
/// </summary>
static Predicate<IMediaDevice> CameraDevice { get; }
This will filter for CameraDevice instances.

Device Location

Internal Devices

/// <summary>
/// Filter for internal devices.
/// </summary>
static Predicate<IMediaDevice> Internal { get; }
This will filter for internal media devices.

External Devices

/// <summary>
/// Filter for external devices.
/// </summary>
static Predicate<IMediaDevice> External { get; }
This will filter for external media devices.

Default Device

/// <summary>
/// Filter for default devices for their respective media types.
/// </summary>
static Predicate<IMediaDevice> Default { get; }
This will filter for devices that are marked as being the defaultForMediaType.
For a given media device type, a default device is not guaranteed to exist. As a result, do not expect to always discover a default device.

Audio Devices

Echo Cancellation

/// <summary>
/// Filter for audio devices that perform echo cancellation.
/// </summary>
static Predicate<IMediaDevice> EchoCancellation { get; }
This will filter for audio devices that perform echo cancellation.

Camera Devices

Rear Facing Cameras

/// <summary>
/// Filter for rear-facing camera devices.
/// </summary>
static Predicate<IMediaDevice> RearCamera { get; }
This will filter for camera devices that are rear-facing.

Front Facing Cameras

/// <summary>
/// Filter for front-facing camera devices.
/// </summary>
static Predicate<IMediaDevice> FrontCamera { get; }
This will filter for camera devices that are front-facing.

Torch Enabled Cameras

/// <summary>
/// Filter for camera devices that have torches.
/// </summary>
static Predicate<IMediaDevice> Torch { get; }
This will filter for camera devices that possess torch units.

Combining Criteria

Any

/// <summary>
/// Filter for devices that meet any of the provided criteria.
/// </summary>
/// <param name="criteria">Criteria to meet.</param>
static Predicate<IMediaDevice> Any (params Predicate<IMediaDevice>[] criteria);
This will filter for media devices that meet any of the provided criteria.

All

/// <summary>
/// Filter for devices that meet all of the provided criteria.
/// </summary>
/// <param name="criteria">Criteria to meet.</param>
static Predicate<IMediaDevice> All (params Predicate<IMediaDevice>[] criteria);
This will filter for media devices that meet all of the provided criteria.