Table of Contents

Class JPEG2000ParseBlock

Namespace
VisioForge.Core.MediaBlocks.Parsers
Assembly
VisioForge.Core.dll

Parses JPEG 2000 codestreams and JP2 file format for frame boundary detection and metadata extraction.

public class JPEG2000ParseBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Remarks

The JPEG2000ParseBlock processes JPEG 2000 encoded image and video streams, identifying codestream markers, extracting header information, and ensuring proper frame segmentation. JPEG 2000 is a wavelet-based image compression standard offering superior compression and quality scalability compared to traditional JPEG.

Key features: - Codestream marker detection (SOC, SOT, SOD, EOC) - Main header and tile-part header parsing - Component information extraction - Resolution level and quality layer identification - JP2 box structure parsing for file format compliance - Support for both raw codestreams and JP2 container format - Progressive decoding metadata extraction

Common use cases: - Digital cinema: Processing DCI-compliant JPEG 2000 streams - Medical imaging: Handling DICOM JPEG 2000 compressed images - Archival systems: Working with lossless JPEG 2000 content - Broadcasting: Processing JPEG 2000 video sequences - Geospatial imaging: Handling large satellite imagery

The parser supports both lossy and lossless compression modes, multiple component images (including arbitrary color spaces), and can handle very large image resolutions common in professional applications.

Constructors

JPEG2000ParseBlock()

Initializes a new instance of the VisioForge.Core.MediaBlocks.Parsers.JPEG2000ParseBlock class.

public JPEG2000ParseBlock()

Remarks

Creates input and output pads configured for video media type. The parser will detect whether the input is a raw JPEG 2000 codestream or JP2 file format and process it accordingly.

Properties

Input

Gets the primary input pad for receiving JPEG 2000 data.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads available on this block.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the primary output pad that provides parsed JPEG 2000 frames.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads available on this block.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Type

Gets the type of this media block.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the JPEG 2000 parser element within the media pipeline.

public override bool Build()

Returns

bool

true if the parser was successfully created and configured; false if initialization failed or required plugins are missing.

Remarks

This method creates the GStreamer JPEG 2000 parser element, initializes it within the pipeline context, and connects the input/output pads. The parser will begin processing data once the pipeline transitions to the playing state.

CleanUp()

Performs cleanup of the parser resources and resets the build state.

public void CleanUp()

Remarks

This method disposes of the GStreamer element and resets internal state. It is called during disposal to ensure proper resource cleanup.

Dispose(bool)

Releases unmanaged and - optionally - managed resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

GetCore()

Gets the core GStreamer element wrapper.

public BaseElement GetCore()

Returns

BaseElement

The base element wrapper providing access to common GStreamer functionality.

GetElement()

Gets the underlying native GStreamer element.

public Element GetElement()

Returns

Element

The native GStreamer element instance used for JPEG 2000 parsing.

IsAvailable()

Determines whether the JPEG 2000 parser is available in the current GStreamer installation.

public static bool IsAvailable()

Returns

bool

true if the JPEG 2000 parser plugin is available; otherwise, false. This requires the GStreamer bad plugins to be installed.

Remarks

The JPEG 2000 parser is provided by the GStreamer bad plugins collection. Ensure the appropriate VisioForge SDK redistribution package is included in your project.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the media pipeline context for this block.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The media pipeline that will contain this parser block.

See Also