MediaDevice

namespace VideoKit {
    /// <summary>
    /// Media device for streaming sample buffers.
    /// </summary>
    abstract class MediaDevice { ... }
}

The MediaDevice abstracts a hardware device capable of streaming media sample buffers. VideoKit currently provides two concrete implementations: AudioDevice and CameraDevice.


Identifying the Device

Media devices can be identified in several ways:

Inspecting the Unique Identifier

/// <summary>
/// Device unique ID.
/// </summary>
string uniqueId { get; }

INCOMPLETE

Inspecting the Device Name

/// <summary>
/// Display friendly device name.
/// </summary>
string name { get; }

INCOMPLETE

Inspecting the Device Location

/// <summary>
/// Device location.
/// </summary>
Location location { get; }

INCOMPLETE

/// <summary>
/// Device location.
/// </summary>
enum Location : int {
    /// <summary>
    /// Device type is unknown.
    /// </summary>
    Unknown = 0,
    /// <summary>
    /// Device is internal.
    /// </summary>
    Internal = 1,
    /// <summary>
    /// Device is external.
    /// </summary>
    External = 2,
}

Checking for the Default Device

/// <summary>
/// Device is the default device for its media type.
/// </summary>
bool defaultForMediaType { get; }

INCOMPLETE


Streaming Media

The main function of the MediaDevice is to stream media buffers.

Checking the Streaming Status

/// <summary>
/// Whether the device is running.
/// </summary>
bool running { get; }

INCOMPLETE

Stopping the Stream

/// <summary>
/// Stop running.
/// </summary>
void StopRunning ();

INCOMPLETE


Managing the Device State

INCOMPLETE

Listening for Disconnections

/// <summary>
/// Event raised when the device is disconnected.
/// </summary>
event Action onDisconnected { add; remove; }

INCOMPLETE


Was this page helpful?