Source code
Revision control
Copy as Markdown
Other Tools
/* 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
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";
using mozilla::KeySystemConfigRequest from "mozilla/KeySystemConfig.h";
namespace mozilla {
// For EME spec 'message' event
struct MFCDMKeyMessage {
nsString sessionId;
MediaKeyMessageType type;
uint8_t[] message;
};
// For EME spec 'keystatuseschange' event
struct MFCDMKeyInformation {
uint8_t[] keyId;
MediaKeyStatus status;
};
struct MFCDMKeyStatusChange {
nsString sessionId;
MFCDMKeyInformation[] keyInfo;
};
// For EME spec Update Expiration algorithm
struct MFCDMKeyExpiration {
nsString sessionId;
double expiredTimeMilliSecondsSinceEpoch;
};
// For GetCapabilities()
struct MFCDMMediaCapability {
nsString contentType;
CryptoScheme[] encryptionSchemes;
nsString robustness;
};
struct MFCDMCapabilitiesIPDL {
nsString keySystem;
nsString[] initDataTypes;
MFCDMMediaCapability[] audioCapabilities;
MFCDMMediaCapability[] videoCapabilities;
SessionType[] sessionTypes;
Requirement distinctiveID;
Requirement persistentState;
bool? isHDCP22Compatible;
bool isHardwareDecryption;
};
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;
};
struct MFCDMCapabilitiesRequest {
nsString keySystem;
bool isHardwareDecryption;
bool isPrivateBrowsing;
};
[ManualDealloc]
async protocol PMFCDM
{
manager PRemoteDecoderManager;
parent:
async GetCapabilities(MFCDMCapabilitiesRequest request) 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