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 7with Files('*'): 8 BUG_COMPONENT = ('Core', 'Video/Audio') 9 10component_signaling = ('Core', 'WebRTC: Signaling') 11with Files('IdpSandbox.jsm'): 12 BUG_COMPONENT = component_signaling 13with Files('PeerConnection*'): 14 BUG_COMPONENT = component_signaling 15with Files('RTC*'): 16 BUG_COMPONENT = component_signaling 17 18component_av = ('Core', 'WebRTC: Audio/Video') 19with Files('GetUserMedia*'): 20 BUG_COMPONENT = component_av 21 22DIRS += [ 23 'eme', 24 'encoder', 25 'flac', 26 'gmp', 27 'gmp-plugin', 28 'gmp-plugin-openh264', 29 'imagecapture', 30 'ipc', 31 'mediasink', 32 'mediasource', 33 'ogg', 34 'platforms', 35 'systemservices', 36 'wave', 37 'webaudio', 38 'webm', 39 'webrtc', 40 'webspeech', 41 'webvtt', 42 'standalone', 43] 44 45if CONFIG['MOZ_DIRECTSHOW']: 46 DIRS += ['directshow'] 47 48if CONFIG['MOZ_ANDROID_OMX']: 49 DIRS += ['android'] 50 51if CONFIG['MOZ_FMP4']: 52 DIRS += ['fmp4'] 53 54if CONFIG['MOZ_WEBRTC']: 55 DIRS += ['bridge'] 56 57TEST_DIRS += [ 58 'gtest', 59] 60 61MOCHITEST_MANIFESTS += [ 62 'test/mochitest.ini', 63 'tests/mochitest/identity/mochitest.ini', 64] 65 66if CONFIG['MOZ_WEBRTC']: 67 MOCHITEST_MANIFESTS += ['tests/mochitest/mochitest.ini'] 68 WEBRTC_SIGNALLING_TEST_MANIFESTS += ['tests/mochitest/steeplechase.ini'] 69 WEBRTC_SIGNALLING_TEST_MANIFESTS += ['tests/mochitest/steeplechase_long/steeplechase_long.ini'] 70 71XPIDL_SOURCES += [ 72 'nsIDOMNavigatorUserMedia.idl', 73 'nsIMediaManager.idl', 74] 75 76XPIDL_MODULE = 'dom_media' 77 78EXPORTS += [ 79 'AbstractMediaDecoder.h', 80 'AccurateSeekTask.h', 81 'ADTSDecoder.h', 82 'ADTSDemuxer.h', 83 'AudioBufferUtils.h', 84 'AudioChannelFormat.h', 85 'AudioCompactor.h', 86 'AudioConverter.h', 87 'AudioMixer.h', 88 'AudioPacketizer.h', 89 'AudioSampleFormat.h', 90 'AudioSegment.h', 91 'AudioStream.h', 92 'Benchmark.h', 93 'BufferMediaResource.h', 94 'CubebUtils.h', 95 'DecoderDoctorDiagnostics.h', 96 'DecoderTraits.h', 97 'DOMMediaStream.h', 98 'EncodedBufferCache.h', 99 'FileBlockCache.h', 100 'FrameStatistics.h', 101 'Intervals.h', 102 'Latency.h', 103 'MediaCache.h', 104 'MediaContentType.h', 105 'MediaData.h', 106 'MediaDataDemuxer.h', 107 'MediaDecoder.h', 108 'MediaDecoderOwner.h', 109 'MediaDecoderReader.h', 110 'MediaDecoderReaderWrapper.h', 111 'MediaDecoderStateMachine.h', 112 'MediaEventSource.h', 113 'MediaFormatReader.h', 114 'MediaInfo.h', 115 'MediaMetadataManager.h', 116 'MediaPrefs.h', 117 'MediaQueue.h', 118 'MediaRecorder.h', 119 'MediaResource.h', 120 'MediaResourceCallback.h', 121 'MediaResult.h', 122 'MediaSegment.h', 123 'MediaShutdownManager.h', 124 'MediaStatistics.h', 125 'MediaStreamGraph.h', 126 'MediaStreamListener.h', 127 'MediaStreamVideoSink.h', 128 'MediaTimer.h', 129 'MediaTrack.h', 130 'MediaTrackList.h', 131 'MP3Decoder.h', 132 'MP3Demuxer.h', 133 'MP3FrameParser.h', 134 'NextFrameSeekTask.h', 135 'nsIDocumentActivity.h', 136 'PrincipalChangeObserver.h', 137 'QueueObject.h', 138 'SeekJob.h', 139 'SeekTarget.h', 140 'SeekTask.h', 141 'SelfRef.h', 142 'SharedBuffer.h', 143 'StreamTracks.h', 144 'ThreadPoolCOMListener.h', 145 'TimeUnits.h', 146 'TrackUnionStream.h', 147 'VideoFrameContainer.h', 148 'VideoLimits.h', 149 'VideoSegment.h', 150 'VideoUtils.h', 151 'VorbisUtils.h', 152 'XiphExtradata.h', 153] 154 155EXPORTS.mozilla += [ 156 'MediaManager.h', 157] 158 159EXPORTS.mozilla.media.webrtc += [ 160 'webrtc/WebrtcGlobal.h', 161] 162 163if not CONFIG['MOZ_WEBRTC']: 164 EXPORTS.mtransport += [ 165 '../../media/mtransport/runnable_utils.h', 166 ] 167 168IPDL_SOURCES += [ 169 'webrtc/PWebrtcGlobal.ipdl' 170] 171 172if CONFIG['MOZ_B2G']: 173 EXPORTS.mozilla += [ 174 'MediaPermissionGonk.h', 175 ] 176 177EXPORTS.mozilla.dom += [ 178 'AudioStreamTrack.h', 179 'AudioTrack.h', 180 'AudioTrackList.h', 181 'CanvasCaptureMediaStream.h', 182 'GetUserMediaRequest.h', 183 'MediaDeviceInfo.h', 184 'MediaDevices.h', 185 'MediaStreamError.h', 186 'MediaStreamTrack.h', 187 'TextTrack.h', 188 'TextTrackCue.h', 189 'TextTrackCueList.h', 190 'TextTrackList.h', 191 'TextTrackRegion.h', 192 'VideoPlaybackQuality.h', 193 'VideoStreamTrack.h', 194 'VideoTrack.h', 195 'VideoTrackList.h', 196] 197 198UNIFIED_SOURCES += [ 199 'AccurateSeekTask.cpp', 200 'ADTSDecoder.cpp', 201 'ADTSDemuxer.cpp', 202 'AudioCaptureStream.cpp', 203 'AudioChannelFormat.cpp', 204 'AudioCompactor.cpp', 205 'AudioConverter.cpp', 206 'AudioSegment.cpp', 207 'AudioStream.cpp', 208 'AudioStreamTrack.cpp', 209 'AudioTrack.cpp', 210 'AudioTrackList.cpp', 211 'Benchmark.cpp', 212 'CanvasCaptureMediaStream.cpp', 213 'CubebUtils.cpp', 214 'DecoderDoctorDiagnostics.cpp', 215 'DOMMediaStream.cpp', 216 'EncodedBufferCache.cpp', 217 'FileBlockCache.cpp', 218 'GetUserMediaRequest.cpp', 219 'GraphDriver.cpp', 220 'Latency.cpp', 221 'MediaCache.cpp', 222 'MediaContentType.cpp', 223 'MediaData.cpp', 224 'MediaDecoder.cpp', 225 'MediaDecoderReader.cpp', 226 'MediaDecoderReaderWrapper.cpp', 227 'MediaDecoderStateMachine.cpp', 228 'MediaDeviceInfo.cpp', 229 'MediaDevices.cpp', 230 'MediaFormatReader.cpp', 231 'MediaInfo.cpp', 232 'MediaManager.cpp', 233 'MediaPrefs.cpp', 234 'MediaRecorder.cpp', 235 'MediaResource.cpp', 236 'MediaShutdownManager.cpp', 237 'MediaStreamError.cpp', 238 'MediaStreamGraph.cpp', 239 'MediaStreamListener.cpp', 240 'MediaStreamTrack.cpp', 241 'MediaStreamVideoSink.cpp', 242 'MediaTimer.cpp', 243 'MediaTrack.cpp', 244 'MediaTrackList.cpp', 245 'MP3Decoder.cpp', 246 'MP3Demuxer.cpp', 247 'MP3FrameParser.cpp', 248 'NextFrameSeekTask.cpp', 249 'QueueObject.cpp', 250 'SeekJob.cpp', 251 'SeekTask.cpp', 252 'StreamTracks.cpp', 253 'TextTrack.cpp', 254 'TextTrackCue.cpp', 255 'TextTrackCueList.cpp', 256 'TextTrackList.cpp', 257 'TextTrackRegion.cpp', 258 'TrackUnionStream.cpp', 259 'VideoFrameContainer.cpp', 260 'VideoPlaybackQuality.cpp', 261 'VideoSegment.cpp', 262 'VideoStreamTrack.cpp', 263 'VideoTrack.cpp', 264 'VideoTrackList.cpp', 265 'VideoUtils.cpp', 266 'WebVTTListener.cpp', 267 'XiphExtradata.cpp', 268] 269 270if CONFIG['OS_TARGET'] == 'WINNT': 271 SOURCES += [ 'ThreadPoolCOMListener.cpp' ] 272 273if CONFIG['MOZ_B2G']: 274 SOURCES += [ 275 'MediaPermissionGonk.cpp', 276 ] 277 278# DecoderTraits.cpp needs to be built separately because of Mac OS X headers. 279SOURCES += [ 280 'DecoderTraits.cpp', 281] 282 283# Some codec-related code uses multi-character constants, which GCC and clang 284# warn about. Suppress turning this warning into an error. 285if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']: 286 SOURCES['DecoderTraits.cpp'].flags += ['-Wno-error=multichar'] 287 288EXTRA_COMPONENTS += [ 289 'PeerConnection.js', 290 'PeerConnection.manifest', 291] 292 293EXTRA_JS_MODULES.media += [ 294 'IdpSandbox.jsm', 295 'PeerConnectionIdp.jsm', 296 'RTCStatsReport.jsm', 297] 298 299LOCAL_INCLUDES += [ 300 '/caps', 301 '/dom/base', 302 '/layout/generic', 303 '/layout/xul', 304 '/netwerk/base', 305] 306 307if CONFIG['MOZ_DIRECTSHOW']: 308 LOCAL_INCLUDES += [ 309 '/media/webrtc/trunk/webrtc/modules/video_capture/windows', 310 ] 311 312if CONFIG['MOZ_WEBRTC']: 313 LOCAL_INCLUDES += [ 314 '/media/webrtc/signaling/src/common', 315 '/media/webrtc/trunk', 316 ] 317 318DEFINES['MOZILLA_INTERNAL_API'] = True 319 320if CONFIG['MOZ_SYSTEM_OGG']: 321 CXXFLAGS += CONFIG['MOZ_OGG_CFLAGS'] 322 323if CONFIG['MOZ_SYSTEM_THEORA']: 324 CXXFLAGS += CONFIG['MOZ_THEORA_CFLAGS'] 325 326if CONFIG['MOZ_SYSTEM_VORBIS']: 327 CXXFLAGS += CONFIG['MOZ_VORBIS_CFLAGS'] 328 329if CONFIG['MOZ_SYSTEM_TREMOR']: 330 CXXFLAGS += CONFIG['MOZ_TREMOR_CFLAGS'] 331 332if CONFIG['MOZ_SYSTEM_SOUNDTOUCH']: 333 CXXFLAGS += CONFIG['MOZ_SOUNDTOUCH_CFLAGS'] 334 335if CONFIG['OS_TARGET'] == 'WINNT': 336 DEFINES['WEBRTC_WIN'] = True 337else: 338 DEFINES['WEBRTC_POSIX'] = True 339 340if CONFIG['ANDROID_VERSION'] > '15': 341 DEFINES['MOZ_OMX_WEBM_DECODER'] = True 342 343if CONFIG['MOZ_GONK_MEDIACODEC']: 344 DEFINES['MOZ_GONK_MEDIACODEC'] = True 345 346include('/ipc/chromium/chromium-config.mozbuild') 347 348# Suppress some GCC warnings being treated as errors: 349# - about attributes on forward declarations for types that are already 350# defined, which complains about an important MOZ_EXPORT for android::AString 351if CONFIG['GNU_CC']: 352 CXXFLAGS += [ 353 '-Wno-error=attributes', 354 '-Wno-error=shadow', 355 ] 356 357if CONFIG['_MSC_VER']: 358 # This is intended as a temporary workaround to unblock compilation 359 # on VS2015 in warnings as errors mode. 360 CXXFLAGS += ['-wd4312'] 361 362FINAL_LIBRARY = 'xul' 363