Skip to content
Snippets Groups Projects
Commit ca8d100b authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

meson: temporarily add check to conditionally enable the fade functionality

and in case it's missing, also #define some things to make compilation work,
since this is only available in a pipewire branch right now
parent a861e476
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,19 @@ if ccpp.has_argument('-fvisibility=hidden')
add_project_arguments('-fvisibility=hidden', language: 'cpp')
endif
have_audiofade = cc.compiles('''
#include <spa/utils/names.h>
#ifndef SPA_NAME_CONTROL_AUDIO_FADE_SOURCE
#error "not using the audio fade branch"
#endif
int main(void){return 0;}
''',
name: 'audiofade',
dependencies: pipewire_dep)
if have_audiofade
add_project_arguments('-DHAVE_AUDIOFADE', language: 'c')
endif
subdir('lib')
subdir('docs')
subdir('modules')
......
......@@ -7,7 +7,6 @@
*/
#include <spa/utils/keys.h>
#include <spa/param/control/audio.h>
#include <pipewire/pipewire.h>
......@@ -16,6 +15,12 @@
#include "config-policy.h"
#include "parser-endpoint-link.h"
#if !defined(HAVE_AUDIOFADE)
# define SPA_CONTROL_AUDIO_FADE_TYPE_LOGARITHMIC 2
#else
# include <spa/param/control/audio.h>
#endif
struct link_info {
WpBaseEndpoint *ep;
guint32 stream_id;
......
......@@ -133,7 +133,12 @@ on_audio_convert_core_done (WpCore *core, GAsyncResult *res,
&self->format);
/* Only enable control port for input streams */
control = direction == PW_DIRECTION_INPUT;
control =
#if defined(HAVE_AUDIOFADE)
(direction == PW_DIRECTION_INPUT);
#else
FALSE;
#endif
/* Configure audioconvert to be both merger and splitter; this means it will
have an equal number of input and output ports and just passthrough the
......
......@@ -16,6 +16,14 @@
#include "stream.h"
#if !defined(HAVE_AUDIOFADE)
# define SPA_PROP_audioFadeDuration 0x30001
# define SPA_PROP_audioFadeStep 0x30002
# define SPA_PROP_audioFadeDirection 0x30003
# define SPA_PROP_audioFadeType 0x30004
# define SPA_NAME_CONTROL_AUDIO_FADE_SOURCE "control.audio.fade.source"
#endif
typedef struct _WpAudioStreamPrivate WpAudioStreamPrivate;
struct _WpAudioStreamPrivate
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment