//! FFmpeg PATH probes and the "install ffmpeg" banner for inline video posters.
use crate::prompt_images::InlineMediaInfo;
pub const FFMPEG_HINT_TEXT: &str = "Install ffmpeg to view inline";
/// Latches positives; re-probes negatives so mid-session install recovers posters.
pub fn ffmpeg_available() -> bool {
#[cfg(test)]
if let Some(v) = TEST_FFMPEG_OVERRIDE.with(|c| c.get()) {
return v;
}
use std::sync::atomic::{AtomicBool, Ordering};
static FOUND: AtomicBool = AtomicBool::new(false);
if FOUND.load(Ordering::Relaxed) {
return true;
}
let available = kigi_config::shell::is_command_available("ffmpeg");
if available {
FOUND.store(true, Ordering::Relaxed);
}
available
}
#[cfg(test)]
thread_local! {
static TEST_FFMPEG_OVERRIDE: std::cell::Cell