From 8e08d7dc6a143e2ff032231adadfcad4f1c8278c Mon Sep 17 00:00:00 2001 From: Zac Gaetano Date: Sun, 10 May 2026 20:39:23 -0400 Subject: [PATCH] =?UTF-8?q?Investigate=20MF=20activation=20=E2=80=94=20Vor?= =?UTF-8?q?tice=203.6.2=20API=20mismatch,=20defer=20port?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added Vortice.MediaFoundation 3.6.2 NuGet package to TeamsISO.Engine so the scaffold compiles when MF_AVAILABLE is defined. However: the scaffold (May 9) was written against an older Vortice surface and the 3.6.2 API has materially changed: - MFVersion not on MediaFactory, MF_LOW_LATENCY moved - IMFAttributes.SetUINT32 replaced with generic Set - IMFMediaType.MajorType / SubType / AvgBitrate property setters → SetGUID(MFAttributeKeys.MajorType, ...) etc. - VideoFormatGuids.RGB32 renamed (likely Rgb32) - IMFMediaBuffer.Lock signature changed (explicit out IntPtr / out int / out int) - IMFSinkWriter.Finalize_ renamed Leaving MF_AVAILABLE undefined for now so the build stays clean. NuGet ref stays so a porter doesn't need to re-add. docs/REAL-TIME-RECORDING.md updated with the deferred status + the specific API gaps to port. --- docs/REAL-TIME-RECORDING.md | 33 ++++++++++++++++++---- src/TeamsISO.Engine/TeamsISO.Engine.csproj | 10 +++++++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/docs/REAL-TIME-RECORDING.md b/docs/REAL-TIME-RECORDING.md index 56b4e25..b78ac16 100644 --- a/docs/REAL-TIME-RECORDING.md +++ b/docs/REAL-TIME-RECORDING.md @@ -14,15 +14,36 @@ It's behind a build flag because activating it requires adding a NuGet dependency. The structural code is already in `src/TeamsISO.Engine/Pipeline/MediaFoundationRecorderSink.cs`. -## Activating it +## Status — May 2026 -1. **Add the NuGet dependency** to the engine project: +**Activation deferred.** The Vortice.MediaFoundation 3.6.2 NuGet package +is referenced from `TeamsISO.Engine.csproj`, but the `MF_AVAILABLE` symbol +is *not* defined. The scaffold in +`src/TeamsISO.Engine/Pipeline/MediaFoundationRecorderSink.cs` was written +against an older Vortice API and needs a port pass before activation: - dotnet add src/TeamsISO.Engine package Vortice.MediaFoundation --version 3.6.2 +- `MFVersion` → not on `MediaFactory` in 3.6.2; pass the SDK version + directly to `MFStartup`. +- `MediaFactory.MF_LOW_LATENCY` → relocated to a different attribute + constants class. +- `IMFAttributes.SetUINT32` → replaced with a generic `Set` overload. +- `IMFMediaType.MajorType` / `.SubType` / `.AvgBitrate` properties + → now use `SetGUID(MFAttributeKeys.MajorType, ...)` etc. +- `VideoFormatGuids.RGB32` → renamed (likely `Rgb32`). +- `IMFMediaBuffer.Lock(out IntPtr, out int, out int)` → explicit out-param + signature, no longer returns a locked-buffer wrapper. +- `IMFSinkWriter.Finalize_` → renamed (likely `Finalize`). - (Pin to a known-good version — Vortice's API surface is stable across - 3.6.x but the engine code targets the namespaces in 3.6.x. If a newer - major version changes namespaces, the file may need adjustment.) +Until the port lands, the `RawBgraRecorderSink` is the only IRecorderSink +production uses. The raw recorder is reliable and FFmpeg post-processing +via the emitted `convert.cmd` produces equivalent .mp4s; you just pay the +disk pressure during the show. + +## Activating it (after the port) + +1. **Update the scaffold** to match Vortice 3.6.2's API surface. A clean + reference implementation lives in the Vortice samples repo under + `samples/MediaFoundationSamples`. 2. **Define the `MF_AVAILABLE` build symbol** in `TeamsISO.Engine.csproj`: diff --git a/src/TeamsISO.Engine/TeamsISO.Engine.csproj b/src/TeamsISO.Engine/TeamsISO.Engine.csproj index 605a92a..848fc51 100644 --- a/src/TeamsISO.Engine/TeamsISO.Engine.csproj +++ b/src/TeamsISO.Engine/TeamsISO.Engine.csproj @@ -2,6 +2,15 @@ net8.0 + + @@ -11,6 +20,7 @@ +