Skip to main content

Bridge video sink and source

Bridges can be used to connect different media pipelines and use them independently. BridgeVideoSinkBlock is used to connect to the BridgeVideoSourceBlock and supports uncompressed video.

Blocks info

BridgeVideoSinkBlock information

Pin directionMedia typePins count
Input videouncompressed video1

BridgeVideoSourceBlock information

Pin directionMedia typePins count
Output videouncompressed video1

Sample pipelines

First pipeline with a video source and a bridge video sink

Second pipeline with a bridge video source and a video renderer

Sample code

Source pipeline with a virtual video source and bridge video sink.

// create source pipeline
var sourcePipeline = new MediaBlocksPipeline();

// create virtual video source and bridge video sink
var videoSourceBlock = new VirtualVideoSourceBlock(new VirtualVideoSourceSettings());
var bridgeVideoSink = new BridgeVideoSinkBlock(new BridgeVideoSinkSettings());

// connect source and sink
sourcePipeline.Connect(videoSourceBlock.Output, bridgeVideoSink.Input);

// start pipeline
await sourcePipeline.StartAsync();

Sink pipeline with a bridge video source and video renderer.

// create sink pipeline
var sinkPipeline = new MediaBlocksPipeline();

// create bridge video source and video renderer
var bridgeVideoSource = new BridgeVideoSourceBlock(new BridgeVideoSourceSettings());
var videoRenderer = new VideoRendererBlock(sinkPipeline, VideoView1);

// connect source and sink
sinkPipeline.Connect(bridgeVideoSource.Output, videoRenderer.Input);

// start pipeline
await sinkPipeline.StartAsync();

Platforms

Windows, macOS, Linux, iOS, Android.