Table of Contents

Class ElementX

Namespace
VisioForge.Core.Types.X
Assembly
VisioForge.Core.dll

Represents a media processing element within the VisioForge X engine, typically a GStreamer element. This class provides information about the element's name, type, and its configurable properties.

public class ElementX

Inheritance

Inherited Members

Examples

// Create an ElementX instance (conceptual, typically obtained from a factory or discovery method)
// var element = new ElementX("videotestsrc", ElementType.Source);

// Read properties of an element (e.g., a video test source)
var element = new ElementX("videotestsrc", ElementType.Unknown); // Type might be unknown initially
if (element.ReadProperties())
{
    Console.WriteLine($"Element: {element.Name} (Type: {element.Type})");
    Console.WriteLine("Properties:");
    foreach (var prop in element.Properties)
    {
        Console.WriteLine($"  {prop.Key}: {prop.Value.Item2} (Type: {prop.Value.Item1})");
    }
}

Remarks

This class is used to abstract and manage individual components (like encoders, decoders, filters) within a media processing pipeline. It allows for dynamic inspection and configuration of element properties.

Constructors

ElementX(string, ElementType)

Initializes a new instance of the VisioForge.Core.Types.X.ElementX class.

public ElementX(string name, ElementType type)

Parameters

name string

The name of the element.

type ElementType

The categorized type of the element.

Properties

Name

Gets the name of the media element. This is typically the GStreamer factory name (e.g., "videotestsrc", "audioconvert").

public string Name { get; }

Property Value

string

Properties

Gets a dictionary of properties associated with the media element. The key is the property name (string), and the value is a Tuple<T1,T2> containing the GType of the property and its current value.

public Dictionary<string, Tuple<GType, object>> Properties { get; }

Property Value

Dictionary<string, Tuple<GType, object>>

Type

Gets the categorized type of the media element (e.g., encoder, decoder, source).

public ElementType Type { get; }

Property Value

ElementType

Methods

ReadProperties()

Reads and populates the VisioForge.Core.Types.X.ElementX.Properties dictionary with the current properties of the underlying GStreamer element. This method dynamically inspects the element's capabilities and retrieves its configurable parameters.

public bool ReadProperties()

Returns

bool

true if the properties were successfully read; otherwise, false.

ToString()

Returns a string that represents the current VisioForge.Core.Types.X.ElementX instance. The string includes the element's name and its type.

public override string ToString()

Returns

string

A String that represents this instance.