fix: native DLL packaging + docs cleanup + detailed probe metadata - #2
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.dllbug reported against a real consumer)The packed
.nuspec's<contentFiles>entries were missingcopyToOutput="true". Without it, NuGet's default isfalse--libmp3lame.dll/libFLAC.dllget packed into the.nupkgand 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-repoProjectReference, 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.dllandlibmp3lame.dllnow 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 structuredFormat/StreamdetailPreviously
ProbeResulthad a thin set of flat fields (DurationInSeconds,BitsPerSample,BitRate,SampleRate,Height,Width) plus an opaqueResultJSON 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 likeprobe_scoreor disposition flags):ProbeFormatInfo:FormatName,FormatLongName,SizeBytes,DurationSeconds,StreamCountProbeStreamInfo:CodecType,CodecName,CodecLongName,SampleRate,Channels,ChannelLayout,BitsPerSample,BitRate,IsVariableBitRate,DurationInSamples,TimeBase,Width,HeightEach fact lives in exactly one place now -- no duplication between
Format/Streamor against the old flat fields.Breaking change
ProbeResult.DurationInSeconds/BitsPerSample/BitRate/SampleRate/Height/Width/Resultno longer exist -- useFormat/Streaminstead. Flagged viafeat!:.Test plan
dotnet build --configuration Release(net8.0/net9.0/net10.0)dotnet test --configuration Releasepasses on all three target frameworks (109 passed, 1 pre-existing skip)Format/Streamshape across WAV/FLAC/MP3/AAC/WMA/MOV/MP4 probes🤖 Generated with Claude Code