Conversation
The list in Program.Parse names entry points rather than files: clang follows the includes and ASTProcessor takes every non-system translation unit, so a root brings its whole closure with it - 28 roots reach 62 headers. What a root cannot bring is a leaf nothing includes, and most of libavutil is exactly that. Those only get noticed when somebody asks, which is how libavcodec/exif.h has been sitting unparsed since 8.1 and libavutil/raw_color_params.h since 9.0. Missing one is not only "the type is absent". avformat.h forward-declares AVIAMFAudioElement and AVIAMFMixPresentation, so both are generated - as empty structs marked incomplete, because libavutil/iamf.h is never parsed even though it defines them in full. Reaching them through AVStreamGroup.params compiles and gives you a pointer to a struct with no fields. The generator now lists what it never parsed, split by whether the header can be added at all: twelve of them pull in an SDK this build does not have, and the report names the missing include for each (vulkan/vulkan.h, cuda.h, va/va.h, mfxvideo.h and so on). The remaining seventy include nothing beyond FFmpeg and the C standard library, so any of them is one line in Program.Parse away. It reports, it does not decide: twenty-two of those seventy are ciphers and digests that System.Security.Cryptography already covers, and nobody needs FFmpeg's AES from C#. The point is to see the list after an FFmpeg upgrade rather than to bind all of it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Not a sweep. Twenty-two of the seventy self-contained ones are ciphers and
digests that System.Security.Cryptography already covers, and another handful
are macros or FFmpeg internals. These seven are the ones worth having:
libavutil/parseutils.h av_parse_video_size("1280x720"), av_parse_video_rate,
av_parse_color, av_parse_time
libavutil/tx.h av_tx_init - FFmpeg's FFT and MDCT, which .NET has
no equivalent for
libavutil/eval.h the expression evaluator, for dynamic filter values
libavutil/encryption_info.h AVEncryptionInfo, for CENC streams
libavutil/iamf.h see below
libavutil/hwcontext_drm.h DRM PRIME, the zero-copy path on Linux
libavcodec/exif.h EXIF metadata, new in 8.1 and unparsed since
+52 functions, +25 structs, +11 enums.
iamf.h is not a nice-to-have. avformat.h forward-declares AVIAMFAudioElement
and AVIAMFMixPresentation, so both were already generated - as empty structs,
because the header defining them was never parsed. Anyone reaching them through
AVStreamGroup.params got a pointer to a struct with no fields. They are complete
now. The two structs that became incomplete in their place, AVExpr and
AVTXContext, are forward-declared in FFmpeg on purpose, like AVDictionary and
SwrContext.
Two candidates did not make it, both for reasons the report cannot see:
libavutil/fifo.h crashes the generator. AVFifoCB is a typedef to a function
type rather than to a function pointer, so the parameter arrives as a bare
FunctionType and TypeHelper.GetTypeName has no case for it. That wants a fix in
the generator, not a workaround here.
libavutil/timestamp.h is two static inline helpers and one export, and all
three format text into a caller-supplied char*. The inline bodies would need
hand-porting, and the result would be pointless from C#, where the whole thing
is ts == long.MinValue ? "NOPTS" : ts.ToString().
iamf.h did bring one inline that needed porting -
av_iamf_param_definition_get_subblock, whose body expands av_assert0 into
av_log and abort(). Ported to a bounds check and pointer arithmetic; verified
that regenerating keeps it, which is what the body hash is for.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Two commits: a report that finds headers the parser never saw, and the first batch of what it found.
The report
The list in
Program.Parsenames entry points, not files. Clang follows the includes andASTProcessortakes every non-system translation unit, so a root brings its whole closure — 28 roots reached 62 headers. What a root cannot bring is a leaf that nothing includes, and most of libavutil is exactly that. Those only get noticed when somebody asks:libavcodec/exif.hhad been unparsed since 8.1,libavutil/raw_color_params.hsince 9.0.It prints after processing, is silent when there is nothing to say, and splits the list by whether a header can be added at all:
That split is the point: those twelve cannot be added without installing the SDK named beside them, which is why the list has always been curated. It is a decision, and the report keeps it visible rather than leaving it to memory.
The seven
Not a sweep. Twenty-two of the seventy are ciphers and digests that
System.Security.Cryptographyalready covers; another handful are macros or internals. These earn their place:libavutil/parseutils.hav_parse_video_size("1280x720"),av_parse_video_rate,av_parse_color,av_parse_timelibavutil/tx.hav_tx_init— FFmpeg's FFT and MDCT, which .NET has no equivalent forlibavutil/eval.hlibavutil/encryption_info.hAVEncryptionInfo, for CENC streamslibavutil/iamf.hlibavutil/hwcontext_drm.hlibavcodec/exif.h+52 functions, +25 structs, +11 enums.
iamf.his not a nice-to-have.avformat.hforward-declaresAVIAMFAudioElementandAVIAMFMixPresentation, so both were already generated — as empty structs, because the header that defines them was never parsed. Reaching them throughAVStreamGroup.paramscompiled and handed you a pointer to a struct with no fields. They are complete now. The two that became incomplete in their place,AVExprandAVTXContext, are forward-declared in FFmpeg on purpose, likeAVDictionaryandSwrContext.Two that did not make it
Both for reasons the report cannot see, which is worth recording:
libavutil/fifo.hcrashes the generator.AVFifoCBis a typedef to a function type rather than to a function pointer, so the parameter arrives as a bareFunctionTypeandTypeHelper.GetTypeNamehas no case for it. That wants a fix in the generator, not a workaround here.libavutil/timestamp.his twostatic inlinehelpers and one export, all of which format text into a caller-suppliedchar*. The inline bodies would need hand-porting and the result would be pointless from C#, where the whole thing ists == long.MinValue ? "NOPTS" : ts.ToString().iamf.hdid bring one inline that needed porting —av_iamf_param_definition_get_subblock, whose body expandsav_assert0intoav_logandabort(). Ported to a bounds check and pointer arithmetic, and I confirmed a regeneration keeps it, which is what the body hash is there for.Verification
dotnet build -c Release— 0 errors, 0 warningsdotnet test -c Release— 22/22🤖 Generated with Claude Code