FFmpeg.AutoGen icon indicating copy to clipboard operation
FFmpeg.AutoGen copied to clipboard

Missing AV_CODEC_HW_CONFIG_METHOD_* enum in autogen

Open Revan1985 opened this issue 11 months ago • 8 comments

Hello, I have noticed that some enum (in my case AV_CODEC_HW_CONFIG_METHOD_*), are missing from Codec Hw section.

Revan1985 avatar Feb 27 '25 14:02 Revan1985

well enum has no type name - one day maybe

Ruslan-B avatar Apr 07 '25 11:04 Ruslan-B

I als noticed this missing enum/constant I think in this case you shoud do the following:

  • find the longest common prefix of the enum values => AV_CODEC_HW_CONFIG_METHOD
  • "clean" this name. remove the underscores, convert to CamelCase =>AvCodecHwConfigMethod (- if you want to make nicer, you could add a dictionary which contains the words which should be kept in the current format, like "AV" => AVCodecHwConfigMethod)
  • If the generated string is let's say at least 5 characters => use that name, otherwise ignore the enum

zgabi avatar Apr 07 '25 12:04 zgabi

Well, I guess, declare this in your code - profit. I rather not as need to deal with other 100+ edge cases otherwise. :)

Ruslan-B avatar Apr 07 '25 12:04 Ruslan-B

enum { /** * The codec supports this format via the hw_device_ctx interface. * * When selecting this format, AVCodecContext.hw_device_ctx should * have been set to a device of the specified type before calling * avcodec_open2(). / AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX = 0x01, /* * The codec supports this format via the hw_frames_ctx interface. * * When selecting this format for a decoder, * AVCodecContext.hw_frames_ctx should be set to a suitable frames * context inside the get_format() callback. The frames context * must have been created on a device of the specified type. * * When selecting this format for an encoder, * AVCodecContext.hw_frames_ctx should be set to the context which * will be used for the input frames before calling avcodec_open2(). / AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX = 0x02, /* * The codec supports this format by some internal method. * * This format can be selected without any additional configuration - * no device or frames context is required. / AV_CODEC_HW_CONFIG_METHOD_INTERNAL = 0x04, /* * The codec supports this format by some ad-hoc method. * * Additional settings and/or function calls are required. See the * codec-specific documentation for details. (Methods requiring * this sort of configuration are deprecated and others should be * used in preference.) */ AV_CODEC_HW_CONFIG_METHOD_AD_HOC = 0x08, };

Ruslan-B avatar Apr 07 '25 12:04 Ruslan-B

Thank you. Yes, I have already done in this way, just to inform you if needed.

Revan1985 avatar Apr 08 '25 06:04 Revan1985

There are some more missing enums. The first enum values are the following (some enums contains only 1 value) AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT => 3 values (AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX => 4 values) AV_FRAME_CROP_UNALIGNED => 1 value AV_HWFRAME_MAP_READ => 4 values AV_OPT_FLAG_IMPLICIT_KEY =>1 value AVFILTER_AUTO_CONVERT_ALL => 2 values

zgabi avatar Apr 08 '25 09:04 zgabi

I'll do this but later - all of them have no name most probably I'll add a type where all will be listed as Constants. AV_...

Low prio now. Have to address size_t for different platforms

Ruslan-B avatar Apr 08 '25 09:04 Ruslan-B

Look at this PR please. I'm not saying it's perfect, but at least it generates something

https://github.com/Ruslan-B/FFmpeg.AutoGen/pull/323

zgabi avatar Apr 08 '25 11:04 zgabi