Null renderer
The null renderer block sends the data to null. This block may be required if your block has outputs you do not want to use.
Block info
Name: NullRendererBlock.
Pin direction | Media type | Pins count |
---|---|---|
Input | Any | 1 |
The sample pipeline
The sample pipeline is shown below. It reads a file and sends the video data to the video samples grabber, where you can grab each video frame after decoding. The Null renderer block is used to end the pipeline.
Sample code
private void Start()
{
// create the pipeline
var pipeline = new MediaBlocksPipeline();
// create universal source block
var filename = "test.mp4";
var fileSource = new UniversalSourceBlock(await UniversalSourceSettings.CreateAsync(new Uri(filename)));
// create video sample grabber block and add the event handler
var sampleGrabber = new VideoSampleGrabberBlock();
sampleGrabber.OnVideoFrameBuffer += sampleGrabber_OnVideoFrameBuffer;
// create null renderer block
var nullRenderer = new NullRendererBlock();
// connect blocks
pipeline.Connect(fileSource.VideoOutput, sampleGrabber.Input);
pipeline.Connect(sampleGrabber.Output, nullRenderer.Input);
// start the pipeline
await pipeline.StartAsync();
}
private void sampleGrabber_OnVideoFrameBuffer(object sender, VideoFrameXBufferEventArgs e)
{
// received new video frame
}
Platforms
Windows, macOS, Linux, iOS, Android.