Table of Contents

Class MediaPlayerCoreX

Namespace
VisioForge.Core.MediaPlayerX
Assembly
VisioForge.Core.dll

MediaPlayerX audio effects processing and real-time audio manipulation implementation. Provides dynamic audio effect management including equalizers, filters, dynamic range control, spatial processing, and real-time audio manipulation during playback. Supports both cross-platform and platform-specific DSP audio processing pipelines for maximum flexibility and performance.

public class MediaPlayerCoreX : IDisposable, IAsyncDisposable, IMediaPlayerControls, IVideoEffectsControls, INotifyPropertyChanged

Inheritance

Implements

Inherited Members

Remarks

This is the modern, cross-platform media player SDK recommended for new development projects. It replaces legacy platform-specific players and provides unified API across all supported platforms. Built on a cross-platform media framework for maximum format compatibility and MediaBlocks for modular pipeline construction.

Constructors

MediaPlayerCoreX()

Initializes a new instance of the VisioForge.Core.MediaPlayerX.MediaPlayerCoreX class with default settings. Configures logging infrastructure, platform-specific media framework redistribution paths, and initializes core components.

public MediaPlayerCoreX()

MediaPlayerCoreX(IVideoView)

Initializes a new instance of the VisioForge.Core.MediaPlayerX.MediaPlayerCoreX class with a video view control for rendering. Associates the player with a video rendering control to display video output on screen. Configures logging infrastructure, platform-specific media framework redistribution paths, and initializes core components.

public MediaPlayerCoreX(IVideoView videoView)

Parameters

videoView IVideoView

The video view control that will be used for video rendering and display output.

Properties

Audio_OutputDevice

Gets or sets the audio output device.

public IAudioRendererSettings Audio_OutputDevice { get; set; }

Property Value

IAudioRendererSettings

Audio_OutputDevice_Mute

Gets or sets a value indicating whether the audio output is muted. When muted, audio playback continues but no sound is produced.

public bool Audio_OutputDevice_Mute { get; set; }

Property Value

bool

Remarks

Muting is different from setting VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Audio_OutputDevice_Volume to 0:

  • Mute: Silences output while preserving the volume setting; unmuting restores previous volume
  • Volume 0: Sets volume to zero; requires explicitly setting volume back to desired level

This property can be changed during playback for instant mute/unmute control. Changes take effect immediately without interrupting the audio stream. The volume level is preserved when muting and restored when unmuting.

If no audio renderer is active, getting this property returns false, and setting it updates a cached value that will be applied when playback starts.

Audio_OutputDevice_Volume

Gets or sets the audio output volume level for the media player. This controls the volume of the audio rendered to the output device.

public double Audio_OutputDevice_Volume { get; set; }

Property Value

double

Remarks

This property can be changed during playback for real-time volume adjustment. Changes take effect immediately. The volume setting is applied to the audio renderer in the pipeline before the signal reaches the audio output device.

Setting values above 1.0 amplifies the audio signal, which may result in clipping and distortion if the audio is already at or near maximum levels. For pure muting without volume adjustment, use VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Audio_OutputDevice_Mute instead.

If no audio renderer is active (pipeline not started), getting this property returns the cached volume value, and setting it updates the cached value that will be applied when playback starts.

Audio_Play

Gets or sets a value indicating whether audio playback is enabled in the media player. When set to false, the audio stream is muted and no audio processing occurs.

public bool Audio_Play { get; set; }

Property Value

bool

Remarks

This property must be set before calling VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OpenAsync or VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.PlayAsync(System.Boolean) to take effect. Changing this property during playback requires stopping and restarting the player. When disabled, audio decoding and rendering blocks are not added to the pipeline, improving performance for video-only scenarios. If no audio output device is configured, this property is automatically set to false.

Audio_Streams

Gets an observable collection of all audio streams detected in the currently loaded media. Each stream contains metadata about codec, sample rate, bit depth, channel configuration, and language.

public ObservableCollection<AudioStreamInfo> Audio_Streams { get; }

Property Value

ObservableCollection<AudioStreamInfo>

Remarks

This collection is populated after opening a media source and the VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OnStreamsInfoAvailable event is raised. Common scenarios with multiple audio streams include:

  • Multi-language content (movies, documentaries with multiple dubbed audio tracks)
  • Music videos with instrumental/vocal tracks
  • Content with commentary tracks or descriptive audio for accessibility
  • Different audio quality levels (stereo, 5.1 surround, Dolby Atmos)

Use VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Audio_Stream_Select(VisioForge.Core.Types.MediaInfo.AudioStreamInfo) to switch between available audio streams during playback for features like language selection or audio track switching. The collection supports data binding for displaying available audio tracks in the UI.

Audio_VU_Meter_Enabled

Gets or sets a value indicating whether the audio VU (Volume Unit) meter is enabled for real-time audio level monitoring. When enabled, the VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OnAudioVUMeter event is raised periodically with current audio level information.

public bool Audio_VU_Meter_Enabled { get; set; }

Property Value

bool

Remarks

The VU meter provides real-time audio level data useful for:

  • Displaying audio level visualizations in the UI
  • Monitoring for audio clipping or silence
  • Implementing audio-based triggers or automation
  • Creating audio meters and spectrum analyzers
This property must be set before starting playback. Enabling the VU meter has minimal performance impact.

Custom_Audio_Outputs

Gets the collection of custom audio output blocks that receive processed audio samples from the pipeline. These blocks can encode audio to files, stream to network, or perform custom audio processing.

public List<MediaBlock> Custom_Audio_Outputs { get; }

Property Value

List<MediaBlock>

Remarks

Custom audio outputs enable advanced scenarios such as:

  • Recording audio to multiple formats simultaneously (MP3, AAC, WAV)
  • Streaming audio to multiple destinations (Icecast, SHOUTcast, RTMP audio-only)
  • Analyzing audio in real-time for speech-to-text or music recognition
  • Creating audio archives or podcasts from live playback
  • Routing audio to multiple sound cards or virtual audio devices

Output blocks must be added to this collection before starting playback. When multiple outputs are configured, an audio tee (splitter) is automatically inserted in the pipeline to distribute samples to all outputs. Each output receives a copy of the processed audio after effects have been applied.

Performance note: Each output block processes audio independently. Multiple outputs may increase CPU usage depending on the operations performed by each output, though audio processing is generally less resource-intensive than video processing.

Custom_Video_Outputs

Gets the collection of custom video output blocks that receive processed video frames from the pipeline. These blocks can encode video to files, stream to network, or perform custom processing.

public List<MediaBlock> Custom_Video_Outputs { get; }

Property Value

List<MediaBlock>

Remarks

Custom video outputs enable advanced scenarios such as:

  • Recording video to multiple formats simultaneously
  • Streaming video to multiple destinations (RTMP, RTSP, HLS)
  • Creating video thumbnails or time-lapse sequences during playback
  • Sending video to custom processing pipelines or AI inference engines
  • Multi-target encoding with different resolutions or bitrates

Output blocks must be added to this collection before starting playback. When multiple outputs are configured, a video tee (splitter) is automatically inserted in the pipeline to distribute frames to all outputs.

