zmwangx / rust-ffmpeg

Safe FFmpeg wrapper.
Do What The F*ck You Want To Public License
1.2k stars 195 forks source link

Add patch to support wasm32-wasi target. #139

Closed yanghaku closed 1 month ago

yanghaku commented 1 year ago

changes

  1. libc has no ENODATA, ENOSR, ENOSTR, ETIME for wasm32-wasi target, so I change these into conditional compile.
  2. In wasm32-wasi target, errno is a static variable in errno.h, the member name cannot be named the same as a static, so I change errno to c_errno.

The examples which use ffmpeg-next and compile to wasm32-wasi target can be found at https://github.com/yanghaku/ffmpeg-wasm32-wasi.

Polochon-street commented 1 year ago

Thanks for submitting :) would it be possible for you to also add the same check for target_os=freebsd (regardless of the architecture)? It seems that they are running into the same errors https://github.com/zmwangx/rust-ffmpeg/issues/140

yanghaku commented 1 year ago

Ok

yanghaku commented 1 year ago

I've noticed that changing 'errno' to 'c_errno' would cause interruptions in the original version's API. Therefore, I need to look for an alternative solution for the 'wasm32-wasi' target.

yanghaku commented 1 year ago

Hello! This PR is ready for review, Thanks!

Polochon-street commented 1 month ago

hi! Thanks a lot for submitting this, it looks good! I'll merge it and release a minor version :)