meson.build 5.08 KB
Newer Older
1
2
audio_src= [
  'audio.c',
3
  'audio-buffer.c',
4
5
6
7
8
9
10
  'audio-channel-mixer.c',
  'audio-channels.c',
  'audio-converter.c',
  'audio-format.c',
  'audio-info.c',
  'audio-quantize.c',
  'audio-resampler.c',
11
  'gstaudioaggregator.c',
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  'gstaudiobasesink.c',
  'gstaudiobasesrc.c',
  'gstaudiocdsrc.c',
  'gstaudioclock.c',
  'gstaudiodecoder.c',
  'gstaudioencoder.c',
  'gstaudiofilter.c',
  'gstaudioiec61937.c',
  'gstaudiometa.c',
  'gstaudioringbuffer.c',
  'gstaudiosink.c',
  'gstaudiosrc.c',
  'gstaudioutilsprivate.c',
  'streamvolume.c',
26
  'gstaudiostreamalign.c',
27
28
29
30
31
32
33
34
35
36
37
]

audio_mkenum_headers = [
  'audio.h',
  'audio-format.h',
  'audio-channels.h',
  'audio-channel-mixer.h',
  'audio-converter.h',
  'audio-info.h',
  'audio-quantize.h',
  'audio-resampler.h',
38
  'gstaudioaggregator.h',
39
  'gstaudioringbuffer.h',
40
41
42
  'gstaudiobasesrc.h',
  'gstaudiocdsrc.h',
  'gstaudiobasesink.h',
43
  'gstaudiostreamalign.h',
44
45
46
47
]

# FIXME: check headers
audio_headers = audio_mkenum_headers + [
48
  'audio-prelude.h',
49
  'audio-buffer.h',
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
  'gstaudiobasesink.h',
  'gstaudiobasesrc.h',
  'gstaudiocdsrc.h',
  'gstaudioclock.h',
  'gstaudiodecoder.h',
  'gstaudioencoder.h',
  'gstaudiofilter.h',
  'gstaudioiec61937.h',
  'gstaudiometa.h',
  'gstaudiosink.h',
  'gstaudiosrc.h',
  'streamvolume.h',
]
install_headers(audio_headers, subdir : 'gstreamer-1.0/gst/audio/')

65
66
audio_enums = gnome.mkenums_simple('audio-enumtypes',
  sources : audio_mkenum_headers,
67
  body_prefix : '#ifdef HAVE_CONFIG_H\n#include "config.h"\n#endif',
68
69
70
  header_prefix : '#include <gst/audio/audio-prelude.h>',
  decorator : 'GST_AUDIO_API',
  install_header: true,
71
  install_dir : join_paths(get_option('includedir'), 'gstreamer-1.0/gst/audio'))
72
73
gstaudio_c = audio_enums[0]
gstaudio_h = audio_enums[1]
74

Thibault Saunier's avatar
Thibault Saunier committed
75
audio_gen_sources = [gstaudio_h]
76

77
gstaudio_deps = [tag_dep, gst_base_dep, libm]
78
79
orcsrc = 'gstaudiopack'
if have_orcc
80
  gstaudio_deps += [orc_dep]
81
82
83
84
85
86
87
88
  orc_h = custom_target(orcsrc + '.h',
    input : orcsrc + '.orc',
    output : orcsrc + '.h',
    command : orcc_args + ['--header', '-o', '@OUTPUT@', '@INPUT@'])
  orc_c = custom_target(orcsrc + '.c',
    input : orcsrc + '.orc',
    output : orcsrc + '.c',
    command : orcc_args + ['--implementation', '-o', '@OUTPUT@', '@INPUT@'])
89
  orc_targets += {'name': orcsrc, 'orc-source': files(orcsrc + '.orc'), 'header': orc_h, 'source': orc_c}
90
91
92
else
  orc_h = configure_file(input : orcsrc + '-dist.h',
    output : orcsrc + '.h',
93
    copy : true)
94
95
  orc_c = configure_file(input : orcsrc + '-dist.c',
    output : orcsrc + '.c',
96
    copy : true)
97
98
endif

