use std::io;
pub type VideoIpResult<T> = Result<T, VideoIpError>;
#[derive(Debug, thiserror::Error)]
pub enum VideoIpError {
#[error("I/O error: {0}")]
Io(#[from] io::Error),
#[error("Invalid video configuration: {0}")]
InvalidVideoConfig(String),
#[error("Invalid audio configuration: {0}")]
InvalidAudioConfig(String),
#[error("Invalid packet: {0}")]
InvalidPacket(String),
#[error("Packet too large: {size} bytes (max {max})")]
PacketTooLarge {
size: usize,
max: usize,
},
#[error("Discovery error: {0}")]
Discovery(String),
#[error("Service not found: {0}")]
ServiceNotFound(String),
#[error("Codec error: {0}")]
Codec(String),
#[error("FEC error: {0}")]
Fec(String),
#[error("Transport error: {0}")]
Transport(String),
#[error("Buffer overflow")]
BufferOverflow,
#[error("Operation timed out")]
Timeout,
#[error("Invalid state: {0}")]
InvalidState(String),
#[error("Metadata error: {0}")]
Metadata(String),
#[error("PTZ control error: {0}")]
Ptz(String),
#[error("Core error: {0}")]
Core(#[from] oximedia_core::error::OxiError),
}