PipeWire  0.3.20
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 
36 struct pw_work_queue;
37 
38 #include <pipewire/loop.h>
39 
40 typedef void (*pw_work_func_t) (void *obj, void *data, int res, uint32_t id);
41 
42 struct pw_work_queue *
43 pw_work_queue_new(struct pw_loop *loop);
44 
45 void
47 
48 uint32_t
50  void *obj, int res,
51  pw_work_func_t func, void *data);
52 
53 int
54 pw_work_queue_cancel(struct pw_work_queue *queue, void *obj, uint32_t id);
55 
56 int
57 pw_work_queue_complete(struct pw_work_queue *queue, void *obj, uint32_t seq, int res);
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
63 #endif /* PIPEWIRE_WORK_QUEUE_H */
PipeWire work queue object.
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:164
int pw_work_queue_cancel(struct pw_work_queue *queue, void *obj, uint32_t id)
Cancel a work item.
Definition: work-queue.c:218
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:249
void pw_work_queue_destroy(struct pw_work_queue *queue)
Destroy a work queue.
Definition: work-queue.c:134
struct pw_work_queue * pw_work_queue_new(struct pw_loop *loop)
Create a new pw_work_queue.
Definition: work-queue.c:99
static uint32_t int int res
Definition: core.h:326
static uint32_t int seq
Definition: core.h:325
static uint32_t id
Definition: core.h:325
Definition: filter.c:74
PipeWire loop object provides an implementation of the spa loop interfaces.
Definition: loop.h:41
Definition: filter.c:67
void(* pw_work_func_t)(void *obj, void *data, int res, uint32_t id)
Definition: work-queue.h:40