Make AVOptionType a bitfield/int wrapper (#57)

* Implement option::Type as bitfield struct

This type is no longer strictly an enum in the
Rust sense because the underlying AVOptionType
is now also a bitfield/the AV_OPT_TYPE* consts
now include AV_OPT_TYPE_FLAG_ARRAY, which is a
bitflag.
This commit is contained in:
FreezyLemon
2024-05-18 01:11:39 +02:00
committed by GitHub
parent 5c6922db8c
commit 0fbdfdb371
2 changed files with 52 additions and 90 deletions

View File

@ -1045,6 +1045,9 @@ fn main() {
// We need/want to implement Debug by hand for some types
.no_debug("AVChannelLayout")
.no_debug("AVChannelCustom")
// In FFmpeg 7.0+, this has bitfield-like behaviour,
// so cannot be a "rustified" enum
.newtype_enum("AVOptionType")
.allowlist_file(r#".*[/\\]libavutil[/\\].*"#)
.allowlist_file(r#".*[/\\]libavcodec[/\\].*"#)
.allowlist_file(r#".*[/\\]libavformat[/\\].*"#)