mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 04:41:11 +00:00
Bug 1865896 - Apply DefineEnum to CryptoScheme r=media-playback-reviewers,padenot
Depends on D204451 Differential Revision: https://phabricator.services.mozilla.com/D204452
This commit is contained in:
parent
9e080ed875
commit
94dcabe01e
@ -597,22 +597,6 @@ void MediaRawDataWriter::PopFront(size_t aSize) {
|
||||
mTarget->mBuffer.PopFront(aSize);
|
||||
}
|
||||
|
||||
const char* CryptoSchemeToString(const CryptoScheme& aScheme) {
|
||||
switch (aScheme) {
|
||||
case CryptoScheme::None:
|
||||
return "none";
|
||||
case CryptoScheme::Cenc:
|
||||
return "cenc";
|
||||
case CryptoScheme::Cbcs:
|
||||
return "cbcs";
|
||||
case CryptoScheme::Cbcs_1_9:
|
||||
return "cbcs-1-9";
|
||||
default:
|
||||
MOZ_ASSERT_UNREACHABLE("not supported scheme!");
|
||||
return "not supported scheme!";
|
||||
}
|
||||
}
|
||||
|
||||
nsCString CryptoSchemeSetToString(const CryptoSchemeSet& aSchemes) {
|
||||
nsAutoCString rv;
|
||||
if (aSchemes.contains(CryptoScheme::Cenc)) {
|
||||
|
@ -571,15 +571,10 @@ class VideoData : public MediaData {
|
||||
};
|
||||
|
||||
// See https://w3c.github.io/encrypted-media/#scheme-cenc
|
||||
enum class CryptoScheme : uint8_t {
|
||||
None,
|
||||
Cenc,
|
||||
Cbcs,
|
||||
Cbcs_1_9,
|
||||
};
|
||||
MOZ_DEFINE_ENUM_CLASS_WITH_BASE_AND_TOSTRING(CryptoScheme, uint8_t,
|
||||
(None, Cenc, Cbcs, Cbcs_1_9));
|
||||
using CryptoSchemeSet = EnumSet<CryptoScheme, uint8_t>;
|
||||
|
||||
const char* CryptoSchemeToString(const CryptoScheme& aScheme);
|
||||
nsCString CryptoSchemeSetToString(const CryptoSchemeSet& aSchemes);
|
||||
CryptoScheme StringToCryptoScheme(const nsAString& aString);
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "MediaInfo.h"
|
||||
|
||||
#include "MediaData.h"
|
||||
|
||||
namespace mozilla {
|
||||
@ -50,7 +51,7 @@ nsCString TrackInfo::ToString() const {
|
||||
NS_ConvertUTF16toUTF8(mLabel).get(),
|
||||
NS_ConvertUTF16toUTF8(mLanguage).get(), mEnabled ? "true" : "false",
|
||||
mTrackId, mMimeType.get(), mDuration.ToString().get(),
|
||||
mMediaTime.ToString().get(), CryptoSchemeToString(mCrypto.mCryptoScheme),
|
||||
mMediaTime.ToString().get(), EnumValueToString(mCrypto.mCryptoScheme),
|
||||
mIsRenderedExternally ? "true" : "false", TrackTypeToStr(mType));
|
||||
|
||||
if (!mTags.IsEmpty()) {
|
||||
|
@ -95,14 +95,14 @@ WMFCDMCapabilites::GetCapabilities(
|
||||
for (const auto& scheme : v.encryptionSchemes()) {
|
||||
EME_LOG("capabilities: video=%s, scheme=%s",
|
||||
NS_ConvertUTF16toUTF8(v.contentType()).get(),
|
||||
CryptoSchemeToString(scheme));
|
||||
EnumValueToString(scheme));
|
||||
}
|
||||
}
|
||||
for (const auto& a : capabilities.audioCapabilities()) {
|
||||
for (const auto& scheme : a.encryptionSchemes()) {
|
||||
EME_LOG("capabilities: audio=%s, scheme=%s",
|
||||
NS_ConvertUTF16toUTF8(a.contentType()).get(),
|
||||
CryptoSchemeToString(scheme));
|
||||
EnumValueToString(scheme));
|
||||
}
|
||||
}
|
||||
KeySystemConfig* config = outConfigs.AppendElement();
|
||||
|
@ -884,7 +884,7 @@ void MFCDMParent::GetCapabilities(const nsString& aKeySystem,
|
||||
convertCodecToFourCC(codec), nsCString(""),
|
||||
additionalFeature, isHardwareDecryption);
|
||||
MFCDM_PARENT_SLOG("clearlead %s IV 8 bytes %s %s",
|
||||
CryptoSchemeToString(scheme), codec.get(),
|
||||
EnumValueToString(scheme), codec.get(),
|
||||
rv ? "supported" : "not supported");
|
||||
if (rv) {
|
||||
supportedScheme += scheme;
|
||||
@ -896,7 +896,7 @@ void MFCDMParent::GetCapabilities(const nsString& aKeySystem,
|
||||
nsCString(""), additionalFeature,
|
||||
isHardwareDecryption);
|
||||
MFCDM_PARENT_SLOG("clearlead %s IV 16 bytes %s %s",
|
||||
CryptoSchemeToString(scheme), codec.get(),
|
||||
EnumValueToString(scheme), codec.get(),
|
||||
rv ? "supported" : "not supported");
|
||||
|
||||
if (rv) {
|
||||
|
@ -225,14 +225,14 @@ void UtilityAudioDecoderChild::GetKeySystemCapabilities(
|
||||
for (const auto& scheme : v.encryptionSchemes()) {
|
||||
EME_LOG(" capabilities: video=%s, scheme=%s",
|
||||
NS_ConvertUTF16toUTF8(v.contentType()).get(),
|
||||
CryptoSchemeToString(scheme));
|
||||
EnumValueToString(scheme));
|
||||
}
|
||||
}
|
||||
for (const auto& a : capabilities.audioCapabilities()) {
|
||||
for (const auto& scheme : a.encryptionSchemes()) {
|
||||
EME_LOG(" capabilities: audio=%s, scheme=%s",
|
||||
NS_ConvertUTF16toUTF8(a.contentType()).get(),
|
||||
CryptoSchemeToString(scheme));
|
||||
EnumValueToString(scheme));
|
||||
}
|
||||
}
|
||||
auto* info = cdmInfo.AppendElement(fallible);
|
||||
|
Loading…
Reference in New Issue
Block a user