PipeWire  0.3.33
work-queue.h
Go to the documentation of this file.
1 /* PipeWire
2  *
3  * Copyright © 2018 Wim Taymans
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 
25 #ifndef PIPEWIRE_WORK_QUEUE_H
26 #define PIPEWIRE_WORK_QUEUE_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
39 struct pw_work_queue;
40 
41 #include <pipewire/loop.h>
42 
43 typedef void (*pw_work_func_t) (void *obj, void *data, int res, uint32_t id);
44 
45 struct pw_work_queue *
46 pw_work_queue_new(struct pw_loop *loop);
47 
48 void
49 pw_work_queue_destroy(struct pw_work_queue *queue);
50 
51 uint32_t
52 pw_work_queue_add(struct pw_work_queue *queue,
53  void *obj, int res,
54  pw_work_func_t func, void *data);
55 
56 int
57 pw_work_queue_cancel(struct pw_work_queue *queue, void *obj, uint32_t id);
58 
59 int
60 pw_work_queue_complete(struct pw_work_queue *queue, void *obj, uint32_t seq, int res);
61 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif /* PIPEWIRE_WORK_QUEUE_H */
pw_work_queue_destroy
void pw_work_queue_destroy(struct pw_work_queue *queue)
Destroy a work queue.
Definition: work-queue.c:132
pw_work_func_t
void(* pw_work_func_t)(void *obj, void *data, int res, uint32_t id)
Definition: work-queue.h:43
NAME
#define NAME
Definition: work-queue.c:35
string.h
loop.h
data
user data to add to an object
Definition: filter.c:75
spa_list_for_each
#define spa_list_for_each(pos, head, member)
Definition: list.h:111
pw_loop
Definition: src/pipewire/loop.h:47
SPA_EXPORT
#define SPA_EXPORT
Definition: defs.h:208
pw_log_trace
#define pw_log_trace(...)
Definition: src/pipewire/log.h:90
pw_work_queue_complete
int pw_work_queue_complete(struct pw_work_queue *queue, void *obj, uint32_t seq, int res)
Complete a work item.
Definition: work-queue.c:247
spa_list
Definition: list.h:37
work-queue.h
spa_source
Definition: build-12683127/doc/spa/support/loop.h:58
pw_loop_destroy_source
#define pw_loop_destroy_source(l,...)
Definition: src/pipewire/loop.h:80
item
Definition: impl-metadata.c:49
queue
Definition: filter.c:68
pw_loop_add_event
#define pw_loop_add_event(l,...)
Definition: src/pipewire/loop.h:75
spa_list_remove
void spa_list_remove(struct spa_list *elem)
Definition: list.h:69
type.h
spa_list_init
void spa_list_init(struct spa_list *list)
Definition: list.h:44
spa_list_for_each_safe
#define spa_list_for_each_safe(pos, tmp, head, member)
Definition: list.h:129
SPA_RESULT_IS_ASYNC
#define SPA_RESULT_IS_ASYNC(res)
Definition: result.h:46
pw_loop_signal_event
#define pw_loop_signal_event(l,...)
Definition: src/pipewire/loop.h:76
SPA_RESULT_ASYNC_SEQ
#define SPA_RESULT_ASYNC_SEQ(res)
Definition: result.h:48
result.h
pw_work_queue_add
uint32_t pw_work_queue_add(struct pw_work_queue *queue, void *obj, int res, pw_work_func_t func, void *data)
Add an item to the work queue.
Definition: work-queue.c:162
pw_log_debug
#define pw_log_debug(...)
Definition: src/pipewire/log.h:89
spa_list_first
#define spa_list_first(head, type, member)
Definition: list.h:75
SPA_ID_INVALID
#define SPA_ID_INVALID
Definition: defs.h:182
spa_list_is_empty
#define spa_list_is_empty(l)
Definition: list.h:49
pw_work_queue_new
struct pw_work_queue * pw_work_queue_new(struct pw_loop *loop)
Create a new PipeWire Work Queue Object.
Definition: work-queue.c:98
pw_work_queue_cancel
int pw_work_queue_cancel(struct pw_work_queue *queue, void *obj, uint32_t id)
Cancel a work item.
Definition: work-queue.c:216
pw_loop::loop
struct spa_loop * loop
wrapped loop
Definition: src/pipewire/loop.h:49
log.h
spa_list_append
#define spa_list_append(list, item)
Definition: list.h:81