Bug 1852754: part 9) Add tests for dynamically loading <link rel="prefetch"> elements...
[gecko.git] / dom / media / moz.build
blobafa2f94bdccda94bf1e2aa262d81d5eac6a9eac0
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     "SeekJob.h",
199     "SeekTarget.h",
200     "SelfRef.h",
201     "SharedBuffer.h",
202     "TimeUnits.h",
203     "Tracing.h",
204     "VideoFrameContainer.h",
205     "VideoLimits.h",
206     "VideoSegment.h",
207     "VideoUtils.h",
208     "WavDumper.h",
209     "XiphExtradata.h",
212 EXPORTS.mozilla += [
213     "MediaManager.h",
214     "UnderrunHandler.h",
217 EXPORTS.mozilla.media.webrtc += [
218     "webrtc/WebrtcGlobal.h",
219     "webrtc/WebrtcIPCTraits.h",
222 if not CONFIG["MOZ_WEBRTC"]:
223     EXPORTS.transport += [
224         "webrtc/transport/runnable_utils.h",
225     ]
227 EXPORTS.mozilla.dom += [
228     "AudioDeviceInfo.h",
229     "AudioStreamTrack.h",
230     "AudioTrack.h",
231     "AudioTrackList.h",
232     "CanvasCaptureMediaStream.h",
233     "GetUserMediaRequest.h",
234     "MediaDeviceInfo.h",
235     "MediaDevices.h",
236     "MediaStreamError.h",
237     "MediaStreamTrack.h",
238     "VideoPlaybackQuality.h",
239     "VideoStreamTrack.h",
240     "VideoTrack.h",
241     "VideoTrackList.h",
242     "webrtc/MediaTransportChild.h",
243     "webrtc/MediaTransportParent.h",
246 UNIFIED_SOURCES += [
247     "ADTSDecoder.cpp",
248     "ADTSDemuxer.cpp",
249     "AudioCaptureTrack.cpp",
250     "AudioChannelFormat.cpp",
251     "AudioCompactor.cpp",
252     "AudioConfig.cpp",
253     "AudioConverter.cpp",
254     "AudioDeviceInfo.cpp",
255     "AudioInputSource.cpp",
256     "AudioRingBuffer.cpp",
257     "AudioSegment.cpp",
258     "AudioStream.cpp",
259     "AudioStreamTrack.cpp",
260     "AudioTrack.cpp",
261     "AudioTrackList.cpp",
262     "BackgroundVideoDecodingPermissionObserver.cpp",
263     "BaseMediaResource.cpp",
264     "Benchmark.cpp",
265     "BitReader.cpp",
266     "BitWriter.cpp",
267     "CallbackThreadRegistry.cpp",
268     "CanvasCaptureMediaStream.cpp",
269     "ChannelMediaDecoder.cpp",
270     "ChannelMediaResource.cpp",
271     "CloneableWithRangeMediaResource.cpp",
272     "CrossGraphPort.cpp",
273     "CubebInputStream.cpp",
274     "DeviceInputTrack.cpp",
275     "DOMMediaStream.cpp",
276     "DynamicResampler.cpp",
277     "ExternalEngineStateMachine.cpp",
278     "FileBlockCache.cpp",
279     "FileMediaResource.cpp",
280     "ForwardedInputTrack.cpp",
281     "GetUserMediaRequest.cpp",
282     "GraphDriver.cpp",
283     "GraphRunner.cpp",
284     "ImageToI420.cpp",
285     "MediaCache.cpp",
286     "MediaContainerType.cpp",
287     "MediaDecoder.cpp",
288     "MediaDecoderStateMachine.cpp",
289     "MediaDecoderStateMachineBase.cpp",
290     "MediaDeviceInfo.cpp",
291     "MediaDevices.cpp",
292     "MediaFormatReader.cpp",
293     "MediaInfo.cpp",
294     "MediaManager.cpp",
295     "MediaMIMETypes.cpp",
296     "MediaPlaybackDelayPolicy.cpp",
297     "MediaRecorder.cpp",
298     "MediaResource.cpp",
299     "MediaShutdownManager.cpp",
300     "MediaStreamError.cpp",
301     "MediaStreamTrack.cpp",
302     "MediaStreamWindowCapturer.cpp",
303     "MediaTimer.cpp",
304     "MediaTrack.cpp",
305     "MediaTrackGraph.cpp",
306     "MediaTrackList.cpp",
307     "MediaTrackListener.cpp",
308     "MemoryBlockCache.cpp",
309     "QueueObject.cpp",
310     "ReaderProxy.cpp",
311     "SeekJob.cpp",
312     "TimeUnits.cpp",
313     "Tracing.cpp",
314     "VideoFrameContainer.cpp",
315     "VideoPlaybackQuality.cpp",
316     "VideoSegment.cpp",
317     "VideoStreamTrack.cpp",
318     "VideoTrack.cpp",
319     "VideoTrackList.cpp",
320     "VideoUtils.cpp",
321     "XiphExtradata.cpp",
324 if CONFIG["OS_TARGET"] == "Linux":
325     UNIFIED_SOURCES += ["UnderrunHandlerLinux.cpp"]
326 else:
327     UNIFIED_SOURCES += ["UnderrunHandlerNoop.cpp"]
329 # CubebUtils.cpp needs to be built separately due to what appears to be some kind
330 # of compiler bug on Android 4.2 x86 opt. See bug 1408459.
331 # DecoderTraits.cpp needs to be built separately because of Mac OS X headers.
332 # MediaData.cpp : ambiguous compilation error caused by Mac OS X headers.
333 SOURCES += [
334     "CubebUtils.cpp",
335     "DecoderTraits.cpp",
336     "MediaData.cpp",
339 # Some codec-related code uses multi-character constants, which GCC and clang
340 # warn about. Suppress turning this warning into an error.
341 SOURCES["DecoderTraits.cpp"].flags += ["-Wno-error=multichar"]
343 if CONFIG["MOZ_WEBRTC"]:
344     XPCOM_MANIFESTS += [
345         "components.conf",
346     ]
348     EXTRA_JS_MODULES.media += [
349         "PeerConnection.sys.mjs",
350     ]
352 EXTRA_JS_MODULES.media += [
353     "IdpSandbox.sys.mjs",
354     "PeerConnectionIdp.sys.mjs",
357 LOCAL_INCLUDES += [
358     "!/media/libsoundtouch/src",
359     "/caps",
360     "/docshell/base",
361     "/dom/base",
362     "/dom/media/webrtc",
363     "/layout/generic",
364     "/layout/xul",
365     "/media/libyuv/libyuv/include",
366     "/netwerk/base",
367     "/toolkit/content/tests/browser/",
370 if CONFIG["MOZ_WEBRTC"]:
371     LOCAL_INCLUDES += [
372         "/dom/media/webrtc/common",
373         "/third_party/libwebrtc",
374         "/third_party/libwebrtc/third_party/abseil-cpp",
375     ]
377 DEFINES["MOZILLA_INTERNAL_API"] = True
379 if CONFIG["MOZ_ANDROID_HLS_SUPPORT"]:
380     DEFINES["MOZ_ANDROID_HLS_SUPPORT"] = True
382 if CONFIG["COMPILE_ENVIRONMENT"]:
383     EXPORTS += [
384         "!audioipc2_client_ffi_generated.h",
385         "!audioipc2_server_ffi_generated.h",
386     ]
388     CbindgenHeader(
389         "audioipc2_client_ffi_generated.h",
390         inputs=["/third_party/rust/audioipc2-client"],
391     )
393     CbindgenHeader(
394         "audioipc2_server_ffi_generated.h",
395         inputs=["/third_party/rust/audioipc2-server"],
396     )
398 if CONFIG["ENABLE_TESTS"]:
399     DIRS += [
400         "test/rdd_process_xpcom",
401     ]
403 include("/ipc/chromium/chromium-config.mozbuild")
405 # Suppress some GCC warnings being treated as errors:
406 #  - about attributes on forward declarations for types that are already
407 #    defined, which complains about an important MOZ_EXPORT for android::AString
408 if CONFIG["CC_TYPE"] in ("clang", "gcc"):
409     CXXFLAGS += [
410         "-Wno-error=attributes",
411     ]
413 CXXFLAGS += ["-Werror=switch"]
415 FINAL_LIBRARY = "xul"