Performance note: Each output block processes video independently. Multiple outputs may significantly increase CPU/GPU usage depending on the operations performed by each output.

Debug_Dir

Gets or sets the directory path where debug log files and pipeline graphs will be saved. This directory is used for storing debug information including Serilog logs and GStreamer pipeline DOT files.

public string Debug_Dir { get; set; }

Property Value

string

Remarks

When VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Debug_Mode is enabled, log files are automatically created in this directory with names like: media_player_log_YYYYMMDD_HHMMSS.txt

Pipeline graph files created by VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Debug_SavePipeline(System.String) are also saved to this directory. Ensure the application has write permissions to this directory, or debug file creation will fail.

Changing this property triggers a logger reconfiguration, closing the current log file and creating a new one in the new directory if VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Debug_Mode is enabled.

Debug_DisableMessageDialogs

Gets or sets a value indicating whether error message dialogs will be shown automatically when errors occur and the VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OnError event is not handled. This property only affects Windows platforms.

public bool Debug_DisableMessageDialogs { get; set; }

Property Value

bool

Remarks

This property controls the default error notification behavior:

  • When VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OnError event is handled: Message dialogs are never shown regardless of this property
  • When VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OnError is not handled and this is false: Error dialogs are shown automatically (Windows only)
  • When VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OnError is not handled and this is true: Errors are logged but no dialogs appear

Set to true in production applications to prevent unexpected dialogs from disrupting the user experience. Always implement VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OnError event handling for proper error management in production code.

Debug_Mode

Gets or sets a value indicating whether debug mode is enabled for detailed logging and diagnostics. When enabled, comprehensive debug information is logged to files for troubleshooting and development.

public bool Debug_Mode { get; set; }

Property Value

bool

Remarks

Debug mode affects logging behavior:

  • Enabled: Logs at Debug level to both files and debug output with detailed pipeline information
  • Disabled: Logs only Error level messages to debug output, no file logging

Debug log files are created in VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Debug_Dir with automatic rotation (1MB per file, 3 files retained). Changing this property triggers immediate logger reconfiguration.

Warning: Keep debug mode disabled in production to avoid performance impact and excessive disk usage from detailed logging. Enable only during development or when diagnosing issues.

Debug_Telemetry

Gets or sets a value indicating whether anonymous telemetry data should be sent during development and debugging. Telemetry helps improve SDK quality by providing anonymous crash reports and error diagnostics.

public bool Debug_Telemetry { get; set; }

Property Value

bool

Remarks

Privacy Notice: Only anonymous diagnostic data is collected. No personally identifiable information, media content, or application-specific data is transmitted. Telemetry only functions when:

  • A debugger is attached (development environment)
  • This property is set to true

Collected data includes: exception types, error messages, SDK version, and general usage patterns. This helps VisioForge identify and fix issues more quickly.

Note: Telemetry functionality is currently disabled in the SDK.

Face_Detector

Gets or sets the face detection processor for real-time face detection and tracking in video frames. When configured, the detector analyzes each video frame and raises VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OnFaceDetected events with detected face information.

public IFaceDetector Face_Detector { get; set; }

Property Value

IFaceDetector

Remarks

Face detection enables applications to:

  • Track faces in video for security and surveillance applications
  • Apply face-based effects or filters (blur, emoji replacement, augmented reality)
  • Analyze video content for people counting or attendance tracking
  • Create smart video cropping that keeps faces centered
  • Implement facial recognition workflows

The face detector must support the video format being processed. Not all pixel formats are supported by all detectors. If the video format is incompatible, an error is logged and face detection is skipped for those frames.

This property must be set before starting playback. Face detection has performance implications; the impact depends on the detector implementation, video resolution, and frame rate.

Fonts

Gets a collection of all available system fonts that can be used for text overlays, subtitles, and other text rendering. This collection is populated by enumerating fonts installed on the system.

public ObservableCollection<FontDescriptionX> Fonts { get; }

Property Value

ObservableCollection<FontDescriptionX>

Remarks

This property is useful when implementing:

  • Font selection UI for subtitle customization
  • Text overlay configuration in video editors
  • Dynamic font selection based on language or content
  • Font availability validation before applying text effects

The font collection includes system fonts, custom installed fonts, and application-bundled fonts. Font availability may vary across platforms and system configurations.

Loop

Gets or sets a value indicating whether media playback will automatically restart from the beginning when the end is reached, creating continuous looping playback.

public bool Loop { get; set; }

Property Value

bool

Remarks

When enabled, the player automatically seeks back to the start position when reaching the end of the media, creating seamless continuous playback. This is useful for:

  • Background video loops for kiosks or digital signage
  • Music players with repeat functionality
  • Video preview loops in media browsers
  • Testing and demonstration scenarios

This property must be set before calling VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.PlayAsync(System.Boolean) to take effect. The loop behavior respects VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Segment_Start and VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Segment_Stop if they are configured, looping only the specified segment.

PauseOnStop

Gets or sets a value indicating whether the player will pause instead of stopping when the end-of-stream is reached. When enabled, the player pauses at the last frame rather than transitioning to the stopped state.

public bool PauseOnStop { get; set; }

Property Value

bool

Remarks

This property changes the end-of-playback behavior:

  • When true: Player pauses at the last frame, keeping the video visible and allowing immediate resume or seeking
  • When false: Player stops completely, releases resources, and may clear the display

This is useful for:

  • Video players where you want to keep the last frame visible after playback ends
  • Applications that allow reviewing content by seeking backward after playback completes
  • Scenarios where you want to avoid the visual disruption of stopping and clearing the video display
  • Media analysis tools that need to examine the final frame

This property must be set before calling VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.PlayAsync(System.Boolean) to take effect.

SDK_BuildDate

Gets the build date of the SDK assembly, indicating when this version of the MediaPlayerX was compiled. Useful for version tracking, support requests, and ensuring you're running the expected SDK version.

public static DateTime SDK_BuildDate { get; }

Property Value

DateTime

Remarks

This property is static and returns the same value for all instances of VisioForge.Core.MediaPlayerX.MediaPlayerCoreX. When reporting issues to VisioForge support, include both VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.SDK_BuildDate and VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.SDK_Version to help identify the exact SDK build you're using.

SDK_Version

Gets the version number of the SDK assembly in the format Major.Minor.Build.Revision. This version indicates the SDK's feature set, bug fixes, and compatibility level.

public static Version SDK_Version { get; }

Property Value

Version

Remarks

This property is static and returns the same value for all instances of VisioForge.Core.MediaPlayerX.MediaPlayerCoreX. Use this version to:

  • Check compatibility with your application's requirements
  • Display SDK version in your application's About dialog
  • Report to VisioForge support when requesting assistance
  • Verify you're using the intended SDK version in your deployment

Segment_Start

Gets or sets the start position for segment playback, defining where playback should begin in the media. When set, playback starts from this position instead of the media's beginning.

public TimeSpan Segment_Start { get; set; }

Property Value

TimeSpan

Remarks

