diff options
Diffstat (limited to '')
-rw-r--r-- | dom/media/ipc/PMFCDM.ipdl | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/dom/media/ipc/PMFCDM.ipdl b/dom/media/ipc/PMFCDM.ipdl new file mode 100644 index 0000000000..4502fde97a --- /dev/null +++ b/dom/media/ipc/PMFCDM.ipdl @@ -0,0 +1,116 @@ +/* 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"; + +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; +}; + +union MFCDMCapabilitiesResult { + nsresult; + MFCDMCapabilitiesIPDL; +}; + +// For Init() +struct MFCDMInitParamsIPDL { + nsString origin; + nsString[] initDataTypes; + Requirement distinctiveID; + Requirement persistentState; + bool hwSecure; +}; + +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() 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 __delete__(); + +child: + async OnSessionKeyMessage(MFCDMKeyMessage message); + async OnSessionKeyStatusesChanged(MFCDMKeyStatusChange keystatuses); + async OnSessionKeyExpiration(MFCDMKeyExpiration expiration); +}; + +} // namespace mozilla |