Broiler.Media.Video.Windows
0.1.0-preview.13
See the version list below for details.
dotnet add package Broiler.Media.Video.Windows --version 0.1.0-preview.13
NuGet\Install-Package Broiler.Media.Video.Windows -Version 0.1.0-preview.13
<PackageReference Include="Broiler.Media.Video.Windows" Version="0.1.0-preview.13" />
<PackageVersion Include="Broiler.Media.Video.Windows" Version="0.1.0-preview.13" />
<PackageReference Include="Broiler.Media.Video.Windows" />
paket add Broiler.Media.Video.Windows --version 0.1.0-preview.13
#r "nuget: Broiler.Media.Video.Windows, 0.1.0-preview.13"
#:package Broiler.Media.Video.Windows@0.1.0-preview.13
#addin nuget:?package=Broiler.Media.Video.Windows&version=0.1.0-preview.13&prerelease
#tool nuget:?package=Broiler.Media.Video.Windows&version=0.1.0-preview.13&prerelease
Broiler.Media
Broiler.Media is the decode-first media component for Broiler. It owns image, audio, and video decoding, format probing, and codec selection, behind small abstraction assemblies with one concrete implementation assembly per media kind. Rendering, windowing, networking, and HTML media-element behaviour deliberately live outside this component.
Preview release. Publishing selects the next unused preview. Public names, XML documentation, and the
MediaLimits/pixel-format contracts are not frozen yet and may change before1.0. See the roadmap for what is still open.
Installation
Preview packages need an explicit prerelease opt-in:
dotnet add package Broiler.Media.All --prerelease
Broiler.Media.All is a dependencies-only meta-package covering all eight runtime
assemblies, including the Windows video contracts and Media Foundation backend. To take only what you need, reference the individual
packages instead — for example, image decoding alone:
dotnet add package Broiler.Media.Image.Managed --prerelease
The Windows-only video backend can also be referenced individually:
dotnet add package Broiler.Media.Video.MediaFoundation --prerelease
All packages target net10.0 and can be built on either host. Media Foundation
playback requires Windows; its public APIs carry Windows platform annotations.
Each Media Foundation engine owns a dedicated COM thread. Native notifications and output lifecycle callbacks are dispatched asynchronously; implementations that touch UI state must marshal that work to their UI dispatcher. Disposing a session cancels pending output work and releases the native engine without waiting for application output callbacks to finish.
Assemblies
| Assembly | Role |
|---|---|
Broiler.Media |
Shared base: MediaCodec, the immutable MediaCodecCatalog, probing, MediaInput, limits, diagnostics, and the base output lifecycle. |
Broiler.Media.Audio |
Audio abstraction: AudioCodec, AudioBuffer, AudioStreamInfo, IAudioOutput. |
Broiler.Media.Audio.Managed |
Managed audio decoders (RIFF/WAVE PCM). |
Broiler.Media.Video |
Video abstraction: VideoCodec, IVideoSession, IVideoOutput, session state/events. |
Broiler.Media.Video.Windows |
Borrowed-HWND presentation contracts, including IHwndVideoOutput. |
Broiler.Media.Video.MediaFoundation |
Windows-only video via IMFMediaEngine, presenting to a borrowed HWND through IHwndVideoOutput. |
Broiler.Media.Image |
Image abstraction: ImageCodec, ImageBuffer, ImageFrame, ImageSequence. |
Broiler.Media.Image.Managed |
Managed image codecs (PNG/APNG, JPEG, BMP, GIF, WebP). |
Each runtime assembly ships as its own NuGet package; applications opt into the media
kinds and implementations they need. Broiler.Media is the base, not an everything-bundle.
One additional package ships no assembly of its own:
| Package | Role |
|---|---|
Broiler.Media.All |
Dependencies-only meta-package over all eight runtime assemblies. Media Foundation playback requires Windows. |
Dependency direction
Broiler.Media.Audio.Managed -> Broiler.Media.Audio -> Broiler.Media
Broiler.Media.Video.MediaFoundation -> Broiler.Media.Video -> Broiler.Media
Broiler.Media.Video.MediaFoundation -> Broiler.Media.Video.Windows -> Broiler.Media.Video
Broiler.Media.Image.Managed -> Broiler.Media.Image -> Broiler.Media
Broiler.Graphics -> Broiler.Media.Image (abstraction only)
Broiler.Graphics.Windows -> Broiler.Media.Video.Windows (implements the borrowed HWND contract)
The abstraction assemblies are platform-neutral, safe-code, trimming- and AOT-friendly, and reference no implementation, no Graphics/HTML, and no native/Media Foundation package.
Supported formats
| Kind | Format | Decode | Encode | Notes | Assembly |
|---|---|---|---|---|---|
| Image | PNG / APNG | ✅ | ✅ | animation (frame blend/dispose, loop) | .Image.Managed |
| Image | JPEG | ✅ | ✅ | baseline + progressive decode; baseline encode | .Image.Managed |
| Image | BMP | ✅ | ✅ | 24/32-bit decode; 32-bit encode | .Image.Managed |
| Image | GIF | ✅ | ✅ | animation | .Image.Managed |
| Image | WebP | ✅ | ✅ | lossless + animation; lossy VP8 decode needs the optional Windows WebP extension and reports a capability error without it | .Image.Managed |
| Audio | RIFF/WAVE PCM | ✅ | — | streaming; 8/16/24/32-bit PCM + IEEE float | .Audio.Managed |
| Video | MP4 (H.264/AAC) | ✅ | — | Windows-only, direct IMFMediaEngine presentation to an HWND |
.Video.MediaFoundation |
Additional audio codecs (MP3/AAC/Vorbis/Opus/FLAC) and non-Media-Foundation video providers are future work; the stack reports a deterministic capability error for formats it does not support rather than a misleading placeholder.
Selecting and using a codec
Codec selection is explicit — there is no process-wide mutable Current singleton and no
module-initializer side effects. The application composition root builds one immutable catalog
and reuses it:
var catalog = new MediaCodecCatalog(ManagedImageCodecs.CreateCodecs()); // or audio/video codecs
using var input = new MediaInput(stream, new MediaSourceHints(mimeType: "image/png"));
MediaCodecMatch? match = await catalog.SelectAsync(MediaKind.Image, input);
if (match?.Codec is ImageCodec codec)
ImageSequence decoded = await codec.DecodeAsync(input);
Selection is content-probe first: MIME type, file extension, and URL are hints only.
Consumers register the codec set at their own composition root:
- Graphics decodes images through an injected catalog via
Broiler.Graphics.BImageCodecs.Use(...)(Graphics references onlyBroiler.Media.Image, never the implementation). - Browser/app playback (the
<audio>/<video>playback clock, transport, and element state machine) lives in the Broiler HTML/application component — never in this one.
Security and reliability
All media is untrusted input. Decoders enforce configurable MediaLimits (encoded byte count,
image/video dimensions and pixel/frame counts, audio channels/sample-rate/duration, probe bytes
and time, queued/decoded memory) and use checked arithmetic for dimensions, strides, and
allocation sizes. Malformed data produces a bounded MediaException carrying a MediaError
(codec id and byte offset where safe) — never unbounded allocation, hangs, silent partial
success, or arbitrary exception leakage. See
ADR 0002
for buffer ownership and limits.
Repository layout
src/ runtime assemblies, one directory per package
src/tests/ one self-hosted test runner executable per assembly
eng/ vendored packaging metadata and package icon
docs/ roadmap and architecture decision records
Broiler.Media.slnx solution over every project in src/ and src/tests/
The repository is standalone and has no Graphics submodule or package dependency.
The application supplies the borrowed HWND through IHwndVideoOutput.
WIC and Media Foundation declarations are shared through the
Broiler.Native.Windows package, currently 0.1.0-preview.3. Codec behavior and
Media error mapping remain here. NuGet.config restores Native packages from
the Broiler-Platform GitHub Packages feed and other dependencies from NuGet.org.
A sibling Native checkout does not replace these package references.
For local restore, set NuGetPackageSourceCredentials_github to
Username=YOUR_GITHUB_USER;Password=YOUR_TOKEN;ValidAuthenticationTypes=Basic, using
a personal access token (classic) with read:packages. Keep credentials out of
the repository. CI and publishing supply this variable from GITHUB_TOKEN.
In the GitHub package settings for both Broiler.Native.Windows and its
dependency Broiler.Native, grant Broiler-Platform/Broiler.Media read access
under Manage Actions access. Workflow packages: read permission alone does
not grant access to another repository's private packages. See
GitHub's NuGet authentication documentation.
The referenced Native versions are also published on NuGet.org, so consumers using only NuGet.org can restore Media. When bumping the Native reference, publish that Native version to NuGet.org first; selecting the Media publish target does not publish its dependencies or change the restore feed.
Building and testing
git clone https://github.com/Broiler-Platform/Broiler.Media.git
The solution uses Debug and Release configurations.
dotnet build Broiler.Media.slnx -c Release
All runtime libraries and test runners build in both configurations. The test script runs the Media Foundation suite only on Windows.
Tests are self-hosted console runners rather than a test framework, so there is
nothing for dotnet test to discover. After building, run every suite the
configuration enables (pass the same configuration used for the build):
./eng/run-tests.sh Release
Or run one directly:
dotnet run --project src/tests/Broiler.Media.Image.Managed.Tests -c Release
To produce the packages locally:
pwsh -File eng/pack.ps1
Continuous integration and releases
CI runs the six portable suites on Linux and Windows, plus Media Foundation on Windows, and packs all nine packages. Publish selects the next preview unused on both NuGet.org and GitHub Packages, reuses CI, verifies consumer restore from the selected destination, and publishes the resulting artifacts. Manual runs default to a dry run.
See CI, packages, and releases for dependency management, feed credentials, version selection, and release tags.
Packaging
Packages are published per assembly with lockstep versioning, Apache-2.0 licensing,
symbol packages (.snupkg), and SourceLink. The meta-package contains dependencies
only and has no symbol package. Shared metadata is vendored from
eng/Broiler.Packaging.props; repository overrides, including any preview floor,
live in Directory.Build.props. All runtime packages target net10.0.
Design records
License
Apache-2.0. See LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Broiler.Media.Video (>= 0.1.0-preview.13)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Broiler.Media.Video.Windows:
| Package | Downloads |
|---|---|
|
Broiler.Graphics.Windows
Windows Direct2D/DirectWrite backend for Broiler.Graphics, with window and input integration and an HWND-backed video presentation target. |
|
|
Broiler.Media.Video.MediaFoundation
Windows Media Foundation-backed video implementation for Broiler.Media.Video. |
|
|
Broiler.Media.All
Meta-package that pulls in the full Broiler.Media stack: core, audio, image, video, managed codecs, and the Windows Media Foundation backend. Media Foundation playback requires Windows. |
|
|
Broiler.Input.Camera.Windows
Windows Media Foundation camera input provider for Broiler. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.15 | 244 | 10/11/2026 |
| 0.1.0-preview.14 | 839 | 9/22/2026 |
| 0.1.0-preview.13 | 323 | 9/22/2026 |