Table of Contents

Class VirtualCameraSinkBlock

Namespace
VisioForge.Core.MediaBlocks.Sinks
Assembly
VisioForge.Core.dll

Virtual Camera sink block that streams video and/or audio to the VisioForge Virtual Camera via shared memory. Uses GStreamer appsink to capture frames, then pushes them to the DirectShow Virtual Camera source filter through the Push API (shared memory, no DirectShow graph needed on the producer side). Both video and audio inputs are optional — connect only what you need.

public class VirtualCameraSinkBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals, IMediaBlockDynamicInputs

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

VirtualCameraSinkBlock(VirtualCameraSinkSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.VirtualCameraSinkBlock class.

public VirtualCameraSinkBlock(VirtualCameraSinkSettings settings)

Parameters

settings VirtualCameraSinkSettings

The virtual camera sink settings.

Properties

Input

Gets the first input pad.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the output pad. Sinks do not have outputs.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads. Sinks have no outputs.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets or sets the virtual camera sink settings.

public VirtualCameraSinkSettings Settings { get; set; }

Property Value

VirtualCameraSinkSettings

Type

Gets the media block type identifier.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the virtual camera sink within the pipeline.

public override bool Build()

Returns

bool

true if successful; otherwise, false.

COMRegisterAsAdmin()

Registers the VisioForge Virtual Camera and Virtual Audio Card DirectShow filters using regsvr32 with administrator elevation (UAC prompt). Searches for .ax files in the application directory and x86/x64 subdirectories.

public static bool COMRegisterAsAdmin()

Returns

bool

true if all filters were registered successfully; otherwise, false.

CleanUp()

Releases all internal resources.

public void CleanUp()

CreateNewInput(MediaBlockPadMediaType)

Creates a new input pad for the specified media type.

public MediaBlockPad CreateNewInput(MediaBlockPadMediaType mediaType)

Parameters

mediaType MediaBlockPadMediaType

The media type (Video or Audio).

Returns

MediaBlockPad

A new input pad.

Dispose(bool)

Releases unmanaged and managed resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

GetCore()

Gets the core element wrapper.

public BaseElement GetCore()

Returns

BaseElement

GetElement()

Gets the underlying GStreamer element.

public Element GetElement()

Returns

Element

GetFilenameOrURL()

Gets the virtual camera video stream name.

public string GetFilenameOrURL()

Returns

string

GetInput(MediaBlockPadMediaType)

Gets an existing input pad matching the specified media type.

public MediaBlockPad GetInput(MediaBlockPadMediaType mediaType)

Parameters

mediaType MediaBlockPadMediaType

The media type to search for.

Returns

MediaBlockPad

The matching pad, or null if not found.

IsAvailable()

Determines whether this media block is available.

public static bool IsAvailable()

Returns

bool

true if available; otherwise, false.

IsCOMRegistered()

Checks whether the VisioForge Virtual Camera and Virtual Audio Card DirectShow source filters are registered in COM on this system.

public static bool IsCOMRegistered()

Returns

bool

true if both filters are COM-registered; otherwise, false.

SetFilenameOrURL(string)

Sets the virtual camera video stream name.

public void SetFilenameOrURL(string value)

Parameters

value string

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the pipeline context.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline