Bug 1766308 - Add gfxVars::CodecSupportInfo to store user-readable codec support string r=media-playback-reviewers,alwu

Differential Revision: https://phabricator.services.mozilla.com/D147386
This commit is contained in:
az 2022-07-19 23:27:39 +00:00
Родитель 5d97400d50
Коммит 86d8351f49
5 изменённых файлов: 12 добавлений и 0 удалений

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

@ -84,6 +84,7 @@ class gfxVarReceiver;
_(UseEGL, bool, false) \
_(DrmRenderDevice, nsCString, nsCString()) \
_(UseDMABuf, bool, false) \
_(CodecSupportInfo, nsCString, nsCString()) \
_(WebRenderRequiresHardwareDriver, bool, false) \
_(SupportsThreadsafeGL, bool, false) \
_(OffscreenCanvasDomainAllowlist, nsCString, nsCString()) \

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

@ -154,6 +154,9 @@ class MockGfxInfo final : public nsIGfxInfo {
NS_IMETHOD GetTargetFrameRate(uint32_t* aTargetFrameRate) override {
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHOD GetCodecSupportInfo(nsACString& aCodecSupportInfo) override {
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHOD GetD2DEnabled(bool* aD2DEnabled) override {
return NS_ERROR_NOT_IMPLEMENTED;
}

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

@ -1865,6 +1865,12 @@ GfxInfoBase::GetTargetFrameRate(uint32_t* aTargetFrameRate) {
return NS_OK;
}
NS_IMETHODIMP
GfxInfoBase::GetCodecSupportInfo(nsACString& aCodecSupportInfo) {
aCodecSupportInfo.Assign(gfx::gfxVars::CodecSupportInfo());
return NS_OK;
}
NS_IMETHODIMP
GfxInfoBase::GetIsHeadless(bool* aIsHeadless) {
*aIsHeadless = gfxPlatform::IsHeadless();

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

@ -71,6 +71,7 @@ class GfxInfoBase : public nsIGfxInfo,
NS_IMETHOD GetWebRenderEnabled(bool* aWebRenderEnabled) override;
NS_IMETHOD GetIsHeadless(bool* aIsHeadless) override;
NS_IMETHOD GetTargetFrameRate(uint32_t* aTargetFrameRate) override;
NS_IMETHOD GetCodecSupportInfo(nsACString& aCodecSupportInfo) override;
// Non-XPCOM method to get IPC data:
nsTArray<mozilla::gfx::GfxInfoFeatureStatus> GetAllFeatures();

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

@ -37,6 +37,7 @@ interface nsIGfxInfo : nsISupports
readonly attribute boolean WebRenderEnabled;
readonly attribute boolean isHeadless;
readonly attribute unsigned long TargetFrameRate;
readonly attribute ACString CodecSupportInfo;
// XXX: Switch to a list of devices, rather than explicitly numbering them.