Table of Contents

Class SourceFactory

Namespace
VAST.Media
Assembly
VAST.Common.dll

Provides factory methods for creating media sources based on URI schemes and capture devices.

public static class SourceFactory
Inheritance
SourceFactory
Inherited Members

Methods

Create(string, string, SourceParameters)

Creates a new media source based on the provided URI.

public static IMediaSource Create(string uri, string mimeType = null, SourceParameters parameters = null)

Parameters

uri string

The URI used to determine what kind of source should be created. Can be a local or network file path.

mimeType string

Optional expected MIME type for HTTP sources. This parameter is only relevant for HTTP URIs.

parameters SourceParameters

Optional source configuration parameters, such as decoder/encoder settings.

Returns

IMediaSource

A media source instance if the protocol is supported; otherwise, null.

CreateAudioCapture(string, AudioCaptureMode)

Creates or retrieves an existing audio capture source for the specified device.

public static IAudioCaptureSource2 CreateAudioCapture(string deviceId, AudioCaptureMode captureMode = null)

Parameters

deviceId string

The identifier of the audio capture device.

captureMode AudioCaptureMode

Optional capture mode settings.

Returns

IAudioCaptureSource2

An audio capture source instance, or null if the device ID is invalid.

Remarks

If an active capture source already exists for the specified device, it will be returned instead of creating a new one.

CreateScreenCapture()

Creates a screen capture source for the current platform.

public static IScreenCaptureSource CreateScreenCapture()

Returns

IScreenCaptureSource

A screen capture source instance, or null if screen capture is not supported on the current platform.

CreateVideoCapture(string, VideoCaptureMode)

Creates or retrieves an existing video capture source for the specified device.

public static IVideoCaptureSource2 CreateVideoCapture(string deviceId, VideoCaptureMode captureMode = null)

Parameters

deviceId string

The identifier of the video capture device.

captureMode VideoCaptureMode

Optional capture mode settings.

Returns

IVideoCaptureSource2

A video capture source instance, or null if the device ID is invalid.

Remarks

If an active capture source already exists for the specified device, it will be returned instead of creating a new one.

GetVideoCapture(string)

Gets an existing video capture source for the specified device.

public static IVideoCaptureSource2 GetVideoCapture(string deviceId)

Parameters

deviceId string

The identifier of the video capture device.

Returns

IVideoCaptureSource2

The video capture source if it exists and is active; otherwise, null.

Remarks

This method does not create a new capture source if one does not exist. Use CreateVideoCapture(string, VideoCaptureMode) to create a new capture source.