From aaf923793582ffaaf75757a1356c155f53707da7 Mon Sep 17 00:00:00 2001 From: Bryce Seager van Dyk Date: Tue, 25 Aug 2020 02:58:57 +0000 Subject: [PATCH] Bug 1654397 - Set crypto scheme when initializing video decoder CDM. r=alwu Differential Revision: https://phabricator.services.mozilla.com/D88038 --- .../agnostic/eme/ChromiumCDMVideoDecoder.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dom/media/platforms/agnostic/eme/ChromiumCDMVideoDecoder.cpp b/dom/media/platforms/agnostic/eme/ChromiumCDMVideoDecoder.cpp index 92372fae2f7c..d030916fac09 100644 --- a/dom/media/platforms/agnostic/eme/ChromiumCDMVideoDecoder.cpp +++ b/dom/media/platforms/agnostic/eme/ChromiumCDMVideoDecoder.cpp @@ -71,6 +71,20 @@ RefPtr ChromiumCDMVideoDecoder::Init() { } config.mImageWidth() = mConfig.mImage.width; config.mImageHeight() = mConfig.mImage.height; + config.mEncryptionScheme() = cdm::EncryptionScheme::kUnencrypted; + switch (mConfig.mCrypto.mCryptoScheme) { + case CryptoScheme::None: + break; + case CryptoScheme::Cenc: + config.mEncryptionScheme() = cdm::EncryptionScheme::kCenc; + break; + case CryptoScheme::Cbcs: + config.mEncryptionScheme() = cdm::EncryptionScheme::kCenc; + break; + default: + MOZ_ASSERT_UNREACHABLE("Should not have unrecognized encryption type"); + break; + } RefPtr cdm = mCDMParent; VideoInfo info = mConfig;