/* This file is part of jellything (https://codeberg.org/metamuffin/jellything) which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2025 metamuffin */ #![feature(exit_status_error)] use serde::{Deserialize, Serialize}; use std::sync::{LazyLock, Mutex}; use tokio::sync::Semaphore; pub mod fragment; pub mod image; pub mod subtitles; pub mod thumbnail; #[rustfmt::skip] #[derive(Debug, Deserialize, Serialize, Default)] pub struct Config { #[serde(default)] pub enable_rkmpp: bool, #[serde(default)] pub enable_rkrga: bool, #[serde(default)] pub use_svtav1: bool, #[serde(default)] pub use_rav1e: bool, pub svtav1_preset: Option, // 0..=13, high is fast pub rav1e_preset: Option, // 0..=10 pub aom_preset: Option, // 0..=8, high is fast pub x264_preset: Option, } pub static CONF_PRELOAD: Mutex> = Mutex::new(None); static CONF: LazyLock = LazyLock::new(|| { CONF_PRELOAD .lock() .unwrap() .take() .expect("transcoder config not preloaded. logic error") }); static LOCAL_IMAGE_TRANSCODING_TASKS: Semaphore = Semaphore::const_new(8); static LOCAL_VIDEO_TRANSCODING_TASKS: Semaphore = Semaphore::const_new(2);