52 lines
1.2 KiB
Rust
52 lines
1.2 KiB
Rust
use serde::Deserialize;
|
|
|
|
#[derive(Debug, Clone, Deserialize)]
|
|
pub struct FFProbeOutput {
|
|
pub format: FFProbeOutputFormat,
|
|
pub streams: Vec<FFProbeOutputStream>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize)]
|
|
pub struct FFProbeOutputStream {
|
|
pub index: u8,
|
|
pub channels: Option<u8>,
|
|
pub duration: String,
|
|
pub codec_name: String,
|
|
pub codec_type: String,
|
|
pub height: Option<u16>,
|
|
pub width: Option<u16>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize)]
|
|
pub struct FFProbeOutputFormat {
|
|
pub tags: FFProbeOutputTags,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize)]
|
|
pub struct FFProbeOutputTags {
|
|
#[serde(alias = "TRACK", alias = "track")]
|
|
pub track_number: Option<String>,
|
|
|
|
#[serde(alias = "TITLE")]
|
|
pub title: String,
|
|
#[serde(default, alias = "ARTIST")]
|
|
pub artist: String,
|
|
|
|
#[serde(default, alias = "REPLAYGAIN_TRACK_PEAK")]
|
|
pub replaygain_track_peak: Option<String>,
|
|
#[serde(default, alias = "REPLAYGAIN_TRACK_GAIN")]
|
|
pub replaygain_track_gain: Option<String>,
|
|
}
|
|
|
|
impl Default for FFProbeOutputTags {
|
|
fn default() -> Self {
|
|
FFProbeOutputTags {
|
|
title: "".to_string(),
|
|
artist: "".to_string(),
|
|
replaygain_track_peak: None,
|
|
replaygain_track_gain: None,
|
|
track_number: None,
|
|
}
|
|
}
|
|
}
|