This property enables segment playback for scenarios such as:

  • Playing only a portion of a video (e.g., chapter playback)
  • Creating video clips from larger media files
  • Skipping intros or outros automatically
  • Implementing A-B repeat functionality

When used with VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Segment_Stop, creates a playback range. When used with VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Loop, the player loops only within the defined segment. This property must be set before calling VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.PlayAsync(System.Boolean).

The start position should be less than the media duration and less than VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Segment_Stop if specified. Invalid values may result in playback errors or no playback.

Segment_Stop

Gets or sets the stop position for segment playback, defining where playback should end in the media. When set, playback automatically stops (or pauses, if VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.PauseOnStop is enabled) at this position.

public TimeSpan Segment_Stop { get; set; }

Property Value

TimeSpan

Remarks

This property enables limited playback duration for scenarios such as:

  • Playing only a portion of a video (e.g., scene or chapter playback)
  • Creating timed previews or trailers from full content
  • Implementing automatic stop at specific timestamps
  • A-B repeat functionality when combined with VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Segment_Start and VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Loop

When used with VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Segment_Start, creates a playback range. When combined with VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Loop, the player loops only within the defined segment (between VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Segment_Start and VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Segment_Stop). This property must be set before calling VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.PlayAsync(System.Boolean).

The stop position should be greater than VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Segment_Start and less than the media duration. If VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Segment_Stop is Zero or not set, playback continues until the end of the media.

Snapshot_Grabber_Enabled

Gets or sets a value indicating whether the snapshot grabber is enabled to capture the last displayed video frame. When enabled, the player maintains a copy of the most recent frame that can be retrieved using snapshot methods.

public bool Snapshot_Grabber_Enabled { get; set; }

Property Value

bool

Remarks

This property must be enabled before calling VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.PlayAsync(System.Boolean) or VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OpenAsync to activate the snapshot grabber. Once enabled, the following snapshot methods become available:

  • VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Snapshot_Get - Get the last frame as VisioForge.Core.Types.X.VideoFrameX
  • VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Snapshot_GetSK - Get the last frame as SkiaSharp.SKBitmap
  • VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Snapshot_Save(System.String,SkiaSharp.SKEncodedImageFormat,System.Int32) - Save the last frame to a file

The snapshot grabber maintains a single frame buffer updated with each new frame during playback. This has minimal memory overhead (one frame) and negligible performance impact. The stored frame is always the most recently rendered frame.

Use cases include:

  • Creating video thumbnails
  • Capturing frames for user galleries or preview images
  • Implementing "save current frame" functionality
  • Frame-accurate image extraction from video

State

Gets the current playback state of the media player. This property reflects the real-time state of the underlying media processing pipeline.

public PlaybackState State { get; }

Property Value

PlaybackState

Remarks

This property is read-only and reflects the state managed by the internal MediaBlocks pipeline. To change the playback state, use methods like VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.PlayAsync(System.Boolean), VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.PauseAsync, VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.ResumeAsync, and VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.StopAsync. Subscribe to state change events (VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OnStart, VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OnPause, VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OnResume, VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OnStop) to be notified when the state changes.

Subtitle_Streams

Gets an observable collection of all subtitle/caption streams embedded in the currently loaded media. Each stream contains metadata about format, language, and subtitle characteristics.

public ObservableCollection<SubtitleStreamInfo> Subtitle_Streams { get; }

Property Value

ObservableCollection<SubtitleStreamInfo>

Remarks

This collection is populated after opening a media source and the VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OnStreamsInfoAvailable event is raised. It only includes subtitles/captions embedded within the media container (MKV, MP4, etc.), not external subtitle files.

Common subtitle formats detected:

  • SRT (SubRip) - Text-based subtitles
  • SSA/ASS (SubStation Alpha) - Styled subtitles with formatting
  • VobSub - Image-based DVD subtitles
  • PGS (Presentation Graphic Stream) - Blu-ray subtitles
  • WebVTT - Web video text tracks

For external subtitle files, use the VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Subtitles_ExternalFile property to load additional subtitles not embedded in the media. The collection supports data binding for displaying available subtitle tracks in the UI.

Subtitles_Enabled

Gets or sets a value indicating whether subtitle display is enabled for both embedded and external subtitles. When enabled, subtitles from the media or external files will be rendered on the video.

public bool Subtitles_Enabled { get; set; }

Property Value

bool

Remarks

This property controls subtitle visibility for:

  • Embedded subtitles within the media container (MKV, MP4, etc.)
  • External subtitle files loaded via VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Subtitles_ExternalFile

This property can be toggled during playback to show/hide subtitles in real-time. Subtitle appearance is controlled by VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Subtitles_Settings, which can be updated using VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Subtitles_Settings_Update.

If the media has no subtitle streams and no external subtitle file is specified, this property has no visible effect.

Subtitles_ExternalFile

Gets or sets the path to an external subtitle file to be displayed along with the video. Supports common subtitle formats including SRT, SSA, ASS, and VTT.

public string Subtitles_ExternalFile { get; set; }

Property Value

string

Remarks

Supported subtitle file formats:

  • SRT (SubRip): Simple text-based format with timestamps
  • SSA/ASS (SubStation Alpha): Advanced format with styling and effects
  • VTT (WebVTT): Web video text track format
  • Other formats supported by the underlying media framework

This property should be set before calling VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OpenAsync or VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.PlayAsync(System.Boolean) to load the subtitle file. External subtitles are rendered using the appearance defined in VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Subtitles_Settings and can be enabled/disabled using VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Subtitles_Enabled.

External subtitles are useful when:

  • The media container doesn't have embedded subtitles
  • You want to provide subtitle files in multiple languages
  • Subtitles need to be updated independently of the video file
  • Working with legacy formats that don't support embedded subtitles

Subtitles_Settings

Gets or sets the subtitle rendering appearance settings including font, color, position, and background. These settings control how subtitles are displayed on the video.

public SubtitleOverlaySettings Subtitles_Settings { get; set; }

Property Value

SubtitleOverlaySettings

Remarks

Subtitle settings include:

  • Font properties: Family, size, weight, style
  • Colors: Text color, outline color, shadow color
  • Position: Vertical and horizontal alignment
  • Background: Background box, opacity, padding
  • Effects: Outline width, shadow offset

After modifying subtitle settings, call VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Subtitles_Settings_Update to apply changes during playback. Settings can be changed at any time and updated without interrupting playback.

These settings affect both embedded subtitles and external subtitle files loaded via VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Subtitles_ExternalFile.

Video_Composition_Enabled

Gets or sets a value indicating whether video composition (multi-layer video mixing) is enabled. When enabled, allows adding overlay images and graphics on top of the main video stream using the VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Video_Composition_Add(VisioForge.Core.Types.X.VideoEffects.VideoCompositionElement) method.

public bool Video_Composition_Enabled { get; set; }

Property Value

bool

Remarks

Video composition enables:

  • Picture-in-picture effects
  • Logo and watermark overlays
  • Real-time graphics composition
  • Multi-layer video mixing
  • Dynamic visual elements on top of video content

