Class BasicFileSourceBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sources
- Assembly
- VisioForge.Core.dll
Basic file source block for raw file data access without automatic parsing or decoding capabilities. Provides direct file reading functionality for custom format handling, raw data processing, or manual stream parsing with optional type detection for applications requiring low-level control over file data interpretation and processing. Implements the VisioForge.Core.MediaBlocks.Sources.SourceMediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class BasicFileSourceBlock : SourceMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
BasicFileSourceBlock(string, bool)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.BasicFileSourceBlock class with file path and type detection options. Configures basic file reading with optional automatic format detection for flexible file processing.
public BasicFileSourceBlock(string filename = null, bool addTypeFind = false)Parameters
filenamestring-
The file path to the source file for raw data reading.
addTypeFindbool-
If set to
true, adds automatic file type detection; otherwise provides raw data without format identification.
Properties
AddTypeFind
Gets or sets a value indicating whether to add automatic type detection for file format identification.
public bool AddTypeFind { get; set; }Property Value
Filename
Gets or sets the file path for the source file to be read as raw data.
public string Filename { get; set; }Property Value
Input
Gets the primary input pad (none for source blocks that read from files).
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads available on this block (none for source blocks).
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the primary output pad for the raw file data stream.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this block (single output for file data).
public override MediaBlockPad[] Outputs { get; }Property Value
Type
Gets the media block type identifier for basic file source operations.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the basic file source within the pipeline context. Opens the specified file, configures reading parameters, and establishes output for downstream processing.
public override bool Build()Returns
- bool
-
trueif the basic file source was successfully built and configured; otherwise,false.
CleanUp()
Cleans up all resources associated with the basic file source operations, including file handles and data buffers.
public void CleanUp()Dispose(bool)
Releases unmanaged and managed resources used by the basic file source. Properly closes file handles and disposes of GStreamer elements and file reading 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 advanced configuration and monitoring.
public BaseElement GetCore()Returns
- BaseElement
-
The BasicFileSource wrapper element for advanced configuration options.
GetElement()
Gets the native GStreamer element for direct GStreamer pipeline integration.
public Element GetElement()Returns
- Element
-
The basic file source GStreamer element.
IsAvailable()
Determines whether basic file source functionality is available on the current system. Requires GStreamer file source plugins to be installed and functional.
public static bool IsAvailable()Returns
- bool
-
trueif basic file source support is available; otherwise,false.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context for this basic file source, providing access to the parent pipeline and logging context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent MediaBlocks pipeline containing this basic file source.