99
simd_cargs = []
100
simd_objects = []
101
102
103

if have_sse
  audio_resampler_sse = static_library('audio_resampler_sse',
104
    ['audio-resampler-x86-sse.c', gstaudio_h],
105
    c_args : gst_plugins_base_args + [sse_args],
106
107
    include_directories : [configinc, libsinc],
    dependencies : [gst_base_dep],
108
    pic : true,
109
    install : false
110
111
  )
  simd_cargs += ['-DHAVE_SSE']
112
  simd_objects += audio_resampler_sse.extract_all_objects()
113
114
115
116
endif

if have_sse2
  audio_resampler_sse2 = static_library('audio_resampler_sse2',
117
    ['audio-resampler-x86-sse2.c', gstaudio_h],
118
    c_args : gst_plugins_base_args + [sse2_args],
119
120
    include_directories : [configinc, libsinc],
    dependencies : [gst_base_dep],
121
    pic : true,
122
    install : false
123
124
125
  )

  simd_cargs += ['-DHAVE_SSE2']
126
  simd_objects += audio_resampler_sse2.extract_all_objects()
127
128
129
130
endif

if have_sse41
  audio_resampler_sse41 = static_library('audio_resampler_sse41',
131
    ['audio-resampler-x86-sse41.c', gstaudio_h],
132
    c_args : gst_plugins_base_args + [sse41_args],
133
134
    include_directories : [configinc, libsinc],
    dependencies : [gst_base_dep],
135
    pic : true,
136
    install : false
137
138
139
  )

  simd_cargs += ['-DHAVE_SSE41']
140
  simd_objects += audio_resampler_sse41.extract_all_objects()
141
142
endif

143
144
gstaudio = library('gstaudio-@0@'.format(api_version),
  audio_src, gstaudio_h, gstaudio_c, orc_c, orc_h,
145
  c_args : gst_plugins_base_args + simd_cargs + ['-DBUILDING_GST_AUDIO'],
146
  include_directories: [configinc, libsinc],
147
  objects : simd_objects,
148
149
  version : libversion,
  soversion : soversion,
150
  darwin_versions : osxversion,
151
  install : true,
Thibault Saunier's avatar
Thibault Saunier committed
152
  dependencies : gstaudio_deps,
153
)
Thibault Saunier's avatar
Thibault Saunier committed
154

155
156
157
158
159
160
161
162
pkgconfig.generate(gstaudio,
  libraries : [gst_dep, gst_base_dep],
  variables : pkgconfig_variables,
  subdirs : pkgconfig_subdirs,
  name : 'gstreamer-audio-1.0',
  description : 'Audio helper functions and base classes',
)

Thibault Saunier's avatar
Thibault Saunier committed
163
if build_gir
164
  gst_gir_extra_args = gir_init_section + [ '--c-include=gst/audio/audio.h' ]
165
  audio_gir = gnome.generate_gir(gstaudio,
Thibault Saunier's avatar
Thibault Saunier committed
166
167
168
169
170
171
    sources : audio_src + audio_headers + [gstaudio_c] + [gstaudio_h],
    namespace : 'GstAudio',
    nsversion : api_version,
    identifier_prefix : 'Gst',
    symbol_prefix : 'gst',
    export_packages : 'gstreamer-audio-1.0',
172
    includes : ['Gst-1.0', 'GstBase-1.0', 'GLib-2.0', 'GObject-2.0', 'GModule-2.0' ],
Thibault Saunier's avatar
Thibault Saunier committed
173
    install : true,
174
    extra_args : gst_gir_extra_args,
Thibault Saunier's avatar
Thibault Saunier committed
175
    dependencies : gstaudio_deps
176
177
  )
  audio_gen_sources += [audio_gir]
Thibault Saunier's avatar
Thibault Saunier committed
178
endif
179
180
181

audio_dep = declare_dependency(link_with : gstaudio,
  include_directories : [libsinc],
Thibault Saunier's avatar
Thibault Saunier committed
182
183
  dependencies : gstaudio_deps,
  sources : audio_gen_sources)
184
185

meson.override_dependency('gstreamer-audio-1.0', audio_dep)