Class NVJPEGDecoderBlock
- Assembly
- VisioForge.Core.dll
NVIDIA hardware-accelerated JPEG decoder block using NVJPEG technology. This block leverages NVIDIA GPU hardware to decode JPEG images and MJPEG streams with exceptional performance, offloading the CPU-intensive decoding process to the GPU. Ideal for high-throughput image processing, multi-camera surveillance systems, and real-time MJPEG video decoding.
Hardware requirements: NVIDIA GPU with compute capability 3.5 or higher
Supported formats: Baseline JPEG, Progressive JPEG, MJPEG streams
Performance: Can decode thousands of images per second depending on GPU and image size
Use cases: High-speed image processing, multi-stream surveillance, medical imaging, machine vision
Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.public class NVJPEGDecoderBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
NVJPEGDecoderBlock()
Initializes a new instance of the VisioForge.Core.MediaBlocks.VideoDecoders.NVJPEGDecoderBlock class. The decoder requires an NVIDIA GPU with CUDA support and the NVJPEG library.
public NVJPEGDecoderBlock()Properties
Input
Gets the primary input pad for receiving JPEG encoded data.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads available on this hardware decoder block.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the primary output pad that provides hardware-decoded image frames.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this hardware decoder block.
public override MediaBlockPad[] Outputs { get; }Property Value
Type
Gets the media block type identifier for this NVIDIA JPEG hardware decoder.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the NVIDIA JPEG hardware decoder within the pipeline, allocating GPU resources and configuring NVJPEG for high-speed image decoding.
public override bool Build()Returns
- bool
-
trueif the hardware decoder was successfully initialized;falseif GPU resources are unavailable.
CleanUp()
Performs cleanup of GPU resources, releasing NVJPEG hardware decoder and freeing allocated GPU memory.
public void CleanUp()Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
trueto release both managed and unmanaged resources;falseto release only unmanaged resources.
GetCore()
Gets the underlying GStreamer NVJPEG element for advanced GPU configuration.
public BaseElement GetCore()Returns
- BaseElement
-
The core NVIDIA JPEG hardware decoder element instance.
GetElement()
Gets the native GStreamer NVJPEG element for direct hardware manipulation.
public Element GetElement()Returns
- Element
-
The underlying GStreamer NVIDIA JPEG decoder element.
IsAvailable()
Determines whether NVIDIA hardware JPEG decoding is available on the current system. This method checks for compatible NVIDIA GPU hardware, CUDA support, and NVJPEG library. Ensure the NVIDIA NVJPEG SDK redistribution package is included in your project.
public static bool IsAvailable()Returns
- bool
-
trueif NVIDIA JPEG hardware decoding is available; otherwise,false.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context for this hardware decoder block, establishing GPU resource management and pipeline integration.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent MediaBlocksPipeline that manages GPU resources.