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, IMediaBlockDynamicInputsInheritance
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
settingsVirtualCameraSinkSettings-
The virtual camera sink settings.
Properties
Input
Gets the first input pad.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output pad. Sinks do not have outputs.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads. Sinks have no outputs.
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the virtual camera sink settings.
public VirtualCameraSinkSettings Settings { get; set; }Property Value
Type
Gets the media block type identifier.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the virtual camera sink within the pipeline.
public override bool Build()Returns
- bool
-
trueif 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
-
trueif 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
mediaTypeMediaBlockPadMediaType-
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
disposingbool
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
GetInput(MediaBlockPadMediaType)
Gets an existing input pad matching the specified media type.
public MediaBlockPad GetInput(MediaBlockPadMediaType mediaType)Parameters
mediaTypeMediaBlockPadMediaType-
The media type to search for.
Returns
- MediaBlockPad
-
The matching pad, or
nullif not found.
IsAvailable()
Determines whether this media block is available.
public static bool IsAvailable()Returns
- bool
-
trueif 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
-
trueif both filters are COM-registered; otherwise,false.
SetFilenameOrURL(string)
Sets the virtual camera video stream name.
public void SetFilenameOrURL(string value)Parameters
valuestring
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline