Issue #80 - De-unify dom/media part 1

This de-unifies up to and including dom/media/platforms with the exception of
dom/media/platforms/wmf, because that one throws weird errors in the Win
SDK which don't have a clear cause (yet)
This commit is contained in:
Moonchild 2020-04-22 02:32:20 +00:00 committed by Roy Tam
commit 094d4730dd
40 changed files with 79 additions and 50 deletions

View file

@ -11,6 +11,7 @@
#include "PDMFactory.h"
#include "WebMDemuxer.h"
#include "mozilla/Preferences.h"
#include "mozilla/SharedThreadPool.h"
#include "mozilla/dom/ContentChild.h"
#ifndef MOZ_WIDGET_ANDROID

View file

@ -8,6 +8,7 @@
#include "gfxPlatform.h"
#include "ImageContainer.h"
#include "MediaStreamGraph.h"
#include "MediaStreamListener.h"
#include "mozilla/dom/CanvasCaptureMediaStreamBinding.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/Atomics.h"

View file

@ -10,6 +10,8 @@
#include "nsDebug.h"
#include "nsString.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "mozilla/Sprintf.h"
#include "mozilla/StaticMutex.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/Telemetry.h"

View file

@ -14,6 +14,7 @@
#include "mozilla/dom/MediaStreamTrackEvent.h"
#include "mozilla/dom/LocalMediaStreamBinding.h"
#include "mozilla/dom/AudioNode.h"
#include "AudioCaptureStream.h"
#include "AudioChannelAgent.h"
#include "mozilla/dom/AudioTrack.h"
#include "mozilla/dom/AudioTrackList.h"
@ -22,6 +23,7 @@
#include "mozilla/dom/HTMLCanvasElement.h"
#include "mozilla/media/MediaUtils.h"
#include "MediaStreamGraph.h"
#include "MediaStreamListener.h"
#include "AudioStreamTrack.h"
#include "VideoStreamTrack.h"
#include "Layers.h"

View file

