cleanup: narrow SCTE-35 visibility to pub(crate), remove dead target_duration_secs
This commit is contained in:
@@ -5,7 +5,6 @@ use std::time::Duration;
|
|||||||
pub struct PlayoutConfig {
|
pub struct PlayoutConfig {
|
||||||
pub listen_addr: String,
|
pub listen_addr: String,
|
||||||
pub segment_duration_secs: u32,
|
pub segment_duration_secs: u32,
|
||||||
pub target_duration_secs: u32,
|
|
||||||
pub window_size: usize,
|
pub window_size: usize,
|
||||||
pub storage_path: PathBuf,
|
pub storage_path: PathBuf,
|
||||||
pub tick_interval_ms: u64,
|
pub tick_interval_ms: u64,
|
||||||
@@ -17,7 +16,6 @@ impl Default for PlayoutConfig {
|
|||||||
Self {
|
Self {
|
||||||
listen_addr: "0.0.0.0:9090".into(),
|
listen_addr: "0.0.0.0:9090".into(),
|
||||||
segment_duration_secs: 6,
|
segment_duration_secs: 6,
|
||||||
target_duration_secs: 6,
|
|
||||||
window_size: 10,
|
window_size: 10,
|
||||||
storage_path: PathBuf::from("/tmp/k-tv-playout"),
|
storage_path: PathBuf::from("/tmp/k-tv-playout"),
|
||||||
tick_interval_ms: 1000,
|
tick_interval_ms: 1000,
|
||||||
@@ -34,7 +32,6 @@ impl PlayoutConfig {
|
|||||||
}
|
}
|
||||||
if let Some(v) = std::env::var("PLAYOUT_SEGMENT_DURATION").ok().and_then(|v| v.parse().ok()) {
|
if let Some(v) = std::env::var("PLAYOUT_SEGMENT_DURATION").ok().and_then(|v| v.parse().ok()) {
|
||||||
config.segment_duration_secs = v;
|
config.segment_duration_secs = v;
|
||||||
config.target_duration_secs = v;
|
|
||||||
}
|
}
|
||||||
if let Some(v) = std::env::var("PLAYOUT_WINDOW_SIZE").ok().and_then(|v| v.parse().ok()) {
|
if let Some(v) = std::env::var("PLAYOUT_WINDOW_SIZE").ok().and_then(|v| v.parse().ok()) {
|
||||||
config.window_size = v;
|
config.window_size = v;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use crate::config::PlayoutConfig;
|
|||||||
use crate::metadata::{OverlayPayload, TimedMetadata};
|
use crate::metadata::{OverlayPayload, TimedMetadata};
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum Scte35Event {
|
pub(crate) enum Scte35Event {
|
||||||
SpliceOut {
|
SpliceOut {
|
||||||
id: String,
|
id: String,
|
||||||
start: DateTime<Utc>,
|
start: DateTime<Utc>,
|
||||||
@@ -18,13 +18,13 @@ pub enum Scte35Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct PlayoutPlan {
|
pub(crate) struct PlayoutPlan {
|
||||||
pub slots: Vec<ScheduledSlot>,
|
pub slots: Vec<ScheduledSlot>,
|
||||||
pub scte35_events: Vec<Scte35Event>,
|
pub scte35_events: Vec<Scte35Event>,
|
||||||
pub timed_metadata: Vec<TimedMetadata>,
|
pub timed_metadata: Vec<TimedMetadata>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn build_playout_plan(slots: &[ScheduledSlot], config: &PlayoutConfig) -> PlayoutPlan {
|
pub(crate) fn build_playout_plan(slots: &[ScheduledSlot], config: &PlayoutConfig) -> PlayoutPlan {
|
||||||
let scte35_events = detect_midroll_breaks(slots);
|
let scte35_events = detect_midroll_breaks(slots);
|
||||||
let timed_metadata = generate_overlay_triggers(slots, config);
|
let timed_metadata = generate_overlay_triggers(slots, config);
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ fn generate_overlay_triggers(
|
|||||||
triggers
|
triggers
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn render_scte35_daterange(event: &Scte35Event) -> String {
|
pub(crate) fn render_scte35_daterange(event: &Scte35Event) -> String {
|
||||||
match event {
|
match event {
|
||||||
Scte35Event::SpliceOut {
|
Scte35Event::SpliceOut {
|
||||||
id,
|
id,
|
||||||
|
|||||||
Reference in New Issue
Block a user