Repository navigation
emberwave v0.3.0
emberwave outside Rust: a player in the browser, published at https://with-developer.github.io/emberwave/, and a C API with prebuilt libraries for Linux, macOS and Windows.
Added
- A browser player (#15):
crates/emberwave-weband the page inweb/, published to GitHub Pages, decode.pwv1files with WebGPU in the page and draw them on a canvas. Decoder::encode_rgbrecords a decode into the caller's command encoder without waiting, andDecoder::rgba_buffergives the picture;GpuContext::from_adaptercreates a context on an adapter the caller chose. Together they let a player keep the picture on the GPU, and they are what the browser player uses.- A C API (#16):
crates/emberwave-ffiwith the headerinclude/emberwave.h, made by cbindgen. Contexts and decoders, packets pushed as they arrive, and the decoded planes or RGB written into the caller's memory; status codes with a message per thread, and panics caught at the boundary. Each release ships the header with a shared and a static library for Linux, macOS and Windows, and a C example decodes every test vector in CI on all three. Decoder::clear,Decoder::start_of_frameandDecoder::lost, which the C API needed.
Changed
GpuContext::new, which blocks, is not part of the WebAssembly build; useGpuContext::new_asyncorGpuContext::from_adapterthere.- A
Decoderdestroys its GPU buffers when it is dropped. Native wgpu freed them then anyway; in a browser they waited for the garbage collector. A clone of the buffer fromDecoder::rgba_bufferdoes not keep it alive.