This property must be set to true before starting playback to activate the composition pipeline. Once enabled, use VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Video_Composition_Add(VisioForge.Core.Types.X.VideoEffects.VideoCompositionElement), VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Video_Composition_Remove(VisioForge.Core.Types.X.VideoEffects.VideoCompositionElement), and VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Video_Composition_Clear to manage composition elements during playback.

Performance note: Enabling video composition adds processing overhead. The impact depends on the number and complexity of composition elements.

Video_Play

Gets or sets a value indicating whether video playback and rendering is enabled in the media player. When set to false, only audio is processed and no video rendering occurs.

public bool Video_Play { get; set; }

Property Value

bool

Remarks

This property must be set before calling VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OpenAsync or VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.PlayAsync(System.Boolean) to take effect. Changing this property during playback requires stopping and restarting the player. When disabled, video decoding and rendering blocks are not added to the pipeline, significantly improving performance and reducing resource usage for audio-only scenarios such as music playback or podcast streaming. If no video renderer is configured or no video streams are detected in the source, this property is automatically set to false.

Video_Processors

Gets the collection of custom video processors that will be applied to each video frame during playback. Video processors enable custom frame analysis, computer vision operations, and real-time video modifications.

public List<IVideoProcessor> Video_Processors { get; }

Property Value

List<IVideoProcessor>

Remarks

Video processors enable custom video frame processing for:

  • Computer vision and image analysis (object detection, OCR, pattern recognition)
  • Custom video effects not available in the built-in effects
  • Frame-by-frame analysis for quality control or content verification
  • Integration with machine learning models for real-time inference
  • Custom overlays, annotations, or augmented reality effects

Each processor receives every video frame and can analyze or modify it. Processors must be added to this collection before starting playback. Each processor must support the video pixel format being used, or frames will be skipped with error logging.

Performance consideration: Video processors run on the video frame callback thread. Complex processing may impact playback performance and cause frame drops. Consider using async processing or dedicated threads for computationally intensive operations.

Video_Streams

Gets an observable collection of all video streams detected in the currently loaded media. Each stream contains metadata about codec, resolution, frame rate, and other video properties.

public ObservableCollection<VideoStreamInfo> Video_Streams { get; }

Property Value

ObservableCollection<VideoStreamInfo>

Remarks

This collection is populated after opening a media source and the VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.OnStreamsInfoAvailable event is raised. Common scenarios with multiple video streams include:

  • Multi-angle video content (concert videos, sports with multiple camera angles)
  • Container formats with multiple video tracks
  • Picture-in-picture content
  • Video with alternate versions (different resolutions or crops)

Use VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Video_Stream_Select(VisioForge.Core.Types.MediaInfo.VideoStreamInfo) to switch between available video streams during playback. The collection supports data binding for displaying available video tracks in the UI.

IMediaPlayerControls.State

Gets the state.

PlaybackState IMediaPlayerControls.State { get; }

Property Value

PlaybackState

Exceptions

NotImplementedException

Methods

Audio_Effects_AddOrUpdate(BaseAudioEffect)

Adds a new audio effect to the pipeline or updates an existing effect with the same name. The effect is applied in real-time to the audio stream during playback without interrupting the media. If an effect with the same name already exists, its parameters will be updated with the new values. Effects are processed in the order they were added to the pipeline.

public void Audio_Effects_AddOrUpdate(BaseAudioEffect effect)

Parameters

effect BaseAudioEffect

The audio effect to add or update in the effects pipeline. Must not be null.

Remarks

This method supports dynamic audio effect management during playback. When updating an existing effect, the audio stream will smoothly transition to the new effect parameters without artifacts. Effect names are used as unique identifiers, so ensure each effect has a distinct name if you want to apply multiple effects of the same type simultaneously.

Audio_Effects_Clear()

Clears all audio effects from the pipeline, returning audio processing to the original unmodified stream. This method removes all active audio effects and resets the audio processing chain to its default state. The audio playback continues without interruption using the original, unprocessed audio signal.

public void Audio_Effects_Clear()

Remarks

This method is useful when you want to quickly disable all audio processing and return to the original audio. All effect update event handlers are disconnected, and both cross-platform effects and platform-specific DSP effects are cleared from the pipeline. The operation completes smoothly without audio artifacts.

Audio_Effects_Remove(BaseAudioEffect)

Removes an audio effect from the pipeline by its instance. Once removed, the effect will no longer be applied to the audio stream. The audio processing will continue with the remaining active effects in the pipeline.

public void Audio_Effects_Remove(BaseAudioEffect effect)

Parameters

effect BaseAudioEffect

The audio effect instance to remove from the pipeline. Must not be null.

Remarks

This method disconnects the effect's update event handlers and removes it from the internal effects collection. If the effect is not found in the pipeline, this method completes without error. The audio stream will smoothly adapt to the removal without interruption.

Audio_OutputDevicesAsync(AudioOutputDeviceAPI?)

Gets the output audio devices asynchronous.

public Task<AudioOutputDeviceInfo[]> Audio_OutputDevicesAsync(AudioOutputDeviceAPI? api = null)

Parameters

api AudioOutputDeviceAPI?

The API.

Returns

Task<AudioOutputDeviceInfo[]>

Task<AudioOutputDeviceInfo[]>.

Audio_Stream_Select(AudioStreamInfo)

Switches to a different audio stream in multi-stream media content. This method allows dynamic switching between audio tracks during playback, commonly used for multi-language content or content with multiple audio channels (commentary, music, etc.). The switch occurs seamlessly without interrupting video playback.

public bool Audio_Stream_Select(AudioStreamInfo stream)

Parameters

stream AudioStreamInfo

The target audio stream to switch to. Must be a valid VisioForge.Core.Types.MediaInfo.AudioStreamInfo from the media's available audio streams.

Returns

bool

true if the audio stream was successfully switched; false if the operation failed due to invalid source, null stream, or stream event failure.

Remarks

Audio stream switching behavior:

  • Maintains current video stream while switching audio
  • Sends a SELECT_STREAMS event to the underlying media pipeline
  • Works during active playback without interruption
  • Requires the media to contain multiple audio streams
  • The target stream must be available in the current media content Use this method for implementing audio track selection in media players with multi-language or multi-channel content.

Debug_SavePipeline(string)

Saves the current media processing pipeline graph to a DOT file for debugging and visualization. The DOT file can be converted to an image using Graphviz tools to visualize the complete pipeline structure, including all MediaBlocks elements, their connections, and their current state. This is invaluable for debugging complex pipeline configurations and understanding the data flow through the media processing chain.

public void Debug_SavePipeline(string name)

Parameters

name string

The base name to use for the saved pipeline graph file (without extension). The file will be saved in the directory specified by VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Debug_Dir with a .dot extension.

Remarks

The generated DOT file follows the Graphviz format and can be visualized using tools such as:

  • Graphviz command-line tools: dot -Tpng filename.dot -o output.png
  • Online Graphviz editors like WebGraphviz or edotor.net
  • Visual Studio Code extensions for Graphviz
