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 direction | Media type | Pins count |
---|---|---|
Input video | uncompressed video | 1 |
BridgeVideoSourceBlock information
Pin direction | Media type | Pins count |
---|---|---|
Output video | uncompressed video | 1 |
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.