Merge remote-tracking branch 'origin/media-works' into master

This commit is contained in:
2022-08-09 09:19:27 +08:00
383 changed files with 15768 additions and 9538 deletions
+10 -4
View File
@@ -28,7 +28,7 @@
#include "ClientLayerManager.h"
#include "nsQueryObject.h"
#ifdef MOZ_FMP4
#include "MP4Reader.h"
#include "MP4Decoder.h"
#endif
#include "nsIScrollableFrame.h"
@@ -2252,7 +2252,7 @@ nsDOMWindowUtils::GetLayerManagerRemote(bool* retval)
}
NS_IMETHODIMP
nsDOMWindowUtils::GetSupportsHardwareH264Decoding(bool* retval)
nsDOMWindowUtils::GetSupportsHardwareH264Decoding(nsAString& aRetval)
{
MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
@@ -2265,9 +2265,15 @@ nsDOMWindowUtils::GetSupportsHardwareH264Decoding(bool* retval)
if (!mgr)
return NS_ERROR_FAILURE;
*retval = MP4Reader::IsVideoAccelerated(mgr->GetCompositorBackendType());
nsCString failureReason;
if (MP4Decoder::IsVideoAccelerated(mgr->GetCompositorBackendType(), failureReason)) {
aRetval.AssignLiteral("Yes");
} else {
aRetval.AssignLiteral("No; ");
AppendUTF8toUTF16(failureReason, aRetval);
}
#else
*retval = false;
aRetval.AssignLiteral("No; Compiled without MP4 support.");
#endif
return NS_OK;
}