The pipeline graph shows element names, pad connections, capabilities, and current element states. This method does nothing if name is null/empty or if no pipeline is currently active.

Dispose(bool)

Releases unmanaged and - optionally - managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

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

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

DisposeAsync()

Disposes the MediaPlayerCoreX instance asynchronously.

public ValueTask DisposeAsync()

Returns

ValueTask

A ValueTask representing the asynchronous dispose operation.

Duration()

Gets the total duration of the currently loaded media content.

public TimeSpan Duration()

Returns

TimeSpan

The media duration as a TimeSpan, or Zero if no media is loaded or duration is unavailable.

DurationAsync()

Asynchronously gets the total duration of the currently loaded media.

public Task<TimeSpan> DurationAsync()

Returns

Task<TimeSpan>

A task containing the media duration as a TimeSpan.

~MediaPlayerCoreX()

Finalizes an instance of the VisioForge.Core.MediaPlayerX.MediaPlayerCoreX class.

protected ~MediaPlayerCoreX()

GetContext()

Gets the media framework context used for logging and MediaBlocks pipeline operations. Provides access to the Serilog logger instance and logging methods used throughout the MediaPlayerX and underlying pipeline infrastructure. The context is used internally by all MediaBlocks components for consistent error reporting and debugging information.

public ContextX GetContext()

Returns

ContextX

The VisioForge.Core.GStreamer.ContextX instance containing the configured logger and context information; null if not initialized. The context includes Info, Warning, and Error logging methods with support for structured logging and exception tracking.

Remarks

The context provides a unified logging interface that all MediaBlocks components use for reporting their status, warnings, and errors. Applications can access this context to understand the internal state of the pipeline or to add custom logging that integrates with the SDK's logging system.

GetLogger()

Gets the Serilog logger instance used by the MediaPlayerX for centralized logging across all components. This logger is used throughout the MediaPlayerX and underlying MediaBlocks pipeline for consistent logging. Applications can use this logger to integrate their own logging with the SDK's logging infrastructure.

public ILogger GetLogger()

Returns

ILogger

The Serilog.ILogger instance configured for this MediaPlayerX instance. The logger configuration is determined by the VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Debug_Mode and VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Debug_Dir properties.

Remarks

The logger configuration varies based on the VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Debug_Mode setting:

  • When VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Debug_Mode is enabled: Logs at Debug level to both file and debug output with detailed information.
  • When VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Debug_Mode is disabled: Logs only Error level messages to debug output.
Log files are automatically rotated when they reach 1MB in size, with up to 3 retained files.

NextFrame()

Advances the video playback by exactly one frame (frame stepping forward). This method pauses the player and moves forward by a single frame, useful for precise video analysis or frame-by-frame examination. The operation requires a video renderer to be present and only works with seekable sources like media files, not live streams.

public bool NextFrame()

Returns

bool

true if the frame step operation was successful; false if it failed due to missing video renderer or unsupported source.

Remarks

Frame stepping behavior:

  • Automatically pauses playback before stepping to ensure precise control
  • Handles negative playback rates by switching to positive rate during the step
  • Requires a video renderer to be configured in the player
  • Only works with seekable media sources (files), not live streams
  • The step size respects the current playback rate for timing calculations Use this method for precise video analysis, educational content, or debugging purposes.

OnPropertyChanged(string)

Raises the VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.PropertyChanged event for the specified property to notify data-bound controls and observers. This method is called automatically by property setters to support WPF, MAUI, Avalonia, and other MVVM framework data binding.

protected virtual void OnPropertyChanged(string propertyName = null)

Parameters

propertyName string

The name of the property that changed. Automatically populated by the compiler when called from a property setter using [CallerMemberName] attribute.

Remarks

This method implements the INotifyPropertyChanged pattern, enabling two-way data binding in UI frameworks. UI elements bound to MediaPlayerX properties will automatically update when property values change.

OpenAsync(IMediaPlayerBaseSourceSettings)

Asynchronously opens a media source for playback using the specified source configuration settings. Prepares the MediaBlocks pipeline and begins loading media content from the specified source.

public Task<bool> OpenAsync(IMediaPlayerBaseSourceSettings source)

Parameters

source IMediaPlayerBaseSourceSettings

The media source settings defining what content to play (file, network stream, IP camera, etc.).

Returns

Task<bool>

A task that returns true if the source was successfully opened; false otherwise.

OpenAsync(string)

Asynchronously opens a media file or network URL for playback. This convenience method automatically creates appropriate source settings based on the filename or URL.

public Task<bool> OpenAsync(string filename)

Parameters

filename string

The path to the media file or network URL to open for playback.

Returns

Task<bool>

A task that returns true if the file or URL was successfully opened; false otherwise.

OpenAsync(Uri)

Asynchronously opens a media source from the specified URI for playback. This convenience method automatically creates appropriate source settings based on the URI scheme.

public Task<bool> OpenAsync(Uri uri)

Parameters

uri Uri

The URI pointing to the media source to open.

Returns

Task<bool>

A task that returns true if the URI was successfully opened; false otherwise.

Pause()

Pauses media playback synchronously while preserving the current playback position.

public bool Pause()

Returns

bool

true if pause was successful; false otherwise.

PauseAsync()

Asynchronously pauses media playback while preserving the current playback position.

public Task<bool> PauseAsync()

Returns

Task<bool>

A task that returns true if pause was successful; false otherwise.

Play(bool)

Starts media playback synchronously or preloads the media content without starting playback.

public bool Play(bool onlyPreload = false)

Parameters

onlyPreload bool

If set to true, only preloads the media pipeline without starting playback; otherwise starts playback immediately.

Returns

bool

true if playback started or preload completed successfully; false otherwise.

PlayAsync(bool)

Asynchronously starts media playback or preloads the media content without starting playback.

public Task<bool> PlayAsync(bool onlyPreload = false)

Parameters

onlyPreload bool

If set to true, only preloads the media pipeline without starting playback; otherwise starts playback immediately.

Returns

Task<bool>

A task that returns true if playback started or preload completed successfully; false otherwise.

Position_Get()

Gets the current playback position in the media.

public TimeSpan Position_Get()

Returns

TimeSpan

The current position as a TimeSpan, or TimeSpan.Zero if no media is loaded.

Position_GetAsync()

Asynchronously gets the current playback position in the media.

public Task<TimeSpan> Position_GetAsync()

Returns

Task<TimeSpan>

A task containing the current position as a TimeSpan.

Position_Set(TimeSpan, bool)

Sets the playback position in the media (seeks to a specific time).

public void Position_Set(TimeSpan position, bool seekToKeyframe = false)

Parameters

position TimeSpan

The target position to seek to.

seekToKeyframe bool

If true, seeks to the nearest keyframe for faster seeking.

Position_SetAsync(TimeSpan, bool)

Asynchronously sets the playback position in the media (seeks to a specific time).

public Task Position_SetAsync(TimeSpan position, bool seekToKeyframe = false)

Parameters

position TimeSpan

The target position to seek to.

seekToKeyframe bool

If true, seeks to the nearest keyframe for faster seeking.

Returns

Task

A task representing the asynchronous seek operation.

