Table of Contents

Common Extension Libraries

The VAST.Common.Ext.* assemblies provide platform-specific functionality that cannot be implemented in a cross-platform manner. These extensions include hardware-accelerated encoding/decoding, native device capture, video/audio rendering, and platform-specific APIs.

Overview

Each platform extension assembly builds upon VAST.Common to provide:

  • Hardware Acceleration - GPU-accelerated video encoding and decoding
  • Device Capture - Native access to cameras, microphones, and screens
  • Media Rendering - Platform-native video and audio playback
  • Platform APIs - Integration with OS-specific multimedia frameworks

Extension Assembly Reference

Assembly Platform Key Features
VAST.Common.Ext.Win32 Windows Media Foundation, DirectShow, Direct3D, ASIO, WASAPI, Screen Capture, Video/Audio Rendering, OpenGL
VAST.Common.Ext.Linux Linux Screen capture, OpenGL
VAST.Common.Ext.macOS macOS VideoToolbox, AudioToolbox, Metal, AVFoundation, Video/Audio Rendering, OpenGL
VAST.Common.Ext.iOS iOS VideoToolbox, AudioToolbox, Metal, AVFoundation, Video/Audio Rendering, OpenGL
VAST.Common.Ext.MacCatalyst Mac Catalyst VideoToolbox, AudioToolbox, Metal, AVFoundation, Video/Audio Rendering
VAST.Common.Ext.Android Android MediaCodec, Video/Audio Capture, Video/Audio Rendering, OpenGL
VAST.Common.Ext.ASP ASP.NET Core ASP.NET Core specific integration
VAST.Common.Ext.ASP.Win32 ASP.NET + Windows ASP integration + Win32 features
VAST.Common.Ext.ASP.Linux ASP.NET + Linux ASP integration + Linux features
VAST.Common.Ext.ASP.macOS ASP.NET + macOS ASP integration + macOS features

Choosing an Extension

Desktop Applications

For desktop applications with UI, choose the extension matching your target OS:

Target Extension
Windows (WPF, WinForms, WinUI, MAUI) VAST.Common.Ext.Win32

Mobile Applications

For mobile applications, choose based on your target platform:

Target Extension
iOS VAST.Common.Ext.iOS
Android VAST.Common.Ext.Android
Mac Catalyst (iPad apps on Mac) VAST.Common.Ext.MacCatalyst

Server Applications

For ASP.NET Core server applications, use the combined ASP extensions that include both web server integration and platform-specific acceleration:

Target Extension
Windows Server VAST.Common.Ext.ASP.Win32
Linux Server VAST.Common.Ext.ASP.Linux
macOS Server VAST.Common.Ext.ASP.macOS

For headless server applications without platform-specific features, use VAST.Common.Ext.ASP alone.

Hardware Acceleration

Video Decoding

Each platform extension provides hardware-accelerated video decoding through native APIs:

Platform Technology Supported Codecs
Windows Media Foundation H.264, H.265, MPEG-2, VP9
macOS/iOS VideoToolbox H.264, H.265, ProRes
Android MediaCodec H.264, H.265 (device-dependent)

Video Encoding

Hardware-accelerated encoding is available on supported platforms:

Platform Technology Supported Codecs
Windows Media Foundation H.264, H.265
macOS/iOS VideoToolbox H.264, H.265
Android MediaCodec H.264, H.265 (device-dependent)

Device Capture

Video Capture

Each extension provides access to platform-native camera APIs:

Platform Technology Features
Windows Media Foundation, DirectShow Webcams, capture cards, virtual cameras
macOS AVFoundation Built-in camera, external cameras
iOS AVFoundation Front/rear cameras, depth camera
Android Camera API Front/rear cameras, external USB cameras

Audio Capture

Audio input is supported through native APIs:

Platform Technology Features
Windows WASAPI, ASIO, Media Foundation, DirectShow Microphones, line-in, loopback capture
macOS/iOS AudioToolbox Built-in mic, external audio devices
Android AudioRecord Built-in mic, USB audio

Screen Capture

Desktop screen capture is available on supported platforms:

Platform Technology Features
Windows DXGI Desktop Duplication Full screen, window, region capture
Linux X11 Full screen, window, region capture

Rendering

Video Rendering

Platform-native video rendering provides optimal performance:

Platform Technology Features
Windows Direct3D 11, OpenGL Hardware scaling, color conversion
macOS Metal, OpenGL Hardware scaling, color conversion
iOS Metal, OpenGL ES Hardware scaling, HDR support
Android TextureView, SurfaceView Hardware scaling, HDR support

Audio Rendering

Audio output through native APIs:

Platform Technology Features
Windows WASAPI Low-latency playback, exclusive mode
macOS/iOS AudioToolbox System audio integration
Android AudioTrack Low-latency playback

Initialization

Platform extensions are typically initialized automatically when you reference them in your project. However, depending on your linker settings, you may need to explicitly call initialization function, to prevent the assembly from getting purged:

// iOS example - the call doesn't do anything, it's just a placeholder
VAST.Platform.AppleGlobal.Initialize();

Framework Selection

The DecoderFactory and EncoderFactory classes automatically select the best available framework. You can override this behavior using DecoderParameters or EncoderParameters:

// Prefer hardware acceleration
var parameters = new VAST.Media.DecoderParameters
{
    PreferHardwareAcceleration = true
};

var decoder = VAST.Media.DecoderFactory.Create(
    encodedMediaType,
    decodedMediaType,
    parameters);

See Also