1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! Error types for media probing operations.
/// Errors that can occur during media probing.
#[derive(Debug, thiserror::Error)]
pub enum ProbeError {
/// ffprobe binary not found in PATH.
#[error("ffprobe not found in PATH — install ffmpeg to use media probing")]
FfprobeNotFound,
/// ffmpeg binary not found in PATH.
#[error("ffmpeg not found in PATH — install ffmpeg to use media probing")]
FfmpegNotFound,
/// Process timed out.
#[error("operation timed out after {timeout_secs}s for {url}")]
Timeout {
/// The URL being probed.
url: String,
/// The timeout duration in seconds.
timeout_secs: u64,
},
/// Process exited with non-zero status.
#[error("process failed (exit code {code:?}): {stderr}")]
ProcessFailed {
/// Exit code, if available.
code: Option<i32>,
/// Standard error output.
stderr: String,
},
/// Failed to parse ffprobe JSON output.
#[error("failed to parse ffprobe output: {0}")]
JsonParse(#[from] serde_json::Error),
/// No streams found in the probed media.
#[error("no streams found in media at {0}")]
NoStreams(String),
/// I/O error during subprocess execution.
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
/// HLS playlist recursion depth exceeded.
#[error("HLS playlist recursion depth exceeded (max {0})")]
HlsMaxDepth(u32),
/// HLS playlist loop detected.
#[error("HLS playlist loop detected at {0}")]
HlsLoop(String),
/// libmpv is not available on this system.
#[cfg(feature = "libmpv-backend")]
#[error("libmpv not available: {0}")]
MpvUnavailable(String),
/// libmpv handle initialization failed.
#[cfg(feature = "libmpv-backend")]
#[error("libmpv initialization failed: {0}")]
MpvInitFailed(String),
/// An mpv command or property access failed.
#[cfg(feature = "libmpv-backend")]
#[error("mpv command '{command}' failed: {detail}")]
MpvCommandFailed {
/// The command that was attempted.
command: String,
/// Error details from mpv.
detail: String,
},
}