Position_SetRange(TimeSpan, TimeSpan, bool)

Sets the playback range with start and stop positions.

public void Position_SetRange(TimeSpan startPosition, TimeSpan stopPosition, bool seekToKeyframe = false)

Parameters

startPosition TimeSpan

The start position for playback.

stopPosition TimeSpan

The stop position where playback will end.

seekToKeyframe bool

If set to true, seeks to the nearest keyframe.

Position_SetRangeAsync(TimeSpan, TimeSpan, bool)

Asynchronously sets the playback range with start and stop positions.

public Task Position_SetRangeAsync(TimeSpan startPosition, TimeSpan stopPosition, bool seekToKeyframe = false)

Parameters

startPosition TimeSpan

The start position for playback.

stopPosition TimeSpan

The stop position where playback will end.

seekToKeyframe bool

If set to true, seeks to the nearest keyframe.

Returns

Task

A task representing the asynchronous operation.

PrevFrame()

Steps backward by exactly one frame (reverse frame stepping). This method moves the playback position backward by a single frame using seek operations, useful for precise video analysis in reverse. The operation requires seekable video content and may be slower than forward frame stepping due to the need for precise backward seeking.

public bool PrevFrame()

Returns

bool

true if the backward frame step was successful; false if it failed due to missing pipeline, no video streams, or seek limitations.

Remarks

Backward frame stepping limitations and behavior:

  • Requires a valid pipeline and at least one video stream
  • Only works with seekable media sources (files), not live streams
  • Uses seek operations which may be slower than forward stepping
  • Accuracy depends on the underlying codec's ability to seek to exact frames
  • May not work reliably with all video formats or codecs
  • Performance varies based on video compression and keyframe intervals This method is primarily intended for video analysis and educational purposes where precise backward navigation is needed.

Rate_Get()

Gets the current playback rate.

public double Rate_Get()

Returns

double

The playback rate (1.0 = normal speed, 2.0 = double speed, etc.).

Rate_GetAsync()

Asynchronously gets the current playback rate.

public Task<double> Rate_GetAsync()

Returns

Task<double>

A task containing the playback rate (1.0 = normal speed).

Rate_Set(double)

Sets the playback rate.

public bool Rate_Set(double rate)

Parameters

rate double

The playback rate to set (1.0 = normal speed, 2.0 = double speed, 0.5 = half speed, etc.).

Returns

bool

Returns true if the rate was set successfully, false otherwise.

Rate_SetAsync(double)

Asynchronously sets the playback rate.

public Task<bool> Rate_SetAsync(double rate)

Parameters

rate double

The playback rate to set (1.0 = normal speed, 2.0 = double speed, etc.).

Returns

Task<bool>

A task that returns true if the rate was set successfully, false otherwise.

Resume()

Resumes media playback synchronously from a paused state.

public bool Resume()

Returns

bool

true if resume was successful; false otherwise.

ResumeAsync()

Asynchronously resumes media playback from a paused state.

public Task<bool> ResumeAsync()

Returns

Task<bool>

A task that returns true if resume was successful; false otherwise.

SetCustomErrorHandler(IMediaBlocksPipelineCustomErrorHandler)

Sets a custom error handler for the media blocks pipeline to override default error handling behavior. This allows applications to implement specialized error handling logic for pipeline errors, such as automatic retry logic, error logging to external systems, or graceful degradation strategies.

public void SetCustomErrorHandler(IMediaBlocksPipelineCustomErrorHandler errorHandler)

Parameters

errorHandler IMediaBlocksPipelineCustomErrorHandler

The custom error handler implementation. Set to null to use default error handling.

Remarks

The custom error handler will receive all errors from the MediaBlocks pipeline before they are processed by the default error handling system. This provides an opportunity to inspect, log, or handle errors in application-specific ways. The handler can choose to suppress errors or allow them to propagate to the default handlers.

SetLicenseKey(string, string, string)

Activates the MediaPlayerX with a commercial license key to remove trial limitations and enable full functionality. This method must be called before opening any media source to apply the license. Without a valid license, the player operates in trial mode with evaluation watermarks and time restrictions.

public void SetLicenseKey(string licenseKey, string username, string email)

Parameters

licenseKey string

The license key string received after purchase from VisioForge. This key is unique to your license.

username string

The username or company name associated with the license purchase (currently not validated but reserved for future use).

email string

The email address associated with the license purchase (currently not validated but reserved for future use).

Examples

mediaPlayer.SetLicenseKey("your_license_key", "username", "email@example.com");

Remarks

The license key determines which features and edition capabilities are available:

  • Standard Edition: Core playback features for common media formats
  • Professional Edition: Advanced features including RTSP/RTMP streaming, motion detection, and network sources

Best practices:

  • Call this method immediately after creating the MediaPlayerCoreX instance
  • Store the license key securely (encrypted or in secure configuration)
  • Do not share or expose the license key in public repositories or client-side code

Settings_Load(string)

Loads player settings from a JSON configuration file to restore a previously saved player state. This method deserializes the JSON file and applies the saved configuration to the current player instance.

public bool Settings_Load(string jsonFilename)

Parameters

jsonFilename string

The path to the JSON settings file to load. The file must exist and contain valid JSON.

Returns

bool

Returns true if settings were loaded and applied successfully; false if the file doesn't exist, contains invalid JSON, or deserialization fails.

Remarks

This method is currently not implemented and will always return false. It is reserved for future functionality to support saving and loading complete player configurations including effects, source settings, and playback parameters. When implemented, it will allow users to save player presets and quickly restore them across sessions.

Settings_Save(string, string)

Saves current player settings to a JSON file with optional SDK information file for version tracking. The JSON file contains serialized player configuration that can be loaded later using VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Settings_Load(System.String).

public bool Settings_Save(string jsonFilename, string infoFilename)

Parameters

jsonFilename string

The path where the JSON settings file will be saved. Parent directories will be created if they don't exist.

infoFilename string

Optional path for a separate SDK information file containing version details. Set to null or empty string to skip creating the info file.

Returns

bool

Returns true if the settings files were saved successfully; false if file creation or writing fails.

Remarks

The method creates two files when infoFilename is provided:

  1. jsonFilename: Contains serialized player configuration
  2. infoFilename: Contains SDK version information for compatibility tracking
Existing files at the target paths will be deleted before new files are created. Any IO exceptions during file operations are logged and cause the method to return false.

Snapshot_Get()

Gets a snapshot of the current video frame as a VideoFrameX object.

public VideoFrameX Snapshot_Get()

Returns

VideoFrameX

The video frame snapshot, or null if unavailable.

Snapshot_GetAsync()

Asynchronously gets a snapshot of the current video frame as a VideoFrameX object.

public Task<VideoFrameX> Snapshot_GetAsync()

Returns

Task<VideoFrameX>

A task containing the video frame snapshot, or null if unavailable.

Snapshot_GetSK()

Gets a snapshot of the current video frame as an SKBitmap.

public SKBitmap Snapshot_GetSK()

Returns

SKBitmap

The video frame snapshot as SKBitmap, or null if unavailable.

