Skip to content

fix: native DLL packaging + docs cleanup + detailed probe metadata - #2

Merged
cloud-hai-vo merged 4 commits into
mainfrom
fix/native-packaging-and-detailed-probe
Aug 5, 2026
Merged

fix: native DLL packaging + docs cleanup + detailed probe metadata#2
cloud-hai-vo merged 4 commits into
mainfrom
fix/native-packaging-and-detailed-probe

Conversation

@cloud-hai-vo

Copy link
Copy Markdown
Contributor

Summary

Three independent, separately-committed changes:

1. Remove internal platform references (docs-only)
Dropped the two CLAUDE.md prose mentions of the proprietary "DSP" platform this library was originally extracted from. No code identifiers referenced it -- grepped the whole repo to confirm.

2. Fix native DLL packaging (the root cause of the DllNotFoundException: libFLAC.dll bug reported against a real consumer)
The packed .nuspec's <contentFiles> entries were missing copyToOutput="true". Without it, NuGet's default is false -- libmp3lame.dll/libFLAC.dll get packed into the .nupkg and land in the global-packages cache on restore, but are never copied into a consuming project's own output directory for a real <PackageReference> consumer. Our own tests/benchmarks never caught this because they use in-repo ProjectReference, which copies via a completely different (MSBuild-native) mechanism.

Verified by packing locally, restoring into a throwaway console project against a clean NuGet cache, and confirming Native/win-x64/libFLAC.dll and libmp3lame.dll now actually appear in its build output. Before the fix, with a clean cache, they did not.

3. Replace ProbeResult's flat/ad-hoc fields with structured Format/Stream detail
Previously ProbeResult had a thin set of flat fields (DurationInSeconds, BitsPerSample, BitRate, SampleRate, Height, Width) plus an opaque Result JSON string whose shape varied per codec. Replaced with two always-populated typed objects, loosely modeled on ffprobe's format/stream split (not chasing ffprobe's exact schema, and not fabricating fields we can't honestly compute like probe_score or disposition flags):

  • ProbeFormatInfo: FormatName, FormatLongName, SizeBytes, DurationSeconds, StreamCount
  • ProbeStreamInfo: CodecType, CodecName, CodecLongName, SampleRate, Channels, ChannelLayout, BitsPerSample, BitRate, IsVariableBitRate, DurationInSamples, TimeBase, Width, Height

Each fact lives in exactly one place now -- no duplication between Format/Stream or against the old flat fields.

Breaking change

ProbeResult.DurationInSeconds/BitsPerSample/BitRate/SampleRate/Height/Width/Result no longer exist -- use Format/Stream instead. Flagged via feat!:.

Test plan

  • dotnet build --configuration Release (net8.0/net9.0/net10.0)
  • dotnet test --configuration Release passes on all three target frameworks (109 passed, 1 pre-existing skip)
  • Manually verified the packaging fix end-to-end against a clean NuGet cache (see above)
  • Updated/added tests for the new Format/Stream shape across WAV/FLAC/MP3/AAC/WMA/MOV/MP4 probes

🤖 Generated with Claude Code

Drop the two prose references to the proprietary "DSP" platform this
library was originally extracted from -- not relevant to a public repo
and not part of any code identifier, so this is a docs-only change.
The packed nuspec's <contentFiles> entries for libmp3lame.dll/libFLAC.dll
were missing copyToOutput="true". Without it, NuGet's default is false --
the DLLs land in the package and the global-packages cache on restore,
but are never copied into a project's own output directory unless that
project references EggEncoder via ProjectReference (which uses a
completely different, MSBuild-native copy mechanism that happens to work
in-repo for EggEncoder.UnitTests/EggEncoder.Benchmarks and masked this).

Any real downstream consumer using <PackageReference> got a
DllNotFoundException the moment it P/Invoked into libFLAC/libmp3lame,
since NativeLibraryLoader.Resolve computes a path that NuGet never
actually populated. Verified by packing locally, restoring into a fresh
console project against a clean NuGet cache, and confirming
Native/win-x64/*.dll now appear in its build output.
…m detail

ProbeResult previously exposed a thin set of flat fields (DurationInSeconds,
BitsPerSample, BitRate, SampleRate, Height, Width) plus an opaque `Result`
JSON string whose shape varied per codec. Replace both with two typed,
always-populated objects modeled loosely on ffprobe's format/stream split
(without chasing ffprobe's exact schema or fabricating fields ffprobe has
that we can't honestly compute, like probe_score or disposition flags):

- ProbeFormatInfo: FormatName, FormatLongName, SizeBytes, DurationSeconds,
  StreamCount
- ProbeStreamInfo: CodecType, CodecName, CodecLongName, SampleRate,
  Channels, ChannelLayout, BitsPerSample, BitRate, IsVariableBitRate,
  DurationInSamples, TimeBase, Width, Height

Each fact now lives in exactly one place -- e.g. BitRate is on Stream
only (not duplicated onto Format), duration is on Format only (not also
repeated on Stream), since every file this library probes has exactly
one stream and a per-stream copy would just echo the format-level value.

Also adds fractional-second duration (Mp3ProbeResult.DurationSeconds,
MovProbeResult.DurationSeconds) and exposes WavReader.IsFloatFormat,
both needed to populate the new codec_name/duration fields accurately.

BREAKING CHANGE: ProbeResult.DurationInSeconds/BitsPerSample/BitRate/
SampleRate/Height/Width/Result no longer exist. Use Format/Stream instead.
The Format/Stream split only earns its keep when a file can have
multiple streams (ffprobe's actual use case). This library always
probes exactly one stream per file, so the split just added a layer of
nesting (probeResult.Stream.SampleRate) without ever resolving real
ambiguity. Flatten ProbeFormatInfo + ProbeStreamInfo into ProbeResult
directly; drop StreamCount too, since it was always 1 and meaningless
once there's no per-stream collection to count.

BREAKING CHANGE: ProbeResult.Format.* / ProbeResult.Stream.* no longer
exist -- all fields (FormatName, CodecName, SampleRate, etc.) are now
directly on ProbeResult.
@cloud-hai-vo
cloud-hai-vo merged commit 6f94663 into main Aug 5, 2026
3 checks passed
@cloud-hai-vo
cloud-hai-vo deleted the fix/native-packaging-and-detailed-probe branch August 5, 2026 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant