-
Notifications
You must be signed in to change notification settings - Fork 0
/
upipe-helper.lua
144 lines (144 loc) · 6.83 KB
/
upipe-helper.lua
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
local ffi = require("ffi")
ffi.cdef [[
typedef int (*upipe_helper_uclock_check)(struct upipe *, struct uref *);
typedef int (*upipe_helper_uref_mgr_check)(struct upipe *, struct uref *);
typedef int (*upipe_helper_ubuf_mgr_check)(struct upipe *, struct uref *);
struct upipe_helper_mgr {
struct upipe_mgr mgr;
struct urefcount refcount;
urefcount_cb refcount_cb;
upipe_helper_uclock_check uclock_check;
upipe_helper_uref_mgr_check uref_check;
upipe_helper_ubuf_mgr_check ubuf_check;
bool (*output)(struct upipe *, struct uref *, struct upump **);
void (*stream_append_cb)(struct upipe *);
};
enum upipe_helper_output_state {
UPIPE_HELPER_OUTPUT_NONE,
UPIPE_HELPER_OUTPUT_VALID,
UPIPE_HELPER_OUTPUT_INVALID,
};
struct upipe_helper {
struct upipe upipe;
struct urefcount urefcount;
struct upipe *output;
struct uref *flow_def;
enum upipe_helper_output_state output_state;
struct uchain request_list;
unsigned int output_size;
struct uchain urefs;
unsigned int nb_urefs;
unsigned int max_urefs;
struct uchain blockers;
struct uclock *uclock;
struct urequest uclock_request;
struct upump_mgr *upump_mgr;
struct uref_mgr *uref_mgr;
struct urequest uref_mgr_request;
struct ubuf_mgr *ubuf_mgr;
struct uref *flow_format;
struct urequest ubuf_mgr_request;
struct upipe *first_inner;
struct uchain input_request_list;
struct uprobe last_inner_probe;
struct upipe *last_inner;
bool acquired;
struct uref *next_uref;
size_t next_uref_size;
struct uchain stream_urefs;
struct uref *flow_def_input;
struct uref *flow_def_attr;
struct upump *upump;
};
struct upipe *upipe_helper_to_upipe(struct upipe_helper *);
struct upipe_helper *upipe_helper_from_upipe(struct upipe *);
void upipe_helper_block_input_cb(struct upump_blocker *);
int upipe_helper_probe_bin_output(struct uprobe *, struct upipe *, int, va_list);
int upipe_helper_provide_bin_proxy(struct urequest *, va_list);
int upipe_helper_provide_output_proxy(struct urequest *, va_list);
int upipe_helper_provide_uclock(struct urequest *, va_list);
int upipe_helper_provide_uref_mgr(struct urequest *, va_list);
int upipe_helper_provide_ubuf_mgr(struct urequest *, va_list);
void upipe_helper_free(struct upipe *);
void upipe_helper_dead_urefcount(struct urefcount *);
void upipe_helper_init_urefcount(struct upipe *);
void upipe_helper_clean_urefcount(struct upipe *);
void upipe_helper_init_output(struct upipe *);
void upipe_helper_output(struct upipe *, struct uref *, struct upump **);
int upipe_helper_register_output_request(struct upipe *, struct urequest *);
int upipe_helper_unregister_output_request(struct upipe *, struct urequest *);
int upipe_helper_alloc_output_proxy(struct upipe *, struct urequest *);
int upipe_helper_free_output_proxy(struct upipe *, struct urequest *);
void upipe_helper_store_flow_def(struct upipe *, struct uref *);
int upipe_helper_get_flow_def(struct upipe *, struct uref **);
int upipe_helper_get_output(struct upipe *, struct upipe **);
int upipe_helper_set_output(struct upipe *, struct upipe *);
void upipe_helper_clean_output(struct upipe *);
void upipe_helper_init_output_size(struct upipe *, unsigned int);
int upipe_helper_get_output_size(struct upipe *, unsigned int *);
int upipe_helper_set_output_size(struct upipe *, unsigned int);
void upipe_helper_clean_output_size(struct upipe *);
void upipe_helper_init_input(struct upipe *);
void upipe_helper_block_input(struct upipe *, struct upump **);
void upipe_helper_unblock_input(struct upipe *);
bool upipe_helper_check_input(struct upipe *);
void upipe_helper_hold_input(struct upipe *, struct uref *);
struct uref *upipe_helper_pop_input(struct upipe *);
bool upipe_helper_output_input(struct upipe *);
int upipe_helper_get_max_length(struct upipe *, unsigned int *);
int upipe_helper_set_max_length(struct upipe *, unsigned int);
void upipe_helper_clean_input(struct upipe *);
bool upipe_helper_flush_input(struct upipe *);
void upipe_helper_init_uclock(struct upipe *);
void upipe_helper_require_uclock(struct upipe *);
void upipe_helper_clean_uclock(struct upipe *);
void upipe_helper_init_upump_mgr(struct upipe *);
int upipe_helper_attach_upump_mgr(struct upipe *);
int upipe_helper_check_upump_mgr(struct upipe *);
void upipe_helper_clean_upump_mgr(struct upipe *);
void upipe_helper_init_uref_mgr(struct upipe *);
void upipe_helper_require_uref_mgr(struct upipe *);
bool upipe_helper_demand_uref_mgr(struct upipe *);
void upipe_helper_clean_uref_mgr(struct upipe *);
void upipe_helper_init_ubuf_mgr(struct upipe *);
void upipe_helper_require_ubuf_mgr(struct upipe *, struct uref *);
bool upipe_helper_demand_ubuf_mgr(struct upipe *, struct uref *);
void upipe_helper_clean_ubuf_mgr(struct upipe *);
void upipe_helper_init_bin_input(struct upipe *);
void upipe_helper_bin_input(struct upipe *, struct uref *, struct upump **);
void upipe_helper_store_first_inner(struct upipe *, struct upipe *);
int upipe_helper_register_bin_request(struct upipe *, struct urequest *);
int upipe_helper_unregister_bin_request(struct upipe *, struct urequest *);
int upipe_helper_alloc_bin_proxy(struct upipe *, struct urequest *);
int upipe_helper_free_bin_proxy(struct upipe *, struct urequest *);
int upipe_helper_control_bin_input(struct upipe *, int, va_list);
void upipe_helper_clean_bin_input(struct upipe *);
void upipe_helper_init_bin_output(struct upipe *, struct urefcount *);
void upipe_helper_store_last_inner(struct upipe *, struct upipe *);
int upipe_helper_register_bin_output_request(struct upipe *, struct urequest *);
int upipe_helper_unregister_bin_output_request(struct upipe *, struct urequest *);
int upipe_helper_set_bin_output(struct upipe *, struct upipe *);
int upipe_helper_control_bin_output(struct upipe *, int, va_list);
void upipe_helper_clean_bin_output(struct upipe *);
void upipe_helper_init_sync(struct upipe *);
int upipe_helper_sync_lost(struct upipe *);
int upipe_helper_sync_acquired(struct upipe *);
void upipe_helper_clean_sync(struct upipe *);
void upipe_helper_init_uref_stream(struct upipe *);
void upipe_helper_append_uref_stream(struct upipe *, struct uref *);
void upipe_helper_consume_uref_stream(struct upipe *, size_t);
struct uref *upipe_helper_extract_uref_stream(struct upipe *, size_t);
void upipe_helper_clean_uref_stream(struct upipe *);
void upipe_helper_init_flow_def(struct upipe *);
struct uref *upipe_helper_alloc_flow_def_attr(struct upipe *);
struct uref *upipe_helper_make_flow_def(struct upipe *);
bool upipe_helper_check_flow_def_attr(struct upipe *, struct uref *);
struct uref *upipe_helper_store_flow_def_attr(struct upipe *, struct uref *);
struct uref *upipe_helper_store_flow_def_input(struct upipe *, struct uref *);
void upipe_helper_clean_flow_def(struct upipe *);
void upipe_helper_init_upump(struct upipe *);
void upipe_helper_set_upump(struct upipe *, struct upump *);
void upipe_helper_wait_upump(struct upipe *, uint64_t, upump_cb);
void upipe_helper_clean_upump(struct upipe *);
]]
libupipe_helper = ffi.load("libupipe-helper.so", true)