Snapshot_GetSKAsync()

Asynchronously gets a snapshot of the current video frame as an SKBitmap.

public Task<SKBitmap> Snapshot_GetSKAsync()

Returns

Task<SKBitmap>

A task containing the video frame snapshot as SKBitmap, or null if unavailable.

Snapshot_Save(string, SKEncodedImageFormat, int)

Saves a snapshot of the current video frame to a file.

public bool Snapshot_Save(string filename, SKEncodedImageFormat format, int quality = 85)

Parameters

filename string

The path where the snapshot file will be saved.

format SKEncodedImageFormat

The image format for the snapshot (JPEG, PNG, etc.).

quality int

The image quality for lossy formats [0..100], default is 85.

Returns

bool

Returns true if the snapshot was saved successfully, false otherwise.

Snapshot_SaveAsync(string, SKEncodedImageFormat, int)

Asynchronously saves a snapshot of the current video frame to a file.

public Task<bool> Snapshot_SaveAsync(string filename, SKEncodedImageFormat format, int quality = 85)

Parameters

filename string

The path where the snapshot file will be saved.

format SKEncodedImageFormat

The image format for the snapshot (JPEG, PNG, etc.).

quality int

The image quality for lossy formats [0..100], default is 85.

Returns

Task<bool>

A task that returns true if the snapshot was saved successfully, false otherwise.

Stop()

Stops media playback synchronously and releases all pipeline resources.

public void Stop()

StopAsync()

Asynchronously stops media playback and releases all pipeline resources.

public Task StopAsync()

Returns

Task

A task representing the asynchronous stop operation.

Subtitles_Settings_Update()

Updates subtitle rendering settings in real-time during playback without requiring a restart. Applies the current VisioForge.Core.MediaPlayerX.MediaPlayerCoreX.Subtitles_Settings configuration to the video renderer for immediate visual effect. Changes include font, size, color, position, background, and other subtitle appearance properties.

public void Subtitles_Settings_Update()

Remarks

This method allows dynamic subtitle appearance adjustment while media is playing. Common use cases include:

  • Adjusting subtitle font size for better readability
  • Changing subtitle color to improve contrast
  • Repositioning subtitles on screen
  • Toggling subtitle background for better visibility
The changes take effect immediately without interrupting playback. If no video renderer is active or subtitle settings are null, this method completes without error.

Tags_Read(string)

Reads metadata tags from a media file including artist, album, title, artwork, and technical information. This method supports a wide variety of media formats and container types for comprehensive metadata extraction. Uses TagLib-Sharp library for robust tag reading across different format specifications.

public MediaFileTags Tags_Read(string filename)

Parameters

filename string

The path to the media file from which to extract metadata tags.

Returns

MediaFileTags

A MediaFileTags object containing all extracted metadata including text fields and embedded artwork.

Remarks

All metadata values except pictures are returned as strings. Embedded artwork is returned as byte arrays.

Video_Composition_Add(VideoCompositionElement)

Adds a video composition element to the composition layer for multi-layer video mixing. The element will be composited over the main video stream according to its position and blending settings.

public void Video_Composition_Add(VideoCompositionElement element)

Parameters

element VideoCompositionElement

The video composition element to add to the composition layer.

Video_Composition_Clear()

Removes all video composition elements from the composition layer and releases their resources.

public void Video_Composition_Clear()

Video_Composition_Remove(VideoCompositionElement)

Removes a video composition element from the composition layer and releases its associated resources.

public void Video_Composition_Remove(VideoCompositionElement element)

Parameters

element VideoCompositionElement

The video composition element to remove from the composition layer.

Video_Effects_AddOrUpdateAsync(IBaseVideoEffect)

Asynchronously adds a new video effect to the pipeline or updates an existing effect with the same name. The effect is applied in real-time to the video stream without interrupting playback.

public Task Video_Effects_AddOrUpdateAsync(IBaseVideoEffect effect)

Parameters

effect IBaseVideoEffect

The video effect to add or update in the effects pipeline.

Returns

Task

A task representing the asynchronous operation.

Video_Effects_Clear()

Clears all video effects from the pipeline, returning video processing to the original unmodified stream.

public void Video_Effects_Clear()

Video_Effects_Get(string)

Retrieves a video effect from the pipeline by its unique name.

public IBaseVideoEffect Video_Effects_Get(string effectName)

Parameters

effectName string

The name of the effect to retrieve.

Returns

IBaseVideoEffect

The video effect instance if found; null otherwise.

Video_Effects_RemoveAsync(IBaseVideoEffect)

Asynchronously removes a video effect from the pipeline. Temporarily pauses playback during removal to ensure smooth effect removal without artifacts.

public Task Video_Effects_RemoveAsync(IBaseVideoEffect effect)

Parameters

effect IBaseVideoEffect

The video effect instance to remove from the pipeline.

Returns

Task

A task representing the asynchronous operation.

Video_Effects_RemoveAsync(string)

Removes a video effect by name asynchronously. Pauses playback during removal.

public Task Video_Effects_RemoveAsync(string name)

Parameters

name string

The name of the effect to remove.

Returns

Task

A Task representing the asynchronous operation.

Video_Stream_Select(VideoStreamInfo)

Switches to a different video stream in multi-stream media content. This method allows dynamic switching between video tracks during playback, useful for content with multiple video angles, resolutions, or different video content tracks. The switch occurs seamlessly while maintaining audio playback if present.

public bool Video_Stream_Select(VideoStreamInfo stream)

Parameters

stream VideoStreamInfo

The target video stream to switch to. Must be a valid VisioForge.Core.Types.MediaInfo.VideoStreamInfo from the media's available video streams.

Returns

bool

true if the video stream was successfully switched; false if the operation failed due to invalid source, null stream, or stream event failure.

Remarks

Video stream switching behavior:

  • Maintains current audio stream while switching video
  • Sends a SELECT_STREAMS event to the underlying media pipeline
  • Works during active playback without stopping
  • Requires the media to contain multiple video streams
  • May cause brief visual interruption during the switch
  • The target stream must be available in the current media content Common use cases include multi-angle video content, adaptive bitrate streaming, or educational content with multiple camera views.

IMediaPlayerControls.GetFileThumbnail(string)

Gets a thumbnail image from the specified media file.

SKBitmap IMediaPlayerControls.GetFileThumbnail(string filename)

Parameters

filename string

The path to the media file.

Returns

SKBitmap

An SKBitmap containing the thumbnail image.

Exceptions

NotImplementedException

This method is not yet implemented.

IMediaPlayerControls.NextFrame()

Advances to and displays the next frame in the video.

bool IMediaPlayerControls.NextFrame()

Returns

bool

Returns true if successful, false otherwise.

IMediaPlayerControls.OpenAsync(string)

Opens the specified file or URL asynchronously.

Task<bool> IMediaPlayerControls.OpenAsync(string path)

Parameters

path string

The file path or URL to open.

Returns

Task<bool>

A Task returning true if opened successfully, false otherwise.

IMediaPlayerControls.PrevFrame()

Moves back to and displays the previous frame in the video.

