mirror of
https://github.com/nestriness/nestri.git
synced 2026-12-05 20:24:10 +02:00
At this point, why not.. Calling it `nespyro` since it's slightly modified, uses slang shader language instead, along other things.. --------- Co-authored-by: DatCaptainHorse <DatCaptainHorse@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.0 KiB
Rust
35 lines
1.0 KiB
Rust
use ash::vk;
|
|
use thiserror::Error;
|
|
|
|
use crate::bitstream::BitstreamError;
|
|
|
|
pub type Result<T, E = Error> = std::result::Result<T, E>;
|
|
|
|
#[derive(Debug, Error)]
|
|
pub enum Error {
|
|
#[error("Vulkan: {0}")]
|
|
Vulkan(vk::Result),
|
|
/// The device lacks what the codec needs; every missing piece is named.
|
|
#[error("device cannot run nespyro, missing: {}", .0.join(", "))]
|
|
Unsupported(Vec<String>),
|
|
#[error("invalid configuration: {0}")]
|
|
Config(String),
|
|
#[error(transparent)]
|
|
Bitstream(#[from] BitstreamError),
|
|
/// Every output slot is held by the caller; drop a frame and try again.
|
|
#[error("every output slot is still held")]
|
|
Busy,
|
|
/// The encoder was shut down before the frame was read back.
|
|
#[error("encoder shut down before the frame was read back")]
|
|
Cancelled,
|
|
/// Nothing to decode: no start-of-frame header yet, or already decoded.
|
|
#[error("nothing to decode: {0}")]
|
|
NotReady(&'static str),
|
|
}
|
|
|
|
impl From<vk::Result> for Error {
|
|
fn from(r: vk::Result) -> Self {
|
|
Error::Vulkan(r)
|
|
}
|
|
}
|