diff options
Diffstat (limited to 'dom/media/ipc/PMFCDM.ipdl')
-rw-r--r-- | dom/media/ipc/PMFCDM.ipdl | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/dom/media/ipc/PMFCDM.ipdl b/dom/media/ipc/PMFCDM.ipdl new file mode 100644 index 0000000000..e86b94c217 --- /dev/null +++ b/dom/media/ipc/PMFCDM.ipdl @@ -0,0 +1,121 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +include "MFCDMSerializers.h"; + +include protocol PRemoteDecoderManager; + +using mozilla::KeySystemConfig::Requirement from "mozilla/KeySystemConfig.h"; +using mozilla::KeySystemConfig::SessionType from "mozilla/KeySystemConfig.h"; +using mozilla::CryptoScheme from "MediaData.h"; +using mozilla::dom::MediaKeyMessageType from "mozilla/dom/MediaKeyMessageEventBinding.h"; +using mozilla::dom::MediaKeyStatus from "mozilla/dom/MediaKeyStatusMapBinding.h"; +using mozilla::dom::HDCPVersion from "mozilla/dom/MediaKeysBinding.h"; + +namespace mozilla { + +// For EME spec 'message' event +// https://w3c.github.io/encrypted-media/#queue-message +struct MFCDMKeyMessage { + nsString sessionId; + MediaKeyMessageType type; + uint8_t[] message; +}; + +// For EME spec 'keystatuseschange' event +// https://w3c.github.io/encrypted-media/#dom-evt-keystatuseschange +struct MFCDMKeyInformation { + uint8_t[] keyId; + MediaKeyStatus status; +}; + +struct MFCDMKeyStatusChange { + nsString sessionId; + MFCDMKeyInformation[] keyInfo; +}; + +// For EME spec Update Expiration algorithm +// https://w3c.github.io/encrypted-media/#update-expiration +struct MFCDMKeyExpiration { + nsString sessionId; + double expiredTimeMilliSecondsSinceEpoch; +}; + +// For GetCapabilities() +struct MFCDMMediaCapability { + nsString contentType; + nsString robustness; +}; + +struct MFCDMCapabilitiesIPDL { + nsString keySystem; + nsString[] initDataTypes; + MFCDMMediaCapability[] audioCapabilities; + MFCDMMediaCapability[] videoCapabilities; + SessionType[] sessionTypes; + CryptoScheme[] encryptionSchemes; + Requirement distinctiveID; + Requirement persistentState; + bool isHDCP22Compatible; +}; + +union MFCDMCapabilitiesResult { + nsresult; + MFCDMCapabilitiesIPDL; +}; + +// For Init() +struct MFCDMInitParamsIPDL { + nsString origin; + nsString[] initDataTypes; + Requirement distinctiveID; + Requirement persistentState; + MFCDMMediaCapability[] audioCapabilities; + MFCDMMediaCapability[] videoCapabilities; +}; + +struct MFCDMInitIPDL { + uint64_t id; +}; + +union MFCDMInitResult { + nsresult; + MFCDMInitIPDL; +}; + +struct MFCDMCreateSessionParamsIPDL { + SessionType sessionType; + nsString initDataType; + uint8_t[] initData; +}; + +union MFCDMSessionResult { + nsString; + nsresult; +}; + +[ManualDealloc] +async protocol PMFCDM +{ + manager PRemoteDecoderManager; +parent: + async GetCapabilities(bool isHwSecured) returns (MFCDMCapabilitiesResult result); + async Init(MFCDMInitParamsIPDL params) returns (MFCDMInitResult result); + async CreateSessionAndGenerateRequest(MFCDMCreateSessionParamsIPDL type) + returns (MFCDMSessionResult result); + async LoadSession(SessionType sessionType, nsString sessionId) returns (nsresult result); + async UpdateSession(nsString sessionId, uint8_t[] response) returns (nsresult result); + async CloseSession(nsString sessionId) returns (nsresult result); + async RemoveSession(nsString sessionId) returns (nsresult result); + async SetServerCertificate(uint8_t[] certificate) returns (nsresult result); + async GetStatusForPolicy(HDCPVersion minHdcpVersion) returns (nsresult result); + async __delete__(); + +child: + async OnSessionKeyMessage(MFCDMKeyMessage message); + async OnSessionKeyStatusesChanged(MFCDMKeyStatusChange keystatuses); + async OnSessionKeyExpiration(MFCDMKeyExpiration expiration); +}; + +} // namespace mozilla |