@ -788,6 +788,13 @@ MediaDecoder::CallSeek(const SeekTarget& aTarget, dom::Promise* aPromise)
&MediaDecoder::OnSeekResolved, &MediaDecoder::OnSeekRejected));
}
// GetCurrentTime is defined in winbase.h as a zero argument macro forwarding to
// GetTickCount(), which conflicts with the MediaDecoder::GetCurrentTime
// implementation here. Clear the macro.
#ifdef GetCurrentTime
#undef GetCurrentTime
#endif
double
MediaDecoder::GetCurrentTime()
{

View file

@ -14,6 +14,7 @@
#include "nsPrintfCString.h"
#include "mozilla/mozalloc.h"
#include "mozilla/Mutex.h"
#include "mozilla/SharedThreadPool.h"
#include <stdint.h>
#include <algorithm>

View file

@ -7,6 +7,7 @@
#ifndef MOZILLA_MEDIASTREAMLISTENER_h_
#define MOZILLA_MEDIASTREAMLISTENER_h_
#include "MediaStreamGraph.h"
#include "StreamTracks.h"
namespace mozilla {

View file

@ -7,8 +7,10 @@
#include "DOMMediaStream.h"
#include "MediaStreamGraph.h"
#include "nsContentUtils.h"
#include "nsIUUIDGenerator.h"
#include "nsServiceManagerUtils.h"
#include "MediaStreamError.h"
#include "MediaStreamListener.h"
#include "systemservices/MediaUtils.h"
@ -21,6 +23,8 @@
static mozilla::LazyLogModule gMediaStreamTrackLog("MediaStreamTrack");
#define LOG(type, msg) MOZ_LOG(gMediaStreamTrackLog, type, msg)
using namespace mozilla::media;
namespace mozilla {
namespace dom {

View file

@ -10,7 +10,7 @@ EXPORTS.mozilla += [
'MediaDrmProxySupport.h',
]
UNIFIED_SOURCES += [
SOURCES += [
'MediaDrmCDMCallbackProxy.cpp',
'MediaDrmCDMProxy.cpp',
'MediaDrmProxySupport.cpp',

View file

@ -23,7 +23,7 @@ EXPORTS.mozilla += [
'EMEUtils.h',
]
UNIFIED_SOURCES += [
SOURCES += [
'CDMCaps.cpp',
'DetailedPromise.cpp',
'EMEUtils.cpp',

View file

@ -10,13 +10,10 @@ EXPORTS += [
'MP4Stream.h',
]
UNIFIED_SOURCES += [
SOURCES += [
'MP4Decoder.cpp',
'MP4Demuxer.cpp',
'MP4Stream.cpp',
]
SOURCES += [
'MP4Demuxer.cpp',
]
FINAL_LIBRARY = 'xul'

View file

@ -4,7 +4,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GMPDecryptorParent.h"
#include "GMPContentParent.h"
#include "GMPUtils.h"
#include "MediaData.h"
#include "mozilla/Unused.h"

View file

@ -10,8 +10,10 @@
#include "nsCOMPtr.h"
#include "nsLiteralString.h"
#include "nsCRTGlue.h"
#include "mozIGeckoMediaPluginService.h"
#include "mozilla/Base64.h"
#include "nsISimpleEnumerator.h"
#include "prio.h"
namespace mozilla {

View file

@ -87,7 +87,7 @@ if CONFIG['OS_TARGET'] == 'Android':
'rlz',
]
UNIFIED_SOURCES += [
SOURCES += [
'GMPAudioDecoderChild.cpp',
'GMPAudioDecoderParent.cpp',
'GMPAudioHost.cpp',
@ -123,7 +123,7 @@ UNIFIED_SOURCES += [
]
if CONFIG['MOZ_EME']:
UNIFIED_SOURCES += [
SOURCES += [
'GMPCDMCallbackProxy.cpp',
'GMPCDMProxy.cpp',
]

View file

@ -15,24 +15,6 @@
namespace mozilla {
class CaptureTask::MediaStreamEventListener : public MediaStreamTrackListener
{
public:
explicit MediaStreamEventListener(CaptureTask* aCaptureTask)
: mCaptureTask(aCaptureTask) {};
// MediaStreamListener methods.
void NotifyEnded() override
{
if(!mCaptureTask->mImageGrabbedOrTrackEnd) {
mCaptureTask->PostTrackEndEvent();
}
}
private:
CaptureTask* mCaptureTask;
};
CaptureTask::CaptureTask(dom::ImageCapture* aImageCapture)
: mImageCapture(aImageCapture)
, mEventListener(new MediaStreamEventListener(this))

View file

@ -86,6 +86,24 @@ protected:
bool mPrincipalChanged;
};
class CaptureTask::MediaStreamEventListener : public MediaStreamTrackListener
{
public:
explicit MediaStreamEventListener(CaptureTask* aCaptureTask)
: mCaptureTask(aCaptureTask) {};
// MediaStreamListener methods.
void NotifyEnded() override
{
if(!mCaptureTask->mImageGrabbedOrTrackEnd) {
mCaptureTask->PostTrackEndEvent();
}
}
private:
CaptureTask* mCaptureTask;
};
} // namespace mozilla
#endif // CAPTURETASK_H

View file

@ -8,7 +8,7 @@ EXPORTS.mozilla.dom += [
'ImageCapture.h'
]
UNIFIED_SOURCES += [
SOURCES += [
'CaptureTask.cpp',
'ImageCapture.cpp',
]

View file

@ -40,6 +40,7 @@ using media::TimeUnit;
using media::TimeInterval;
using media::TimeIntervals;
typedef SourceBufferTask::AppendBufferResult AppendBufferResult;
typedef SourceBufferAttributes::AppendState AppendState;
static const char*
AppendStateToStr(SourceBufferAttributes::AppendState aState)

View file

@ -21,7 +21,7 @@ EXPORTS.mozilla.dom += [
'SourceBufferList.h',
]
UNIFIED_SOURCES += [
SOURCES += [
'ContainerParser.cpp',
'MediaSource.cpp',
'MediaSourceDecoder.cpp',

View file

@ -184,7 +184,7 @@ EXPORTS.mozilla.dom += [
'VideoTrackList.h',
]
UNIFIED_SOURCES += [
SOURCES += [
'AccurateSeekTask.cpp',
'ADTSDecoder.cpp',
'ADTSDemuxer.cpp',
@ -201,6 +201,7 @@ UNIFIED_SOURCES += [
'CanvasCaptureMediaStream.cpp',
'CubebUtils.cpp',
'DecoderDoctorDiagnostics.cpp',
'DecoderTraits.cpp',
'DOMMediaStream.cpp',
'EncodedBufferCache.cpp',
'FileBlockCache.cpp',
@ -256,11 +257,6 @@ UNIFIED_SOURCES += [
if CONFIG['OS_TARGET'] == 'WINNT':
SOURCES += [ 'ThreadPoolCOMListener.cpp' ]
# DecoderTraits.cpp needs to be built separately because of Mac OS X headers.
SOURCES += [
'DecoderTraits.cpp',
]
# Some codec-related code uses multi-character constants, which GCC and clang
# warn about. Suppress turning this warning into an error.
if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:

View file

@ -7,6 +7,7 @@
#if !defined(PlatformDecoderModule_h_)
#define PlatformDecoderModule_h_
#include "ImageContainer.h"
#include "MediaDecoderReader.h"
#include "MediaInfo.h"
#include "mozilla/MozPromise.h"

View file

@ -10,6 +10,7 @@
#include "nsError.h"
#include "TimeUnits.h"
#include "mozilla/PodOperations.h"
#include "mozilla/SyncRunnable.h"
#include <algorithm>

View file

@ -11,7 +11,7 @@ EXPORTS += [
'SamplesWaitingForKey.h',
]
UNIFIED_SOURCES += [
SOURCES += [
'EMEAudioDecoder.cpp',
'EMEDecoderModule.cpp',
'EMEVideoDecoder.cpp',

View file

@ -10,6 +10,7 @@
#include "prsystem.h"
#include "MediaData.h"
#include "GMPDecoderModule.h"
#include "MP4Decoder.h"
#include "VPXDecoder.h"
namespace mozilla {

View file

@ -11,7 +11,7 @@ EXPORTS += [
'MediaDataDecoderProxy.h',
]
UNIFIED_SOURCES += [
SOURCES += [
'GMPAudioDecoder.cpp',
'GMPDecoderModule.cpp',
'GMPVideoDecoder.cpp',

View file

@ -16,6 +16,7 @@
#include "FFmpegVideoDecoder.h"
#include "FFmpegLog.h"
#include "mozilla/PodOperations.h"
#include "prsystem.h" // for PR_GetNumberOfProcessors
#include "libavutil/pixfmt.h"
#if LIBAVCODEC_VERSION_MAJOR < 54

View file

@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
UNIFIED_SOURCES += [
SOURCES += [
'../FFmpegAudioDecoder.cpp',
'../FFmpegDataDecoder.cpp',
'../FFmpegDecoderModule.cpp',

View file

@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
UNIFIED_SOURCES += [
SOURCES += [
'../FFmpegAudioDecoder.cpp',
'../FFmpegDataDecoder.cpp',
'../FFmpegDecoderModule.cpp',

View file

@ -9,7 +9,7 @@ EXPORTS += [
'FFVPXRuntimeLinker.h',
]
UNIFIED_SOURCES += [
SOURCES += [
'../FFmpegAudioDecoder.cpp',
'../FFmpegDataDecoder.cpp',
'../FFmpegDecoderModule.cpp',

View file

@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
UNIFIED_SOURCES += [
SOURCES += [
'../FFmpegAudioDecoder.cpp',
'../FFmpegDataDecoder.cpp',
'../FFmpegDecoderModule.cpp',

View file

@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
UNIFIED_SOURCES += [
SOURCES += [
'../FFmpegAudioDecoder.cpp',
'../FFmpegDataDecoder.cpp',
'../FFmpegDecoderModule.cpp',

View file

@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
UNIFIED_SOURCES += [
SOURCES += [
'../FFmpegAudioDecoder.cpp',
'../FFmpegDataDecoder.cpp',
'../FFmpegDecoderModule.cpp',

View file

@ -16,7 +16,7 @@ DIRS += [
'ffmpeg58',
]
UNIFIED_SOURCES += [
SOURCES += [
'FFmpegRuntimeLinker.cpp',
]

View file

@ -16,7 +16,7 @@ EXPORTS += [
'wrappers/H264Converter.h'
]
UNIFIED_SOURCES += [
SOURCES += [
'agnostic/AgnosticDecoderModule.cpp',
'agnostic/BlankDecoderModule.cpp',
'agnostic/OpusDecoder.cpp',
@ -42,7 +42,7 @@ if CONFIG['MOZ_WMF']:
if CONFIG['MOZ_FFVPX'] or CONFIG['MOZ_FFMPEG']:
# common code to either FFmpeg or FFVPX
UNIFIED_SOURCES += [
SOURCES += [
'ffmpeg/FFmpegLibWrapper.cpp',
]
@ -60,7 +60,7 @@ if CONFIG['MOZ_AV1']:
EXPORTS += [
'agnostic/AOMDecoder.h',
]
UNIFIED_SOURCES += [
SOURCES += [
'agnostic/AOMDecoder.cpp',
]
@ -68,7 +68,7 @@ if CONFIG['MOZ_APPLEMEDIA']:
EXPORTS += [
'apple/AppleDecoderModule.h',
]
UNIFIED_SOURCES += [
SOURCES += [
'apple/AppleATDecoder.cpp',
'apple/AppleCMLinker.cpp',
'apple/AppleDecoderModule.cpp',
@ -85,7 +85,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
EXPORTS += [
'android/AndroidDecoderModule.h',
]
UNIFIED_SOURCES += [
SOURCES += [
'android/AndroidDecoderModule.cpp',
'android/MediaCodecDataDecoder.cpp',
'android/RemoteDataDecoder.cpp',

View file

@ -6,6 +6,8 @@
#include "OmxPlatformLayer.h"
#include "OmxDataDecoder.h"
#include "OMX_VideoExt.h" // For VP8.
#include "VPXDecoder.h"

View file

@ -7,6 +7,7 @@
#if !defined(OmxPlatformLayer_h_)
#define OmxPlatformLayer_h_
#include "OMX_Component.h"
#include "OMX_Core.h"
#include "OMX_Types.h"

View file

@ -8,7 +8,7 @@ EXPORTS += [
'OmxDecoderModule.h',
]
UNIFIED_SOURCES += [
SOURCES += [
'OmxDataDecoder.cpp',
'OmxDecoderModule.cpp',
'OmxPlatformLayer.cpp',

View file

@ -14,6 +14,7 @@ EXPORTS += [
'WMFUtils.h',
'WMFVideoMFTManager.h',
]
UNIFIED_SOURCES += [
'DXVA2Manager.cpp',
'MFTDecoder.cpp',

View file

@ -6,6 +6,8 @@
#include "FuzzingWrapper.h"
#include "mozilla/SharedThreadPool.h"
mozilla::LogModule* GetFuzzingWrapperLog() {
static mozilla::LazyLogModule log("MediaFuzzingWrapper");
return log;

View file

@ -6,9 +6,11 @@
#include "mozilla/TaskQueue.h"
#include "DecoderDoctorDiagnostics.h"
#include "H264Converter.h"
#include "ImageContainer.h"
#include "MediaInfo.h"
#include "PDMFactory.h"
#include "mp4_demuxer/AnnexB.h"
#include "mp4_demuxer/H264.h"