Class DecryptorBlock
- Namespace
- VisioForge.Core.MediaBlocks.Special
- Assembly
- VisioForge.Core.dll
A specialized media block that decrypts AES-encrypted media streams in real-time. This block processes encrypted media data and outputs the decrypted content, enabling secure media distribution and playback of protected content.
Key features:
- AES decryption with configurable key sizes (128, 192, 256 bits)
- Support for various AES modes (ECB, CBC, CFB, OFB, CTR, GCM)
- Real-time stream decryption with minimal latency
- Transparent passthrough design
- Compatible with any media type (video, audio, data)
- Configurable initialization vectors and padding
Common use cases:
- Playback of DRM-protected content
- Secure media streaming applications
- Decrypting downloaded encrypted media files
- Building secure media distribution systems
- Implementing custom content protection schemes
- Compliance with content security requirements
Technical details:
- Uses hardware-accelerated AES when available
- Maintains stream timing and metadata
- Zero-copy operation where possible
- Thread-safe decryption processing
- Compatible with standard AES implementations
- Supports streaming and file-based media
Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class DecryptorBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
DecryptorBlock(EncryptorDecryptorSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Special.DecryptorBlock class with specified decryption settings.
public DecryptorBlock(EncryptorDecryptorSettings settings)Parameters
settingsEncryptorDecryptorSettings-
The decryption configuration including AES key, mode, IV, and other parameters.
Properties
Input
Gets the input pad for receiving encrypted media streams.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets the array of input pads. This block has a single input for encrypted data.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output pad that provides the decrypted media stream.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets the array of output pads. This block has a single output for decrypted data.
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the encryption/decryption settings including key, mode, and parameters. These settings must match the encryption settings used to encrypt the media.
public EncryptorDecryptorSettings Settings { get; set; }Property Value
Type
Gets the media block type identifier for this decryptor.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the AES decryptor block within the media pipeline. Configures the decryption parameters and establishes pad connections. This method is called automatically during pipeline construction.
public override bool Build()Returns
- bool
-
trueif the decryptor was successfully initialized;falseif setup failed.
CleanUp()
Performs cleanup of the AES decryptor resources. Releases the GStreamer element and clears sensitive key material.
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 core GStreamer element wrapper for the AES decryptor.
public BaseElement GetCore()Returns
- BaseElement
-
The BaseElement instance wrapping the AES decryptor element.
GetElement()
Gets the underlying GStreamer AES decryptor element.
public Element GetElement()Returns
- Element
-
The native GStreamer element performing AES decryption.
IsAvailable()
Determines whether the AES decryption functionality is available in the current environment. This checks if the required GStreamer AES decryption plugins are installed. The appropriate VisioForge SDK redistribution package must be included in your project.
public static bool IsAvailable()Returns
- bool
-
trueif AES decryption is available; otherwise,false.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the media pipeline context for this decryptor block. This internal method establishes the connection to the parent pipeline.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent MediaBlocksPipeline that contains this block.