File: vlc_pipewire.h

package info (click to toggle)
vlc-plugin-pipewire 3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 180 kB
  • sloc: ansic: 919; makefile: 49
file content (66 lines) | stat: -rw-r--r-- 2,679 bytes parent folder | download | duplicates (2)
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
/*****************************************************************************
 * vlc_pipewire.h: common PipeWire code
 *****************************************************************************
 * Copyright (C) 2022 Rémi Denis-Courmont
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <stdint.h>

struct vlc_pw_context;
struct vlc_logger;
struct spa_dict;
struct spa_hook;
struct pw_properties;
struct pw_registry_events;

void vlc_pw_log(struct vlc_pw_context *ctx, int prio,
                const char *file, unsigned int line, const char *func,
                const char *fmt, ...);
int vlc_pw_perror(struct vlc_pw_context *ctx, const char *file,
                  unsigned int line, const char *func, const char *desc);

#define vlc_pw_log(ctx, prio, ...) \
        vlc_pw_log(ctx, prio, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define vlc_pw_error(ctx, ...) \
        vlc_pw_log(ctx, VLC_MSG_ERR, __VA_ARGS__)
#define vlc_pw_warn(ctx, ...) \
        vlc_pw_log(ctx, VLC_MSG_WARN, __VA_ARGS__)
#define vlc_pw_debug(ctx, ...) \
        vlc_pw_log(ctx, VLC_MSG_DBG, __VA_ARGS__)
#define vlc_pw_perror(ctx, desc) \
        vlc_pw_perror(ctx, __FILE__, __LINE__, __func__, desc)

void vlc_pw_lock(struct vlc_pw_context *ctx);
void vlc_pw_unlock(struct vlc_pw_context *ctx);
void vlc_pw_signal(struct vlc_pw_context *ctx);
void vlc_pw_wait(struct vlc_pw_context *ctx);

struct pw_stream *vlc_pw_stream_new(struct vlc_pw_context *ctx,
                                    const char *name, struct pw_properties *);

void vlc_pw_roundtrip_unlocked(struct vlc_pw_context *ctx);

int vlc_pw_registry_listen(struct vlc_pw_context *ctx, struct spa_hook *hook,
                           const struct pw_registry_events *, void *);

void vlc_pw_disconnect(struct vlc_pw_context *ctx);
struct vlc_pw_context *vlc_pw_connect(vlc_object_t *obj, const char *name);