Closed kornelski closed 5 years ago
I don't know how I feel about this, I'd rather fix the missing cases when ffmpeg-sys upgrades, are any failing currently?
Maybe changing ffmpeg-sys dependency from ffmpeg-sys="3.3" to ffmpeg-sys="~3.3" would be enough? Then it wouldn't pull newer versions of ffmpeg-sys than 3.3.X. With current requirement it can pull every version <4.0.0
Admittedly that's a bit lazy solution, but the Rust wrapper currently does fail to compile because ffmpeg-sys has expanded these enums.
I'm unable to find any version of ffmpeg-sys that compiles with the current master. I guess ffmpeg-sys is using bindgen, and in that case it's not possible go guarantee 1:1 match in these enums (if you add missing items to the enums, they will fail to compile with FFI from an older version of C headers).
Related #90
Can you merge it, and perhaps remove the cases later if you find a solution to lock sys to a specific ffmpeg version?
Any progress on this?
Bindgen authors in 0.3 version changed how enums are generated (https://github.com/rust-lang-nursery/rust-bindgen/issues/758). By default instead of enums bindgen now generated constants. rust-ffmpeg-sys overrides this here: https://github.com/meh/rust-ffmpeg-sys/blob/master/build.rs#L918 Maybe we should drop this and rewrite rust-ffmpeg to use constants, but that would loose compiler check for exhaustiveness.
These enums are likely to get out of sync with ffmpeg_sys, so some flexibility may be useful.