diff options
author | Mikhail Burakov <mburakov@mailbox.org> | 2024-05-12 17:10:01 +0200 |
---|---|---|
committer | Mikhail Burakov <mburakov@mailbox.org> | 2024-05-12 17:10:01 +0200 |
commit | 35702d95a8ae34279c0a21035a3b7f9a7286dcfa (patch) | |
tree | b57d737bddcaccb54055b1f7657b327f38ed2192 | |
parent | 3a0242c399e274323d8a68cc45a063b1b2c3bbcd (diff) |
Make pipewire and audio capturing optional
-rw-r--r-- | audio.c | 4 | ||||
-rw-r--r-- | audio.h | 7 | ||||
-rw-r--r-- | makefile | 6 |
3 files changed, 16 insertions, 1 deletions
@@ -15,6 +15,8 @@ * along with streamer. If not, see <https://www.gnu.org/licenses/>. */ +#ifdef USE_PIPEWIRE + #include "audio.h" #include <errno.h> @@ -277,3 +279,5 @@ void AudioContextDestroy(struct AudioContext* audio_context) { free(audio_context); pw_deinit(); } + +#endif // USE_PIPEWIRE @@ -27,10 +27,17 @@ struct AudioContextCallbacks { void (*OnAudioReady)(void* user, const void* buffer, size_t size); }; +#ifdef USE_PIPEWIRE struct AudioContext* AudioContextCreate( const struct AudioContextCallbacks* callbacks, void* user); int AudioContextGetEventsFd(struct AudioContext* audio_context); bool AudioContextProcessEvents(struct AudioContext* audio_context); void AudioContextDestroy(struct AudioContext* audio_context); +#else // USE_PIPEWIRE +#define AudioContextCreate(...) ((void*)~0) +#define AudioContextGetEventsFd(...) -1 +#define AudioContextProcessEvents(...) false +#define AudioContextDestroy(...) +#endif #endif // STREAMER_AUDIO_H_ @@ -12,7 +12,6 @@ libs:=\ gbm \ glesv2 \ libdrm \ - libpipewire-0.3 \ libva \ libva-drm @@ -34,6 +33,11 @@ ifdef USE_WAYLAND CFLAGS+=-DUSE_WAYLAND endif +ifdef USE_PIPEWIRE + libs+=libpipewire-0.3 + CFLAGS+=-DUSE_PIPEWIRE +endif + #CFLAGS+=-DUSE_EGL_MESA_PLATFORM_SURFACELESS CFLAGS+=$(shell pkg-config --cflags $(libs)) LDFLAGS+=$(shell pkg-config --libs $(libs)) |