Crates.io | libyuv |
lib.rs | libyuv |
version | 1.0.0 |
source | src |
created_at | 2022-12-16 20:29:03.374572 |
updated_at | 2024-08-22 07:52:31.377328 |
description | Raw FFI bindings to libyuv libraries. |
homepage | https://github.com/colourful-rtc/libyuv-rs |
repository | https://github.com/colourful-rtc/libyuv-rs |
max_upload_size | |
id | 739165 |
size | 204,547 |
Raw FFI bindings to libyuv libraries,This is an unsafe package.
arch/os | linux | windows | macos |
---|---|---|---|
arm64 | ✅ | ❌ | ✅ |
amd64 | ✅ | ✅ | ❌ |
Add the following to your Cargo.toml:
[dependencies]
libyuv = "0.1"
Convert ARGB to NV12:
let argb = vec![0u8; 1280 * 720 * 4];
let mut nv12 = vec![0u8; 1280 * 720 * 1.5];
let ret = unsafe {
libyuv::argb_to_nv12(
argb.as_ptr(),
1280 * 4,
nv12.as_mut_ptr(),
1280,
nv12.as_mut_ptr().add(1280 * 720),
1280,
1280,
720,
)
};
assert_eq!(ret, 0);
MIT Copyright (c) 2022 Mr.Panda.