bool IMediaPlayerControls.PrevFrame()

Returns

bool

Returns true if successful, false otherwise.

IMediaPlayerControls.SetSpeed(double)

Sets the playback speed/rate.

bool IMediaPlayerControls.SetSpeed(double value)

Parameters

value double

The playback rate multiplier (e.g., 1.0 = normal, 2.0 = double speed).

Returns

bool

Returns true if the speed was set successfully, false otherwise.

IMediaPlayerControls.SetSpeedAsync(double)

Sets the playback speed/rate asynchronously.

Task<bool> IMediaPlayerControls.SetSpeedAsync(double value)

Parameters

value double

The playback rate multiplier (e.g., 1.0 = normal, 2.0 = double speed).

Returns

Task<bool>

A Task returning true if the speed was set successfully, false otherwise.

IMediaPlayerControls.Volume_Get()

Gets the current audio output volume.

double IMediaPlayerControls.Volume_Get()

Returns

double

The volume level (0.0 to 1.0).

IMediaPlayerControls.Volume_Set(double)

Sets the audio output volume.

void IMediaPlayerControls.Volume_Set(double volume)

Parameters

volume double

The volume level (0.0 to 1.0).

IVideoEffectsControls.VideoEffects_Clear()

Clears all applied video effects.

void IVideoEffectsControls.VideoEffects_Clear()

IVideoEffectsControls.VideoEffects_SetBrightness(double)

Sets the video brightness adjustment level.

void IVideoEffectsControls.VideoEffects_SetBrightness(double value)

Parameters

value double

The brightness value (typically -1.0 to 1.0).

Exceptions

NotImplementedException

This method is not yet implemented.

IVideoEffectsControls.VideoEffects_SetContrast(double)

Sets the video contrast adjustment level.

void IVideoEffectsControls.VideoEffects_SetContrast(double value)

Parameters

value double

The contrast value (typically -1.0 to 1.0).

Exceptions

NotImplementedException

This method is not yet implemented.

IVideoEffectsControls.VideoEffects_SetFlipX(bool)

Enables or disables horizontal video flipping.

void IVideoEffectsControls.VideoEffects_SetFlipX(bool value)

Parameters

value bool

If set to true, video is flipped horizontally.

Exceptions

NotImplementedException

This method is not yet implemented.

IVideoEffectsControls.VideoEffects_SetFlipY(bool)

Enables or disables vertical video flipping.

void IVideoEffectsControls.VideoEffects_SetFlipY(bool value)

Parameters

value bool

If set to true, video is flipped vertically.

Exceptions

NotImplementedException

This method is not yet implemented.

IVideoEffectsControls.VideoEffects_SetGrayscale(bool)

Enables or disables the grayscale video effect.

void IVideoEffectsControls.VideoEffects_SetGrayscale(bool value)

Parameters

value bool

If set to true, grayscale effect is enabled.

Exceptions

NotImplementedException

This method is not yet implemented.

IVideoEffectsControls.VideoEffects_SetInvert(bool)

Enables or disables the color invert video effect.

void IVideoEffectsControls.VideoEffects_SetInvert(bool value)

Parameters

value bool

If set to true, color invert effect is enabled.

Exceptions

NotImplementedException

This method is not yet implemented.

IVideoEffectsControls.VideoEffects_SetSaturation(double)

Sets the video saturation adjustment level.

void IVideoEffectsControls.VideoEffects_SetSaturation(double value)

Parameters

value double

The saturation value (typically -1.0 to 1.0).

Exceptions

NotImplementedException

This method is not yet implemented.

OnAudioFrameBuffer

Occurs whenever a new audio frame is received from the pipeline. Provides access to raw audio data for analysis, processing, or custom rendering.

public event EventHandler<AudioFrameBufferEventArgs> OnAudioFrameBuffer

Event Type

EventHandler<AudioFrameBufferEventArgs>

OnAudioVUMeter

Occurs whenever audio VU meter data is received from the audio pipeline. Provides real-time audio level information for visualization or monitoring.

public event EventHandler<VUMeterXEventArgs> OnAudioVUMeter

Event Type

EventHandler<VUMeterXEventArgs>

OnBarcodeDetected

Occurs when a barcode is detected and decoded in video frames. Provides the decoded barcode data including type and content.

public event EventHandler<BarcodeEventArgs> OnBarcodeDetected

Event Type

EventHandler<BarcodeEventArgs>

OnError

Occurs when an error happens during media playback, pipeline construction, or processing. Subscribe to this event to implement custom error handling and logging.

public event EventHandler<ErrorsEventArgs> OnError

Event Type

EventHandler<ErrorsEventArgs>

OnFaceDetected

Occurs whenever video frames are processed and faces are detected by the face detector. Provides information about detected faces including location, confidence, and facial landmarks.

public event EventHandler<AFFaceDetectionEventArgs> OnFaceDetected

Event Type

EventHandler<AFFaceDetectionEventArgs>

OnLicenseRequired

Occurs when a license is required for specific features being used. The event provides details about the required license level and features requiring licensing.

public event EventHandler<LicenseEventArgs> OnLicenseRequired

Event Type

EventHandler<LicenseEventArgs>

OnMotionDetection

Occurs when motion is detected in video frames. Provides detailed motion information including motion regions, amount, and grid analysis.

public event EventHandler<MotionDetectionExEventArgs> OnMotionDetection

Event Type

EventHandler<MotionDetectionExEventArgs>

OnPause

Occurs when playback is paused.

public event EventHandler<EventArgs> OnPause

Event Type

EventHandler<EventArgs>

OnResume

Occurs when playback resumes from a paused state.

public event EventHandler<EventArgs> OnResume

Event Type

EventHandler<EventArgs>

OnStart

Occurs when playback starts successfully.

public event EventHandler<EventArgs> OnStart

Event Type

EventHandler<EventArgs>

OnStop

Occurs when playback stops or reaches the end of the media.

public event EventHandler<StopEventArgs> OnStop

Event Type

EventHandler<StopEventArgs>

OnStreamsInfoAvailable

Occurs when media stream information becomes available after opening a media source. Provides access to detected audio, video, and subtitle streams in the media content.

public event EventHandler<EventArgs> OnStreamsInfoAvailable

Event Type

EventHandler<EventArgs>

OnVideoFrameBuffer

Occurs whenever a new video frame is received from the pipeline. Provides access to raw video data in VideoFrameX format for custom processing or analysis.

public event EventHandler<VideoFrameXBufferEventArgs> OnVideoFrameBuffer

Event Type

EventHandler<VideoFrameXBufferEventArgs>

OnVideoFrameSKBitmap

Occurs whenever a new video frame is received from the pipeline. Provides access to video data as an SKBitmap for easy image processing with SkiaSharp.

public event EventHandler<VideoFrameSKBitmapEventArgs> OnVideoFrameSKBitmap

Event Type

EventHandler<VideoFrameSKBitmapEventArgs>

PropertyChanged

Property changed event.

public event PropertyChangedEventHandler PropertyChanged

Event Type

PropertyChangedEventHandler

See Also