PChromiumCDM.ipdl (3981B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 include protocol PGMPContent; 7 include GMPTypes; 8 9 include "GMPMessageUtils.h"; 10 include "ChromiumCDMParent.h"; 11 12 using cdm::HdcpVersion from "GMPSanitizedExports.h"; 13 14 namespace mozilla { 15 namespace gmp { 16 17 [ChildImpl=virtual, ParentImpl="ChromiumCDMParent"] 18 async protocol PChromiumCDM 19 { 20 manager PGMPContent; 21 child: 22 23 // cdm::ContentDecryptionModule_10 24 async Init(bool aAllowDistinctiveIdentifier, 25 bool aAllowPersistentState) returns (bool aSuccess); 26 27 async GetStatusForPolicy(uint32_t aPromiseId, 28 HdcpVersion aMinHdcpVersion); 29 30 async SetServerCertificate(uint32_t aPromiseId, 31 uint8_t[] aServerCert); 32 33 async CreateSessionAndGenerateRequest(uint32_t aPromiseId, 34 uint32_t aSessionType, 35 uint32_t aInitDataType, 36 uint8_t[] aInitData); 37 38 async LoadSession(uint32_t aPromiseId, 39 uint32_t aSessionType, 40 nsCString aSessionId); 41 42 async UpdateSession(uint32_t aPromiseId, 43 nsCString aSessionId, 44 uint8_t[] aResponse); 45 46 async CloseSession(uint32_t aPromiseId, 47 nsCString aSessionId); 48 49 async RemoveSession(uint32_t aPromiseId, 50 nsCString aSessionId); 51 52 // This is called after the parent has verified the protection status and 53 // round tripped the call back to the child. 54 async CompleteQueryOutputProtectionStatus(bool aSuccess, 55 uint32_t aLinkMask, 56 uint32_t aProtectionMask); 57 58 async Decrypt(uint32_t aId, CDMInputBuffer aBuffer); 59 60 async InitializeVideoDecoder(CDMVideoDecoderConfig aConfig); 61 62 async DeinitializeVideoDecoder(); 63 64 async ResetVideoDecoder(); 65 66 async DecryptAndDecodeFrame(CDMInputBuffer aBuffer); 67 68 async Drain(); 69 70 async Destroy(); 71 72 async GiveBuffer(Shmem aShmem); 73 74 async PurgeShmems(); 75 76 77 parent: 78 async __delete__(); 79 80 // cdm::Host_11 81 async OnResolvePromiseWithKeyStatus(uint32_t aPromiseId, uint32_t aKeyStatus); 82 83 async OnResolveNewSessionPromise(uint32_t aPromiseId, nsCString aSessionId); 84 85 async OnResolvePromise(uint32_t aPromiseId); 86 87 async OnRejectPromise(uint32_t aPromiseId, 88 uint32_t aException, 89 uint32_t aSystemCode, 90 nsCString aErrorMessage); 91 92 async OnSessionMessage(nsCString aSessionId, 93 uint32_t aMessageType, 94 uint8_t[] aMessage); 95 96 async OnSessionKeysChange(nsCString aSessionId, 97 CDMKeyInformation[] aKeysInfo); 98 99 async OnExpirationChange(nsCString aSessionId, 100 double aSecondsSinceEpoch); 101 102 async OnSessionClosed(nsCString aSessionId); 103 104 async OnQueryOutputProtectionStatus(); 105 106 async ResolveLoadSessionPromise(uint32_t aPromiseId, bool aSuccessful); 107 108 // Return values of cdm::ContentDecryptionModule_10::Decrypt 109 async DecryptedShmem(uint32_t aId, uint32_t aStatus, Shmem aData); 110 async DecryptedData(uint32_t aId, uint32_t aStatus, uint8_t[] aData); 111 async DecryptFailed(uint32_t aId, uint32_t aStatus); 112 113 async OnDecoderInitDone(uint32_t aStatus); 114 115 // Return values of cdm::ContentDecryptionModule_10::DecryptAndDecodeFrame 116 async DecodedShmem(CDMVideoFrame aFrame, Shmem aData); 117 async DecodedData(CDMVideoFrame aFrame, uint8_t[] aData); 118 async DecodeFailed(uint32_t aStatus); 119 120 async ResetVideoDecoderComplete(); 121 122 async DrainComplete(); 123 124 async Shutdown(); 125 126 async IncreaseShmemPoolSize(); 127 }; 128 129 } // namespace gmp 130 } // namespace mozilla