diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /dom/media/ipc/MFMediaEngineChild.cpp | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/ipc/MFMediaEngineChild.cpp')
-rw-r--r-- | dom/media/ipc/MFMediaEngineChild.cpp | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/dom/media/ipc/MFMediaEngineChild.cpp b/dom/media/ipc/MFMediaEngineChild.cpp index 02013056d5..cc32d15ea4 100644 --- a/dom/media/ipc/MFMediaEngineChild.cpp +++ b/dom/media/ipc/MFMediaEngineChild.cpp @@ -47,20 +47,22 @@ MFMediaEngineChild::MFMediaEngineChild(MFMediaEngineWrapper* aOwner, } RefPtr<GenericNonExclusivePromise> MFMediaEngineChild::Init( - bool aShouldPreload) { + const MediaInfo& aInfo, bool aShouldPreload) { if (!mManagerThread) { return GenericNonExclusivePromise::CreateAndReject(NS_ERROR_FAILURE, __func__); } - CLOG("Init"); + CLOG("Init, hasAudio=%d, hasVideo=%d, encrypted=%d", aInfo.HasAudio(), + aInfo.HasVideo(), aInfo.IsEncrypted()); + MOZ_ASSERT(mMediaEngineId == 0); RefPtr<MFMediaEngineChild> self = this; RemoteDecoderManagerChild::LaunchUtilityProcessIfNeeded( RemoteDecodeIn::UtilityProcess_MFMediaEngineCDM) ->Then( mManagerThread, __func__, - [self, this, aShouldPreload](bool) { + [self, this, aShouldPreload, info = aInfo](bool) { RefPtr<RemoteDecoderManagerChild> manager = RemoteDecoderManagerChild::GetSingleton( RemoteDecodeIn::UtilityProcess_MFMediaEngineCDM); @@ -72,8 +74,13 @@ RefPtr<GenericNonExclusivePromise> MFMediaEngineChild::Init( mIPDLSelfRef = this; Unused << manager->SendPMFMediaEngineConstructor(this); - MediaEngineInfoIPDL info(aShouldPreload); - SendInitMediaEngine(info) + + MediaInfoIPDL mediaInfo( + info.HasAudio() ? Some(info.mAudio) : Nothing(), + info.HasVideo() ? Some(info.mVideo) : Nothing()); + + MediaEngineInfoIPDL initInfo(mediaInfo, aShouldPreload); + SendInitMediaEngine(initInfo) ->Then( mManagerThread, __func__, [self, this](uint64_t aId) { @@ -256,9 +263,9 @@ MFMediaEngineWrapper::MFMediaEngineWrapper(ExternalEngineStateMachine* aOwner, mCurrentTimeInSecond(0.0) {} RefPtr<GenericNonExclusivePromise> MFMediaEngineWrapper::Init( - bool aShouldPreload) { + const MediaInfo& aInfo, bool aShouldPreload) { WLOG("Init"); - return mEngine->Init(aShouldPreload); + return mEngine->Init(aInfo, aShouldPreload); } MFMediaEngineWrapper::~MFMediaEngineWrapper() { mEngine->OwnerDestroyed(); } @@ -335,18 +342,6 @@ void MFMediaEngineWrapper::NotifyEndOfStream(TrackInfo::TrackType aType) { [engine = mEngine, aType] { engine->SendNotifyEndOfStream(aType); })); } -void MFMediaEngineWrapper::SetMediaInfo(const MediaInfo& aInfo) { - WLOG("SetMediaInfo, hasAudio=%d, hasVideo=%d, encrypted=%d", aInfo.HasAudio(), - aInfo.HasVideo(), aInfo.IsEncrypted()); - MOZ_ASSERT(IsInited()); - Unused << ManagerThread()->Dispatch(NS_NewRunnableFunction( - "MFMediaEngineWrapper::SetMediaInfo", [engine = mEngine, aInfo] { - MediaInfoIPDL info(aInfo.HasAudio() ? Some(aInfo.mAudio) : Nothing(), - aInfo.HasVideo() ? Some(aInfo.mVideo) : Nothing()); - engine->SendNotifyMediaInfo(info); - })); -} - bool MFMediaEngineWrapper::SetCDMProxy(CDMProxy* aProxy) { #ifdef MOZ_WMF_CDM WMFCDMProxy* proxy = aProxy->AsWMFCDMProxy(); |