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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//! Safe RAII ownership of a raw `*mut AVFilterInOut` list.
//!
//! An `AVFilterInOut` linked list is not allocated by this crate: libavfilter's
//! `avfilter_graph_segment_apply` / `avfilter_graph_parse_ptr` write a freshly
//! allocated list into a caller-supplied `*mut *mut AVFilterInOut` out-parameter,
//! and the caller must free the whole list with `avfilter_inout_free`. That
//! "output param you must remember to free" is a classic leak surface: any `?`
//! or early return between the parse call and the free leaks the list.
//!
//! [`FilterInOut`] owns the list head and frees it on [`Drop`], so it is freed
//! exactly once on every path. It mirrors [`crate::raw::FilterGraph`], with one
//! twist: the value starts [`empty`](FilterInOut::empty) (null) and is filled by
//! handing FFmpeg [`as_out_ptr`](FilterInOut::as_out_ptr). Unlike `FilterGraph`
//! it is intentionally **not** `Send`: these lists live and die inside a single
//! parse function and never cross threads.
use null_mut;
use ;
/// Sole owner of an `*mut AVFilterInOut` list head.
///
/// Move-only (no `Clone`/`Copy`): one owner ⇒ one [`Drop`] ⇒ the list is freed
/// exactly once. `avfilter_inout_free` frees the entire linked list (every node
/// and its `name`), so owning the head owns the whole list.
pub