Bug 1756775 Don't disable HW decoding directly on RDD level as we handle RDD crashes by MediaFormatReader r=alwu

Revert changes from Bug 1752493 as we handle RDD crashes on MediaFormatReader level.

Differential Revision: https://phabricator.services.mozilla.com/D139470
This commit is contained in:
stransky 2022-02-24 08:54:04 +00:00
Родитель 8986084415
Коммит 9358067df4
8 изменённых файлов: 14 добавлений и 30 удалений

Просмотреть файл

@ -43,8 +43,7 @@ parent:
async InitProfiler(Endpoint<PProfilerChild> endpoint);
async NewContentRemoteDecoderManager(
Endpoint<PRemoteDecoderManagerParent> endpoint,
bool allowHardwareDecoding);
Endpoint<PRemoteDecoderManagerParent> endpoint);
async RequestMemoryReport(uint32_t generation,
bool anonymize,

Просмотреть файл

@ -181,10 +181,8 @@ mozilla::ipc::IPCResult RDDParent::RecvInitProfiler(
}
mozilla::ipc::IPCResult RDDParent::RecvNewContentRemoteDecoderManager(
Endpoint<PRemoteDecoderManagerParent>&& aEndpoint,
const bool& aAllowHardwareDecoding) {
if (!RemoteDecoderManagerParent::CreateForContent(std::move(aEndpoint),
aAllowHardwareDecoding)) {
Endpoint<PRemoteDecoderManagerParent>&& aEndpoint) {
if (!RemoteDecoderManagerParent::CreateForContent(std::move(aEndpoint))) {
return IPC_FAIL_NO_REASON(this);
}
return IPC_OK();

Просмотреть файл

@ -34,8 +34,7 @@ class RDDParent final : public PRDDParent {
Endpoint<PProfilerChild>&& aEndpoint);
mozilla::ipc::IPCResult RecvNewContentRemoteDecoderManager(
Endpoint<PRemoteDecoderManagerParent>&& aEndpoint,
const bool& aAllowHardwareDecoding);
Endpoint<PRemoteDecoderManagerParent>&& aEndpoint);
mozilla::ipc::IPCResult RecvInitVideoBridge(
Endpoint<PVideoBridgeChild>&& aEndpoint,
const bool& aCreateHardwareDevice,

Просмотреть файл

@ -294,9 +294,7 @@ bool RDDProcessManager::CreateContentBridge(
return false;
}
mRDDChild->SendNewContentRemoteDecoderManager(
std::move(parentPipe),
/* aAllowHardwareDecoding */ mNumUnexpectedCrashes == 0);
mRDDChild->SendNewContentRemoteDecoderManager(std::move(parentPipe));
*aOutRemoteDecoderManager = std::move(childPipe);
return true;

Просмотреть файл

@ -115,8 +115,7 @@ PDMFactory& RemoteDecoderManagerParent::EnsurePDMFactory() {
}
bool RemoteDecoderManagerParent::CreateForContent(
Endpoint<PRemoteDecoderManagerParent>&& aEndpoint,
const bool aAllowHardwareDecoding) {
Endpoint<PRemoteDecoderManagerParent>&& aEndpoint) {
MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_RDD ||
XRE_GetProcessType() == GeckoProcessType_GPU);
MOZ_ASSERT(NS_IsMainThread());
@ -126,8 +125,8 @@ bool RemoteDecoderManagerParent::CreateForContent(
}
RefPtr<RemoteDecoderManagerParent> parent =
new RemoteDecoderManagerParent(sRemoteDecoderManagerParentThread,
aAllowHardwareDecoding);
new RemoteDecoderManagerParent(sRemoteDecoderManagerParentThread);
RefPtr<Runnable> task =
NewRunnableMethod<Endpoint<PRemoteDecoderManagerParent>&&>(
"dom::RemoteDecoderManagerParent::Open", parent,
@ -157,8 +156,8 @@ bool RemoteDecoderManagerParent::CreateVideoBridgeToOtherProcess(
}
RemoteDecoderManagerParent::RemoteDecoderManagerParent(
nsISerialEventTarget* aThread, const bool aAllowHardwareDecoding)
: mThread(aThread), mAllowHardwareDecoding(aAllowHardwareDecoding) {
nsISerialEventTarget* aThread)
: mThread(aThread) {
MOZ_COUNT_CTOR(RemoteDecoderManagerParent);
auto& registrar = XRE_IsGPUProcess()
? GPUParent::GetSingleton()->AsyncShutdownService()

Просмотреть файл

@ -23,8 +23,7 @@ class RemoteDecoderManagerParent final
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(RemoteDecoderManagerParent, override)
static bool CreateForContent(
Endpoint<PRemoteDecoderManagerParent>&& aEndpoint,
const bool aAllowHardwareDecoding);
Endpoint<PRemoteDecoderManagerParent>&& aEndpoint);
static bool CreateVideoBridgeToOtherProcess(
Endpoint<layers::PVideoBridgeChild>&& aEndpoint);
@ -51,8 +50,6 @@ class RemoteDecoderManagerParent final
bool OnManagerThread();
bool AllowHardwareDecoding() const { return mAllowHardwareDecoding; };
// Can be called from manager thread only
PDMFactory& EnsurePDMFactory();
@ -72,8 +69,7 @@ class RemoteDecoderManagerParent final
void ActorDealloc() override;
private:
RemoteDecoderManagerParent(nsISerialEventTarget* aThread,
const bool aAllowHardwareDecoding);
explicit RemoteDecoderManagerParent(nsISerialEventTarget* aThread);
~RemoteDecoderManagerParent();
void Open(Endpoint<PRemoteDecoderManagerParent>&& aEndpoint);
@ -83,8 +79,6 @@ class RemoteDecoderManagerParent final
nsCOMPtr<nsISerialEventTarget> mThread;
RefPtr<PDMFactory> mPDMFactory;
const bool mAllowHardwareDecoding;
};
} // namespace mozilla

Просмотреть файл

@ -158,9 +158,7 @@ IPCResult RemoteVideoDecoderParent::RecvConstruct(
imageContainer, CreateDecoderParams::VideoFrameRate(mFramerate),
mOptions, CreateDecoderParams::NoWrapper(true),
};
if (!mParent->AllowHardwareDecoding()) {
params.mOptions += CreateDecoderParams::Option::HardwareDecoderNotAllowed;
}
mParent->EnsurePDMFactory().CreateDecoder(params)->Then(
GetCurrentSerialEventTarget(), __func__,
[resolver = std::move(aResolver), self = RefPtr{this}](

Просмотреть файл

@ -549,8 +549,7 @@ mozilla::ipc::IPCResult GPUParent::RecvNewContentVRManager(
mozilla::ipc::IPCResult GPUParent::RecvNewContentRemoteDecoderManager(
Endpoint<PRemoteDecoderManagerParent>&& aEndpoint) {
if (!RemoteDecoderManagerParent::CreateForContent(
std::move(aEndpoint), /* AllowHardwareDecoding */ true)) {
if (!RemoteDecoderManagerParent::CreateForContent(std::move(aEndpoint))) {
return IPC_FAIL_NO_REASON(this);
}
return IPC_OK();