diff options
Diffstat (limited to 'apps/buffering.h')
-rw-r--r-- | apps/buffering.h | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/apps/buffering.h b/apps/buffering.h index bc61ec5e6d..cd705cec25 100644 --- a/apps/buffering.h +++ b/apps/buffering.h | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <sys/types.h> | 23 | #include <sys/types.h> |
24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
25 | #include "events.h" | ||
25 | 26 | ||
26 | 27 | ||
27 | enum data_type { | 28 | enum data_type { |
@@ -36,8 +37,7 @@ enum data_type { | |||
36 | }; | 37 | }; |
37 | 38 | ||
38 | enum callback_event { | 39 | enum callback_event { |
39 | EVENT_DEFAULT, | 40 | EVENT_BUFFER_LOW = (EVENT_CLASS_BUFFERING|1), |
40 | EVENT_BUFFER_LOW, | ||
41 | EVENT_HANDLE_REBUFFER, | 41 | EVENT_HANDLE_REBUFFER, |
42 | EVENT_HANDLE_CLOSED, | 42 | EVENT_HANDLE_CLOSED, |
43 | EVENT_HANDLE_MOVED, | 43 | EVENT_HANDLE_MOVED, |
@@ -109,23 +109,6 @@ void buf_set_base_handle(int handle_id); | |||
109 | size_t buf_used(void); | 109 | size_t buf_used(void); |
110 | 110 | ||
111 | 111 | ||
112 | /*************************************************************************** | ||
113 | * CALLBACK UTILITIES | ||
114 | * ================== | ||
115 | * | ||
116 | * register_buffering_callback, unregister_buffering_callback: | ||
117 | * | ||
118 | * Register/Unregister callback functions that will get executed when the buffer | ||
119 | * goes below the low watermark. They are executed once, then forgotten. | ||
120 | * | ||
121 | * NOTE: The callbacks are called from the buffering thread, so don't make them | ||
122 | * do too much. Ideally they should just post an event to a queue and return. | ||
123 | ****************************************************************************/ | ||
124 | |||
125 | #define MAX_BUF_CALLBACKS 4 | ||
126 | typedef void (*buffering_callback)(enum callback_event ev, int value); | ||
127 | bool register_buffering_callback(buffering_callback func); | ||
128 | void unregister_buffering_callback(buffering_callback func); | ||
129 | 112 | ||
130 | /* Settings */ | 113 | /* Settings */ |
131 | enum { | 114 | enum { |