use bytes::Bytes;
use super::{AudioFormat, ContainerFormat, VideoFormat};
use crate::catalog::VideoHint;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct AudioInit {
pub format: AudioFormat,
pub data: Bytes,
pub label: Option<String>,
pub container: hang::catalog::Container,
}
impl AudioInit {
pub fn new(format: AudioFormat, data: impl Into<Bytes>) -> Self {
Self {
format,
data: data.into(),
label: None,
container: hang::catalog::Container::default(),
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct VideoInit {
pub format: VideoFormat,
pub data: Bytes,
pub label: Option<String>,
pub hint: VideoHint,
}
impl VideoInit {
pub fn new(format: VideoFormat, data: impl Into<Bytes>) -> Self {
Self {
format,
data: data.into(),
label: None,
hint: VideoHint::default(),
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub struct ContainerInit {
pub format: ContainerFormat,
pub data: Bytes,
}
impl ContainerInit {
pub fn new(format: ContainerFormat, data: impl Into<Bytes>) -> Self {
Self {
format,
data: data.into(),
}
}
}