Backed out changeset 56443a56b418 (bug 1853840) for causing build bustages related...
[gecko.git] / dom / media / moz.build
blob7e24dc607b86491dcb8187be61b3e944d192e712
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 include("/dom/media/webrtc/third_party_build/webrtc.mozbuild")
8 with Files("*"):
9     BUG_COMPONENT = ("Core", "Audio/Video")
11 with Files("test/**"):
12     BUG_COMPONENT = ("Core", "Audio/Video: Playback")
14 with Files("gtest/TestGMP*"):
15     BUG_COMPONENT = ("Core", "Audio/Video: GMP")
17 with Files("tests/**"):
18     BUG_COMPONENT = ("Core", "WebRTC")
20 component_signaling = ("Core", "WebRTC: Signaling")
21 with Files("IdpSandbox.sys.mjs"):
22     BUG_COMPONENT = component_signaling
23 with Files("PeerConnection*"):
24     BUG_COMPONENT = component_signaling
26 component_av = ("Core", "WebRTC: Audio/Video")
27 with Files("GetUserMedia*"):
28     BUG_COMPONENT = component_av
30 DIRS += [
31     "autoplay",
32     "doctor",
33     "eme",
34     "encoder",
35     "fake-cdm",
36     "flac",
37     "gmp",
38     "gmp-plugin-openh264",
39     "imagecapture",
40     "ipc",
41     "mediacapabilities",
42     "mediacontrol",
43     "mediasink",
44     "mediasource",
45     "mediasession",
46     "mp3",
47     "mp4",
48     "ogg",
49     "platforms",
50     "systemservices",
51     "utils",
52     "wave",
53     "webaudio",
54     "webcodecs",
55     "webm",
56     "webrtc",
57     "webspeech",
58     "webvtt",
61 if CONFIG["MOZ_ANDROID_HLS_SUPPORT"]:
62     DIRS += ["hls"]
64 if CONFIG["MOZ_WEBRTC"]:
65     DIRS += ["bridge"]
67 TEST_DIRS += [
68     "gtest",
71 # Add libFuzzer configuration directives
72 include("/tools/fuzzing/libfuzzer-config.mozbuild")
74 if CONFIG["FUZZING_INTERFACES"]:
75     TEST_DIRS += ["fuzz"]
77 if CONFIG["MOZ_WEBRTC_SIGNALING"]:
78     if CONFIG["FUZZING_INTERFACES"]:
79         TEST_DIRS += ["webrtc/tests/fuzztests"]
81 MOCHITEST_MANIFESTS += [
82     "test/mochitest.ini",
83     "test/mochitest_background_video.ini",
84     "test/mochitest_bugs.ini",
85     "test/mochitest_compat.ini",
86     "test/mochitest_eme.ini",
87     "test/mochitest_media_engine.ini",
88     "test/mochitest_media_recorder.ini",
89     "test/mochitest_seek.ini",
90     "test/mochitest_stream.ini",
91     "webrtc/tests/mochitests/identity/mochitest.ini",
94 MOCHITEST_CHROME_MANIFESTS += ["test/chrome/chrome.toml"]
96 BROWSER_CHROME_MANIFESTS += [
97     "mediacontrol/tests/browser/browser.toml",
98     "mediasession/test/browser.toml",
99     "test/browser/browser.toml",
100     "test/browser/wmfme/browser.toml",
103 if CONFIG["MOZ_WEBRTC"]:
104     MOCHITEST_MANIFESTS += [
105         "webrtc/tests/mochitests/mochitest.ini",
106         "webrtc/tests/mochitests/mochitest_datachannel.ini",
107         "webrtc/tests/mochitests/mochitest_getusermedia.ini",
108         "webrtc/tests/mochitests/mochitest_peerconnection.ini",
109     ]
111     CRASHTEST_MANIFESTS += ["webrtc/tests/crashtests/crashtests.list"]
113 XPIDL_SOURCES += [
114     "nsIAudioDeviceInfo.idl",
115     "nsIMediaDevice.idl",
116     "nsIMediaManager.idl",
119 XPIDL_MODULE = "dom_media"
121 EXPORTS += [
122     "../../third_party/rust/audio_thread_priority/audio_thread_priority.h",
123     "ADTSDecoder.h",
124     "ADTSDemuxer.h",
125     "AsyncLogger.h",
126     "AudibilityMonitor.h",
127     "AudioBufferUtils.h",
128     "AudioChannelFormat.h",
129     "AudioCompactor.h",
130     "AudioConfig.h",
131     "AudioConverter.h",
132     "AudioDeviceInfo.h",
133     "AudioDriftCorrection.h",
134     "AudioMixer.h",
135     "AudioPacketizer.h",
136     "AudioRingBuffer.h",
137     "AudioSampleFormat.h",
138     "AudioSegment.h",
139     "AudioStream.h",
140     "BackgroundVideoDecodingPermissionObserver.h",
141     "Benchmark.h",
142     "BitReader.h",
143     "BitWriter.h",
144     "BufferMediaResource.h",
145     "BufferReader.h",
146     "ByteWriter.h",
147     "CallbackThreadRegistry.h",
148     "ChannelMediaDecoder.h",
149     "CrossGraphPort.h",
150     "CubebUtils.h",
151     "DecoderTraits.h",
152     "DOMMediaStream.h",
153     "DriftCompensation.h",
154     "DynamicResampler.h",
155     "ExternalEngineStateMachine.h",
156     "FileBlockCache.h",
157     "ForwardedInputTrack.h",
158     "FrameStatistics.h",
159     "ImageToI420.h",
160     "Intervals.h",
161     "MediaCache.h",
162     "MediaContainerType.h",
163     "MediaData.h",
164     "MediaDataDemuxer.h",
165     "MediaDecoder.h",
166     "MediaDecoderOwner.h",
167     "MediaDecoderStateMachine.h",
168     "MediaDecoderStateMachineBase.h",
169     "MediaEventSource.h",
170     "MediaFormatReader.h",
171     "MediaInfo.h",
172     "MediaMetadataManager.h",
173     "MediaMIMETypes.h",
174     "MediaPlaybackDelayPolicy.h",
175     "MediaPromiseDefs.h",
176     "MediaQueue.h",
177     "MediaRecorder.h",
178     "MediaResource.h",
179     "MediaResourceCallback.h",
180     "MediaResult.h",
181     "MediaSegment.h",
182     "MediaShutdownManager.h",
183     "MediaSpan.h",
184     "MediaStatistics.h",
185     "MediaStreamWindowCapturer.h",
186     "MediaTimer.h",
187     "MediaTrack.h",
188     "MediaTrackGraph.h",
189     "MediaTrackList.h",
190     "MediaTrackListener.h",
191     "MemoryBlockCache.h",
192     "MPSCQueue.h",
193     "nsIDocumentActivity.h",
194     "PrincipalChangeObserver.h",
195     "PrincipalHandle.h",
196     "QueueObject.h",
197     "ReaderProxy.h",
198     "RLBoxSoundTouch.h",
199     "RLBoxSoundTouchTypes.h",
200     "SeekJob.h",
201     "SeekTarget.h",
202     "SelfRef.h",
203     "SharedBuffer.h",
204     "TimeUnits.h",
205     "Tracing.h",
206     "VideoFrameContainer.h",
207     "VideoLimits.h",
208     "VideoSegment.h",
209     "VideoUtils.h",
210     "WavDumper.h",
211     "XiphExtradata.h",
214 EXPORTS.mozilla += [
215     "MediaManager.h",
216     "UnderrunHandler.h",
219 EXPORTS.mozilla.media.webrtc += [
220     "webrtc/WebrtcGlobal.h",
221     "webrtc/WebrtcIPCTraits.h",
224 if not CONFIG["MOZ_WEBRTC"]:
225     EXPORTS.transport += [
226         "webrtc/transport/runnable_utils.h",
227     ]
229 EXPORTS.mozilla.dom += [
230     "AudioDeviceInfo.h",
231     "AudioStreamTrack.h",
232     "AudioTrack.h",
233     "AudioTrackList.h",
234     "CanvasCaptureMediaStream.h",
235     "GetUserMediaRequest.h",
236     "MediaDeviceInfo.h",
237     "MediaDevices.h",
238     "MediaStreamError.h",
239     "MediaStreamTrack.h",
240     "VideoPlaybackQuality.h",
241     "VideoStreamTrack.h",
242     "VideoTrack.h",
243     "VideoTrackList.h",
244     "webrtc/MediaTransportChild.h",
245     "webrtc/MediaTransportParent.h",
248 UNIFIED_SOURCES += [
249     "ADTSDecoder.cpp",
250     "ADTSDemuxer.cpp",
251     "AudioCaptureTrack.cpp",
252     "AudioChannelFormat.cpp",
253     "AudioCompactor.cpp",
254     "AudioConfig.cpp",
255     "AudioConverter.cpp",
256     "AudioDeviceInfo.cpp",
257     "AudioInputSource.cpp",
258     "AudioRingBuffer.cpp",
259     "AudioSegment.cpp",
260     "AudioStream.cpp",
261     "AudioStreamTrack.cpp",
262     "AudioTrack.cpp",
263     "AudioTrackList.cpp",
264     "BackgroundVideoDecodingPermissionObserver.cpp",
265     "BaseMediaResource.cpp",
266     "Benchmark.cpp",
267     "BitReader.cpp",
268     "BitWriter.cpp",
269     "CallbackThreadRegistry.cpp",
270     "CanvasCaptureMediaStream.cpp",
271     "ChannelMediaDecoder.cpp",
272     "ChannelMediaResource.cpp",
273     "CloneableWithRangeMediaResource.cpp",
274     "CrossGraphPort.cpp",
275     "CubebInputStream.cpp",
276     "DeviceInputTrack.cpp",
277     "DOMMediaStream.cpp",
278     "DynamicResampler.cpp",
279     "ExternalEngineStateMachine.cpp",
280     "FileBlockCache.cpp",
281     "FileMediaResource.cpp",
282     "ForwardedInputTrack.cpp",
283     "GetUserMediaRequest.cpp",
284     "GraphDriver.cpp",
285     "GraphRunner.cpp",
286     "ImageToI420.cpp",
287     "MediaCache.cpp",
288     "MediaContainerType.cpp",
289     "MediaDecoder.cpp",
290     "MediaDecoderStateMachine.cpp",
291     "MediaDecoderStateMachineBase.cpp",
292     "MediaDeviceInfo.cpp",
293     "MediaDevices.cpp",
294     "MediaFormatReader.cpp",
295     "MediaInfo.cpp",
296     "MediaManager.cpp",
297     "MediaMIMETypes.cpp",
298     "MediaPlaybackDelayPolicy.cpp",
299     "MediaRecorder.cpp",
300     "MediaResource.cpp",
301     "MediaShutdownManager.cpp",
302     "MediaStreamError.cpp",
303     "MediaStreamTrack.cpp",
304     "MediaStreamWindowCapturer.cpp",
305     "MediaTimer.cpp",
306     "MediaTrack.cpp",
307     "MediaTrackGraph.cpp",
308     "MediaTrackList.cpp",
309     "MediaTrackListener.cpp",
310     "MemoryBlockCache.cpp",
311     "QueueObject.cpp",
312     "ReaderProxy.cpp",
313     "RLBoxSoundTouch.cpp",
314     "SeekJob.cpp",
315     "TimeUnits.cpp",
316     "Tracing.cpp",
317     "VideoFrameContainer.cpp",
318     "VideoPlaybackQuality.cpp",
319     "VideoSegment.cpp",
320     "VideoStreamTrack.cpp",
321     "VideoTrack.cpp",
322     "VideoTrackList.cpp",
323     "VideoUtils.cpp",
324     "XiphExtradata.cpp",
327 if CONFIG["OS_TARGET"] == "Linux":
328     UNIFIED_SOURCES += ["UnderrunHandlerLinux.cpp"]
329 else:
330     UNIFIED_SOURCES += ["UnderrunHandlerNoop.cpp"]
332 # CubebUtils.cpp needs to be built separately due to what appears to be some kind
333 # of compiler bug on Android 4.2 x86 opt. See bug 1408459.
334 # DecoderTraits.cpp needs to be built separately because of Mac OS X headers.
335 # MediaData.cpp : ambiguous compilation error caused by Mac OS X headers.
336 SOURCES += [
337     "CubebUtils.cpp",
338     "DecoderTraits.cpp",
339     "MediaData.cpp",
342 # Some codec-related code uses multi-character constants, which GCC and clang
343 # warn about. Suppress turning this warning into an error.
344 SOURCES["DecoderTraits.cpp"].flags += ["-Wno-error=multichar"]
346 if CONFIG["MOZ_WEBRTC"]:
347     XPCOM_MANIFESTS += [
348         "components.conf",
349     ]
351     EXTRA_JS_MODULES.media += [
352         "PeerConnection.sys.mjs",
353     ]
355 EXTRA_JS_MODULES.media += [
356     "IdpSandbox.sys.mjs",
357     "PeerConnectionIdp.sys.mjs",
360 LOCAL_INCLUDES += [
361     "!/security/rlbox",
362     "/caps",
363     "/docshell/base",
364     "/dom/base",
365     "/dom/media/webrtc",
366     "/layout/generic",
367     "/layout/xul",
368     "/media/libyuv/libyuv/include",
369     "/netwerk/base",
370     "/toolkit/content/tests/browser/",
373 if CONFIG["MOZ_WEBRTC"]:
374     LOCAL_INCLUDES += [
375         "/dom/media/webrtc/common",
376         "/third_party/libwebrtc",
377         "/third_party/libwebrtc/third_party/abseil-cpp",
378     ]
380 DEFINES["MOZILLA_INTERNAL_API"] = True
382 if CONFIG["MOZ_ANDROID_HLS_SUPPORT"]:
383     DEFINES["MOZ_ANDROID_HLS_SUPPORT"] = True
385 if CONFIG["COMPILE_ENVIRONMENT"]:
386     EXPORTS += [
387         "!audioipc2_client_ffi_generated.h",
388         "!audioipc2_server_ffi_generated.h",
389     ]
391     CbindgenHeader(
392         "audioipc2_client_ffi_generated.h",
393         inputs=["/third_party/rust/audioipc2-client"],
394     )
396     CbindgenHeader(
397         "audioipc2_server_ffi_generated.h",
398         inputs=["/third_party/rust/audioipc2-server"],
399     )
401 if CONFIG["ENABLE_TESTS"]:
402     DIRS += [
403         "test/rdd_process_xpcom",
404     ]
406 include("/ipc/chromium/chromium-config.mozbuild")
408 # Suppress some GCC warnings being treated as errors:
409 #  - about attributes on forward declarations for types that are already
410 #    defined, which complains about an important MOZ_EXPORT for android::AString
411 if CONFIG["CC_TYPE"] in ("clang", "gcc"):
412     CXXFLAGS += [
413         "-Wno-error=attributes",
414     ]
416 CXXFLAGS += ["-Werror=switch"]
418 FINAL_LIBRARY = "xul"