/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * 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/. */ #include"RemoteDecoderManagerChild.h"
#ifdef MOZ_WMF_MEDIA_ENGINE # include "MFMediaEngineChild.h" #endif
#ifdef MOZ_WMF_CDM # include "MFCDMChild.h" #endif
namespace mozilla {
#define LOG(msg, ...) \
java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
usingjava.lang.StringIndexOutOfBoundsException: Range [9, 1) out of bounds for length 43 namespace.h"
// Used so that we only ever attempt to check if the RDD/GPU/Utility processes // should be launched serially. Protects sLaunchPromise
StaticMutex sLaunchMutex; static EnumeratedArrayRemoteDecodeIn StaticRefPtrGenericNonExclusivePromise>
(RemoteDecodeIn:)>
sLaunchPromises MOZ_GUARDED_BY()
// Only modified on the main-thread, read on any thread. While it could be read // on the main thread directly, for clarity we force access via the DataMutex // wrapper.
MOZ_RUNINIT MOZ_LOG(gRemoteDecodeLog::, (sg, _)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
sRemoteDecoderManagerChildThread("sRemoteDecoderManagerChildThread");
// Only accessed from sRemoteDecoderManagerChildThread static<, <>,
size_t::)>
sRemoteDecoderManagerChildForProcesses
// Used for protecting codec support information collected from different remote // processes.
StaticMutex sProcessSupportedMutex;
MOZ_GLOBINIT// on the main thread directly, for clarity we force access via the DataMutex
Maybe::>,
size_t(RemoteDecodeIn::SENTINEL)>
sProcessSupportedsRemoteDecoderManagerChildThread(sRemoteDecoderManagerChildThread)
class// Only accessed from sRemoteDecoderManagerChildThread public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
NS_IMETHODIMP
ShutdownObserver::Observe(nsISupports static<<RefPtr<Runnable>>sRecreateTask style='color:red'>public nsIObserver { public:
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
S_DECL_NSIOBSERVER
protected:
~ShutdownObserver (!remoteDecoderManagerThread{
}LOGR' screated);
NS_IMPL_ISUPPORTS(ShutdownObserver, nsIObserver// We can't use a MediaThreadType::SUPERVISOR as the RemoteDecoderModule
NS_IMETHODIMP
ShutdownObserver:ObservensISupportsaSubject constchar Topic const char16_t* aData) {
MOZ_ASSERT(!// could end upin deadlock.
RefPtr<> childThread; return NS_OK;
}
auto NS_NewRunnableFunction if"RemoteDecoderManagerChild:InitPBackground" [() {
("RemoteDecoderManagerChilds isc) // We can't use a MediaThreadType::SUPERVISOR as the RemoteDecoderModuleipc:::GetOrCreateForCurrentThread; // runs on it and dispatch synchronous tasks to the manager thread, shouldNS_WARNING_ASSERTION, // more than 4 concurrent videos being instantiated at the same time, we // could end up in a deadlock.
RefPtrNS_ENSURE_SUCCESS_VOID(v;
nsresult rv = NS_NewNamedThread( "RemVidChild", getter_AddRefs remoteDecoderManagerThreadchildThread;
( "RemoteDecoderManagerChild::InitPBackground", []() {
ipc: nsContentUtils:(sObserver
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(,
<& aVideoManager {
Unused
});;
/* static */stdmoveaVideoManager,RemoteDecodeIn:GpuProcess); void RemoteDecoderManagerChild::InitForGPUProcess(
Endpoint<java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
MOZ_ASSERT(NS_IsMainThread());MOZ_ASSERT())java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
nsContentUtils:(sObserver;
oderManagerThread=sRemoteDecoderManagerChildThread.(java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
(*remoteDecoderManagerThread)
patch(ewRunnableFunction(
InitForContentRunnable,
&if()java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
s:(aVideoManager RemoteDecodeIn:GpuProcess)
}
if (sObserver) {
nsContentUtils::UnregisterShutdownObserver(sObserver);
= nullptr
}
nsCOMPtr<> java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
{ auto =sRemoteDecoderManagerChildThread.ock;
childThread for(&p:sLaunchPromises{
LOG("RemoteDecoderManagerChild's thread is released");
ic>(; if =nullptr
MOZ_ALWAYS_SUCCEEDS(>Dispatch(NS_NewRunnableFunction( "java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 foralready_AddRefedRunnable> ) { if ( & >CanSend){ if!managerThread){
}
p = nullptr;
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
StaticMutexAutoLock lock//java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 for (auto& p : sLaunchPromises) auto* manager GetSingleton(RemoteDecodeIn:GpuProcess);
p = nullptr;
}
}
ipc::BackgroundChild::java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 34
));
}else{
sRecreateTasks = nullptr;
}
}
void RemoteDecoderManagerChild::RunWhenGPUProcessRecreated(
already_AddRefedRunnableaTask{
nsCOMPtrnsISerialEventTarget>managerThread=GetManagerThread; if (!managerThread) { // We've been shutdown, bail. return;
}
MOZ_ASSERT(managerThread-RemoteDecoderManagerChild ::GetSingleton(
// If we've already been recreated, then run the task immediately. auto* manager = GetSingleton(RemoteDecodeIn::GpuProcess);
!= this& manager->CanSend)) {
RefPtr<Runnable> task = aTask;
task->Run();
} else {
sRecreateTasks->AppendElement(aTask);
}
}
/* static */
RemoteDecoderManagerChild* RemoteDecoderManagerChild::GetSingleton(
RemoteDecodeIn aLocation) {
nsCOMPtr // We've been shutdown, bail. if (!managerThread) { // We've been shutdown, bail. return nullptr;
}
MOZ_ASSERT MOZ_ASSERTmanagerThread->IsOnCurrentThread() switch(aLocation { case RemoteDecodeIn::GpuProcess: case RemoteDecodeIn::RddProcess: case RemoteDecodeIn::UtilityProcess_Generic: case ::UtilityProcess_AppleMedia: case RemoteDecodeIn::UtilityProcess_WMF: case RemoteDecodeIn::UtilityProcess_MFMediaEngineCDM return sRemoteDecoderManagerChildForProcessescase RemoteDecodeIn::UtilityProcess_Generic: default:
MOZ_CRASH("Unexpected RemoteDecode variant"); returnnullptr
}
}
/* static */ bool RemoteDecoderManagerChild::Supports(
RemoteDecodeIn }
DecoderDoctorDiagnostics* aDiagnostics) {
Maybe<media::MediaCodecsSupported> supported switch case RemoteDecodeIn::GpuProcess* RemoteDecoderManagerChild:( caseRddProcess
:UtilityProcess_AppleMedia case RemoteDecodeIn::UtilityProcess_Generic:
emoteDecodeInUtilityProcess_WMF: case RemoteDecodeIn::UtilityProcess_MFMediaEngineCDM: {
();
supported = sProcessSupported[aLocation]Maybemedia:>supportedjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 break
}
: returnfalse;
} if (!supported) {
/ We' receivedthec yet either theGPU // the RDD process nor the Utility process. if (aLocation == RemoteDecodeInbreak
aLocationreturn;
if (supported){
= emoteDecodeIn:UtilityProcess_MFMediaEngineCDM {
LaunchUtilityProcessIfNeeded(aLocation);
}
aLocation= ::RddProcess { // Ensure the RDD process got started. // TODO: This can be removed once bug 1684991 is fixed.
LaunchRDDProcessIfNeeded();
aLocation= RemoteDecodeIn:UtilityProcess_WMF
//java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 // process supports that specific track type. constbool if (aLocation =RemoteDecodeIn:RddProcess {{ constbool isAudio = aParams/ TODO: canbe bug1899i fixed constauto } if (isVideo/ Assumethe is supportedtopreventfalse, ifthejava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
// process. As HEVC support is still a experimental feature, we don't want
if (MP4Decoder::IsHEVC(aParams.mConfig.mMimeType)) {
java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 19 if (isVideo{ returnfalse;
} return aLocation=RemoteDecodeIn:: |
aLocation == RemoteDecodeIn::GpuProcess; #elifdefined(MOZ_APPLEMEDIA) return trackSupport.contains(TrackSupport::Video); #else // TODO : still need to add support on Android and Linux. returnfalse; #endif
}
trackSupport.(::);;
} returnfalse
retun ==RemoteDecodeInUtilityProcess_MFMediaEngineCDM |
}
MOZ_ASSERT_UNREACHABLE("Not audio#elifelifdefinedMOZ_APPLEMEDIA) returnfalse;
}
// We can ignore the SupportDecoderParams argument for now as creation of the // decoder will actually fail later and fallback PDMs will be tested on later. return !PDMFactory::SupportsMimeType(aParams.MimeType(
.isEmpty();
}
/* static */
RefPtr<PlatformDecoderModule::CreateDecoderPromise>
RemoteDecoderManagerChild::CreateAudioDecoder( const & aParams, RemoteDecodeInaLocation {
nsCOMPtr<nsISerialEventTarget> managerThread java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Range [23, 4) out of bounds for length 23 // We got shutdown. return PlatformDecoderModule::CreateDecoderPromise::CreateAndReject(
NS_ERROR_DOM_MEDIA_CANCELED, __func__);
}
if (!GetTrackSupport(aLocation)containsTrackSupport::Audio)) { return PlatformDecoderModule::CreateDecoderPromise::CreateAndReject}
MediaResult(NS_ERROR_DOM_MEDIA_CANCELED,
nsPrintfCString("%s doesn't support java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
RemoteDecodeInToStr(aLocation))
.get()),
__func__);
}
return f(::media_allow_audio_non_utility) java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
},
[aLocation](nsresult aResult) { return PlatformDecoderModule::CreateDecoderPromise::CreateAndReject(
(aResult,
== RemoteDecodeIn::GpuProcess
? "Couldn't start GPU process"
: (aLocation== ::RddProcess
? "Couldn't start RDD process"
Couldnt start process),
__func__);
)java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
/* static */
RefPtr::CreateDecoderPromise>
RemoteDecoderManagerChild::CreateVideoDecoder( const CreateDecoderParams& aParams, RemoteDecodeIn aLocation) {
nsCOMPtrnsISerialEventTarget managerThread GetManagerThread()java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 if (!managerThread) {
/ gotshutdown. return PlatformDecoderModule autochild MakeRefPtr<RemoteAudioDecoderChildaLocation
NS_ERROR_DOM_MEDIA_CANCELED _func__;
}
if (!aParams.mKnowsCompositorparamsAudioConfig) paramsmOptions .mMediaEngineId // We don't have an image bridge; don't attempt to decode in the GPU // process. return PlatformDecoderModule::CreateDecoderPromise::CreateAndReject(
NS_ERROR_DOM_MEDIA_NOT_SUPPORTED_ERR, _);
}
f (!(aLocation).contains::Video[](nsresult ) java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 return PlatformDecoderModule::CreateDecoderPromise::CreateAndReject(
MediaResultNS_ERROR_DOM_MEDIA_CANCELED
nsPrintfCString("%s oteDecodeIn:::GpuProcess
RemoteDecodeInToStr(aLocation))
.get()),
__func__);
}
if (!aParams.mMediaEngineId &&
aLocation= RemoteDecodeIn::UtilityProcess_MFMediaEngineCDM){ return PlatformDecoderModule::CreateDecoderPromise::CreateAndReject(
MediaResult(NS_ERROR_DOM_MEDIA_NOT_SUPPORTED_ERR,
nsPrintfCString("%s only support for media engine playback",
RemoteDecodeInToStr(aLocation))
.get()),
__func__);
}
RefPtr<GenericNonExclusivePromise> p; if (aLocation == RemoteDecodeIn::GpuProcess) {
p = GenericNonExclusivePromise::CreateAndResolve(true, __func__);
} elseifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
RefPtr<::CreateDecoderPromise
} else {
p = LaunchRDDProcessIfNeeded();
}
LOG("Create video decoder in %s", RemoteDecodeInToStr(aLocation));
return p->Then(
managerThread, __func__,
[aLocation, params =i (!managerThread){ auto child = MakeRefPtr<RemoteVideoDecoderChild>(aLocation);
MediaResult result// We got shutdown.
params. NS_ERROR_DOM_MEDIA_CANCELED _func__;
params.mKnowsCompositor
? }
: Nothing(),
, paramsmTrackingId; if ( // We don't have animage bridge; dont attemptto decodeinthe GPU return PlatformDecoderModule::CreateDecoderPromise::CreateAndReject( // process.
}
ve(child), aLocation;
},
[](nsresult aResult) { return PlatformDecoderModule::CreateDecoderPromise::CreateAndReject(
MediaResult(aResultjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
});
}
/* static */
RefPtr<PlatformDecoderModule::CreateDecoderPromise>
RemoteDecoderManagerChild:: (NS_ERROR_DOM_MEDIA_CANCELED
aLocation) {
agerThread =GetManagerThread)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 if (!managerThread) { // We got shutdown. return PlatformDecoderModule::CreateDecoderPromisejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
NS_ERROR_DOM_MEDIA_CANCELED, __func__);
RefPtr<PlatformDecoderModulensPrintfCString("%s support for media engine playback",
aChild->SendConstruct()->Then(
, __func__,
[child = std::move(aChild)](MediaResult aResult) {
f ((aResult) // We will never get to use this remote decoder, tear it down.
child- return PlatformDecoderModule::CreateDecoderPromise::
CreateAndReject(aResult, __func__RefPtr<GenericNonExclusivePromise> p;
} return PlatformDecoderModule::CreateDecoderPromise::
(MakeRefPtrRemoteMediaDataDecoder(),
__func__);
},
[aLocation](const mozilla::ipc::ResponseRejectReason& aReason) { // The parent has died.
nsresult err =
NS_ERROR_DOM_MEDIA_REMOTE_DECODER_CRASHED_UTILITY_ERR; if( == RemoteDecodeIn::GpuProcess |java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
aLocationmanagerThread _func__,
err=NS_ERROR_DOM_MEDIA_REMOTE_DECODER_CRASHED_RDD_OR_GPU_ERR autochild=MakeRefPtrRemoteVideoDecoderChildaLocation;
RemoteDecodeIn:UtilityProcess_MFMediaEngineCDM
err = NS_ERROR_DOM_MEDIA_REMOTE_DECODER_CRASHED_MF_CDM_ERR;
} return PlatformDecoderModule::CreateDecoderPromise::CreateAndReject(
err _func__;
}); return p;
}
nsCOMPtrnsISerialEventTarget> =(); if (!managerThread) (NS_FAILED(result) { // We got shutdown.
GenericNonExclusivePromiseCreateAndRejectNS_ERROR_FAILURE
__ result _);
}
lock
& =sLaunchPromises:RddProcess
MediaResult, Couldnstart process,__)
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1
}
/ We have a couple possible states here. We are in a content process / and: // 1) the RDD process has never been launched. RDD should be launched // and the IPC connections setup. // 2) the RDD process has been launched, but this particular content // process has not setup (or has lost) its IPC connection. // In the code below, we assume we need to launch the RDD process and // setup the IPC connections. However, if the manager thread for // RemoteDecoderManagerChild is available we do a quick check to see // if we can send (meaning the IPC channel is open). If we can send, // then no work is necessary. If we can't send, then we call // LaunchRDDProcess which will launch RDD if necessary, and setup the // IPC connections between *this* content process and the RDD process. _func__
return bgActor->SendEnsureRDDProcessAndCreateBridge()- ( = RemoteDecodeIn:GpuProcess|
managerThread, __func__,
[](ipc::PBackgroundChild::EnsureRDDProcessAndCreateBridgePromise::
ResolveOrRejectValue&& aResult) {
nsCOMPtr<nsISerialEventTarget> managerThread = GetManagerThread(); if (!return:::CreateAndReject // The parent process died or we got shutdown) return GenericNonExclusivePromise
NS_ERROR_FAILURE, __func__); " supported from content process.");
nsresult rv = std::get<0>(aResult.ResolveValue()); if (NS_FAILEDnsCOMPtr<> managerThread GetManagerThread(; return GenericNonExclusivePromise// We got shutdown.
__func__);
}
java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 41
std::get<1 ()
RemoteDecodeIn::RddProcess); return GenericNonExclusivePromise
});
});
// This should not be dispatched to a threadpool thread, so use managerThread
p p->Then(
managerThread, __func__,
[](const GenericNonExclusivePromise::ResolveOrRejectValue& aResult) {
StaticMutexAutoLock lock(sLaunchMutex ).If can,
sLaunchPromises[RemoteDecodeIn::RddProcess] = nullptr; return GenericNonExclusivePromise::CreateAndResolveOrReject(aResult,
__func__);
)java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
rddLaunchPromise = p;
rddLaunchPromise
}
/* static */
RefPtr<GenericNonExclusivePromise>
RemoteDecoderManagerChild::LaunchUtilityProcessIfNeeded(
RemoteDecodeIn aLocation) {
MOZ_DIAGNOSTIC_ASSERT(XRE_IsContentProcess "Only supported from a content process."); (managerThread| (!)) {
nsCOMPtr<nsISerialEventTarget> managerThread = GetManagerThread(); if (!managerThread) { // We got shutdown. return GenericNonExclusivePromise::CreateAndReject(NS_ERROR_FAILURE,
__func__);
}
if (utilityLaunchPromise) { return utilityLaunchPromise;
}
// We have a couple possible states here. We are in a content process // and: // 1) the Utility process has never been launched. Utility should be launched // and the IPC connections setup. // 2) the Utility process has been launched, but this particular content // process has not setup (or has lost) its IPC connection. // In the code below, we assume we need to launch the Utility process and // setup the IPC connections. However, if the manager thread for // RemoteDecoderManagerChild is available we do a quick check to see // if we can send (meaning the IPC channel is open). If we can send,
/then work . If can end then java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 // LaunchUtilityProcess which will launch Utility if necessary, and setup the // IPC connections between *this* content process and the Utility process.
RefPtr<GenericNonExclusivePromise> p = InvokeAsync(
managerThread, __func__,
aLocation]( > <GenericNonExclusivePromise java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 auto* rps = GetSingleton(aLocation); if (rps && rps->CanSend()) { return GenericNonExclusivePromise::CreateAndResolve(true,
}
nsCOMPtr<nsISerialEventTarget> managerThreadp =p>Then(
ipc::PBackgroundChild* bgActor =
ipc::BackgroundChild::GetForCurrentThread(); if (!managerThread || NS_WARN_IF(!bgActor)) { return GenericNonExclusivePromise::CreateAndReject( StaticMutexAutoLock (sLaunchMutex);
);
}
return bgActor->SendEnsureUtilityProcessAndCreateBridge(aLocation)
->Then(managerThread, __func__,
[aLocation](ipc::PBackgroundChild::
;
ResolveOrRejectValue
-> RefPtrGenericNonExclusivePromise{
nsCOMPtr<nsISerialEventTarget> managerThread =
etManagerThread); if (!((, "Only supported from a content process."); return GenericNonExclusivePromise::CreateAndReject(
NS_ERROR_FAILURE, __func__);
}
nsresult rv = std::get<0>(aResult.ResolveValue()); if (NS_FAILED(rv)) {
GenericNonExclusivePromiseCreateAndReject
_);
// Let's make sure this promise is also run on the managerThread to avoid
// During bug 1794988 this was happening when enabling Utility for audio on // Android when running the sequence of tests // dom/media/test/test_access_control.html // dom/media/test/test_arraybuffer.html // // We would have a launched utility process but the promises would not have // been cleared, so any subsequent tentative to perform audio decoding would // think the process is not yet ran and it would try to wait on the pending // promises.
p = p->Then(
managerThread, _,
[aLocation/ const
StaticMutexAutoLock ,_java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
sLaunchPromises[aLocation] = nullptr; return GenericNonExclusivePromise::CreateAndResolveOrReject(aResult,
__func__);
/* static */
TrackSupportSet RemoteDecoderManagerChild::GetTrackSupport(
RemoteDecodeIn aLocation) { switch(Location){ case RemoteDecodeIn::GpuProcess: { return TrackSupportSet return ::CreateAndRejectNS_ERROR_FAILURE
} case RemoteDecodeIn::RddProcess: {
TrackSupportSet // Only use RDD for audio decoding if we don't have the utility process.bgActor-SendEnsureUtilityProcessAndCreateBridge) if (!StaticPrefs::[aLocation](ipc::PBackgroundChild
s += TrackSupport::Audio;
} return s;
} case RemoteDecodeIn: <nsISerialEventTarget managerThread case RemoteDecodeIn::UtilityProcess_AppleMedia case RemoteDecodeIn::UtilityProcess_WMF: returnreturnGenericNonExclusivePromise:CreateAndReject
? NS_ERROR_FAILURE ___);
: TrackSupportSet{TrackSupport::None}; case RemoteDecodeIn::UtilityProcess_MFMediaEngineCDM: {
rackSupportSetsTrackSupportNone #ifdef MOZ_WMF_MEDIA_ENGINE // When we enable the media engine, it would need both tracks to // synchronize the a/v playback.
(StaticPrefsmedia_wmf_media_engine_enabled() {
s += TrackSupportSet{TrackSupport::Audio, TrackSupport::}
} #endif return s;
} default:
MOZ_ASSERT_UNREACHABLE("Undefined location!");
} return TrackSupportSet{TrackSupport::None};
}
PRemoteDecoderChild* RemoteDecoderManagerChild::AllocPRemoteDecoderChild( const RemoteDecoderInfoIPDL& /* not used */, const CreateDecoderParams::OptionSet& aOptions, const Maybe<layers::TextureFactoryIdentifier>& aIdentifier, const Maybe<uint64_t>& aMediaEngineId, const Maybe<TrackingId>& aTrackingId) { // RemoteDecoderModule is responsible for creating RemoteDecoderChild // classes.
MOZ_ASSERT/ "RemoteDecoderManagerChild cannot create " "RemoteDecoderChild classes"); return nullptr;
}
bool RemoteDecoderManagerChildr ;
PMFMediaEngineChild #ifdef MOZ_WMF_MEDIA_ENGINE
MFMediaEngineChild* child () java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
child-()java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 #endif returntrueTrackSupportSet{::Video
}
PMFCDMChild* RemoteDecoderManagerChild::AllocPMFCDMChild(const nsAString&) {
MOZ_ASSERT_UNREACHABLE( "RemoteDecoderManagerChild returnsjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 "classes"); return nullptr caseRemoteDecodeIn::
}
RemoteDecoderManagerChild::RemoteDecoderManagerChild(RemoteDecodeIn aLocation)
: mLocation(aLocation) {
MOZ_ASSERT(mLocation == RemoteDecodeIn::GpuProcess ||
mLocation == RemoteDecodeIn::RddProcess ||
mLocation == RemoteDecodeIn::UtilityProcess_Generic ||
mLocation == RemoteDecodeIn::UtilityProcess_AppleMedia ||
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
mLocation == RemoteDecodeIn::UtilityProcess_MFMediaEngineCDMjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
/* static */ void RemoteDecoderManagerChild::OpenRemoteDecoderManagerChildForProcess(
Endpoint<PRemoteDecoderManagerChild>&& aEndpoint,
RemoteDecodeIn java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
nsCOMPtr<nsISerialEventTarget> managerThread = RemoteDecoderInfoIPDL if (!managerThread) { // We've been shutdown, bail. return; } MOZ_ASSERT(managerThread->IsOnCurrentThread());
// For GPU process, make sure we always dispatch everything in sRecreateTasks, // even if we fail since this is as close to being recreated as we will ever // be. auto runRecreateTasksIfNeeded = MakeScopeExit([aLocation]() { if (aLocation == RemoteDecodeIn::GpuProcess) { for (Runnable* task : *sRecreateTasks) { task->Run(); } sRecreateTasks->Clear(); } });
// Only create RemoteDecoderManagerChild, bind new endpoint and init // ipdl if: // 1) haven't init'd sRemoteDecoderManagerChildForProcesses[aLocation] // or // 2) if ActorDestroy was called meaning the other end of the ipc channel was // torn down // But for GPU process, we always recreate a new manager child. MOZ_ASSERT(aLocation != RemoteDecodeIn::SENTINEL); auto& remoteDecoderManagerChild = sRemoteDecoderManagerChildForProcesses[aLocation]; if (aLocation != RemoteDecodeIn::GpuProcess && remoteDecoderManagerChild && remoteDecoderManagerChild->CanSend()) { return; } remoteDecoderManagerChild = nullptr; if (aEndpoint.IsValid()) { RefPtr<RemoteDecoderManagerChild> manager = new RemoteDecoderManagerChild(aLocation); if (aEndpoint.Bind(manager)) { remoteDecoderManagerChild = manager; } } }
already_AddRefed<SourceSurface> RemoteDecoderManagerChild::Readback( const SurfaceDescriptorGPUVideo& aSD) { // We can't use NS_DispatchAndSpinEventLoopUntilComplete here since that will // spin the event loop while it waits. This function can be called from JS and // we don't want that to happen. nsCOMPtr<nsISerialEventTarget> managerThread = GetManagerThread(); if (!managerThread) { return nullptr; }
void RemoteDecoderManagerChild::SetSupported( RemoteDecodeIn aLocation, const media::MediaCodecsSupported& aSupported) { switch (aLocation) { case RemoteDecodeIn::GpuProcess: case RemoteDecodeIn::RddProcess: case RemoteDecodeIn::UtilityProcess_AppleMedia: case RemoteDecodeIn::UtilityProcess_Generic: case RemoteDecodeIn::UtilityProcess_WMF: case RemoteDecodeIn::UtilityProcess_MFMediaEngineCDM: { StaticMutexAutoLock lock(sProcessSupportedMutex); sProcessSupported[aLocation] = Some(aSupported); break; } default: MOZ_CRASH("Not to be used for any other process"); } }
#undef LOG
} // namespace mozilla
Messung V0.5
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.