mirror of
https://github.com/v0l/zap-stream-core.git
synced 2025-06-19 13:25:46 +00:00
Progress
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
use crate::fraction::Fraction;
|
||||
use std::fmt::{Display, Formatter};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
|
||||
@ -71,7 +71,7 @@ impl Display for VideoVariant {
|
||||
pub struct AudioVariant {
|
||||
/// Unique ID of this variant
|
||||
pub id: Uuid,
|
||||
|
||||
|
||||
/// Source video stream to use for this variant
|
||||
pub src_index: usize,
|
||||
|
||||
@ -89,6 +89,9 @@ pub struct AudioVariant {
|
||||
|
||||
/// Sample rate
|
||||
pub sample_rate: usize,
|
||||
|
||||
/// Sample format as ffmpeg sample format string
|
||||
pub sample_fmt: String,
|
||||
}
|
||||
|
||||
impl Display for AudioVariant {
|
||||
@ -102,3 +105,14 @@ impl Display for AudioVariant {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl VariantStream {
|
||||
pub fn src_index(&self) -> usize {
|
||||
match self {
|
||||
VariantStream::Video(v) => v.src_index,
|
||||
VariantStream::Audio(v) => v.src_index,
|
||||
VariantStream::CopyVideo(v) => v.clone(),
|
||||
VariantStream::CopyAudio(v) => v.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user