зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1338924 - Pass duration of sample being decrypted to CDM. r=gerald
MozReview-Commit-ID: 3UujuYPpfJi
This commit is contained in:
Родитель
3640aa2a00
Коммит
4c05a6c492
|
@ -63,7 +63,8 @@ public:
|
|||
}
|
||||
|
||||
void Decrypt(GMPBuffer* aBuffer,
|
||||
GMPEncryptedBufferMetadata* aMetadata) override
|
||||
GMPEncryptedBufferMetadata* aMetadata,
|
||||
uint64_t aDurationUses) override
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -712,7 +712,7 @@ GMPCDMProxy::gmp_Decrypt(RefPtr<DecryptJob> aJob)
|
|||
aJob->mId = ++mDecryptionJobCount;
|
||||
nsTArray<uint8_t> data;
|
||||
data.AppendElements(aJob->mSample->Data(), aJob->mSample->Size());
|
||||
mCDM->Decrypt(aJob->mId, aJob->mSample->mCrypto, data);
|
||||
mCDM->Decrypt(aJob->mId, aJob->mSample->mCrypto, data, aJob->mSample->mDuration);
|
||||
mDecryptionJobs.AppendElement(aJob.forget());
|
||||
}
|
||||
|
||||
|
|
|
@ -332,7 +332,8 @@ GMPDecryptorChild::RecvSetServerCertificate(const uint32_t& aPromiseId,
|
|||
mozilla::ipc::IPCResult
|
||||
GMPDecryptorChild::RecvDecrypt(const uint32_t& aId,
|
||||
InfallibleTArray<uint8_t>&& aBuffer,
|
||||
const GMPDecryptionData& aMetadata)
|
||||
const GMPDecryptionData& aMetadata,
|
||||
const uint64_t& aDurationUsecs)
|
||||
{
|
||||
if (!mSession) {
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
|
@ -346,7 +347,7 @@ GMPDecryptorChild::RecvDecrypt(const uint32_t& aId,
|
|||
GMPEncryptedBufferDataImpl* metadata = new GMPEncryptedBufferDataImpl(aMetadata);
|
||||
buffer->SetMetadata(metadata);
|
||||
|
||||
mSession->Decrypt(buffer, metadata);
|
||||
mSession->Decrypt(buffer, metadata, aDurationUsecs);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,8 @@ private:
|
|||
|
||||
mozilla::ipc::IPCResult RecvDecrypt(const uint32_t& aId,
|
||||
InfallibleTArray<uint8_t>&& aBuffer,
|
||||
const GMPDecryptionData& aMetadata) override;
|
||||
const GMPDecryptionData& aMetadata,
|
||||
const uint64_t& aDurationUsecs) override;
|
||||
|
||||
// Resolve/reject promise on completion.
|
||||
mozilla::ipc::IPCResult RecvSetServerCertificate(const uint32_t& aPromiseId,
|
||||
|
|
|
@ -172,7 +172,8 @@ GMPDecryptorParent::SetServerCertificate(uint32_t aPromiseId,
|
|||
void
|
||||
GMPDecryptorParent::Decrypt(uint32_t aId,
|
||||
const CryptoSample& aCrypto,
|
||||
const nsTArray<uint8_t>& aBuffer)
|
||||
const nsTArray<uint8_t>& aBuffer,
|
||||
uint64_t aDurationUsecs)
|
||||
{
|
||||
LOGV(("GMPDecryptorParent[%p]::Decrypt(id=%d)", this, aId));
|
||||
|
||||
|
@ -191,10 +192,10 @@ GMPDecryptorParent::Decrypt(uint32_t aId,
|
|||
aCrypto.mEncryptedSizes,
|
||||
aCrypto.mSessionIds);
|
||||
|
||||
Unused << SendDecrypt(aId, aBuffer, data);
|
||||
Unused << SendDecrypt(aId, aBuffer, data, aDurationUsecs);
|
||||
} else {
|
||||
GMPDecryptionData data;
|
||||
Unused << SendDecrypt(aId, aBuffer, data);
|
||||
Unused << SendDecrypt(aId, aBuffer, data, aDurationUsecs);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,8 @@ public:
|
|||
|
||||
void Decrypt(uint32_t aId,
|
||||
const CryptoSample& aCrypto,
|
||||
const nsTArray<uint8_t>& aBuffer) override;
|
||||
const nsTArray<uint8_t>& aBuffer,
|
||||
uint64_t aDurationUsecs) override;
|
||||
|
||||
void Close() override;
|
||||
|
||||
|
|
|
@ -55,7 +55,8 @@ public:
|
|||
|
||||
virtual void Decrypt(uint32_t aId,
|
||||
const mozilla::CryptoSample& aCrypto,
|
||||
const nsTArray<uint8_t>& aBuffer) = 0;
|
||||
const nsTArray<uint8_t>& aBuffer,
|
||||
uint64_t aDurationUsecs) = 0;
|
||||
|
||||
virtual void Close() = 0;
|
||||
};
|
||||
|
|
|
@ -46,7 +46,8 @@ child:
|
|||
|
||||
async Decrypt(uint32_t aId,
|
||||
uint8_t[] aBuffer,
|
||||
GMPDecryptionData aMetadata);
|
||||
GMPDecryptionData aMetadata,
|
||||
uint64_t aDurationUsecs);
|
||||
|
||||
async DecryptingComplete();
|
||||
|
||||
|
|
|
@ -324,7 +324,8 @@ public:
|
|||
// is deleted. Don't forget to call Decrypted(), as otherwise aBuffer's
|
||||
// memory will leak!
|
||||
virtual void Decrypt(GMPBuffer* aBuffer,
|
||||
GMPEncryptedBufferMetadata* aMetadata) = 0;
|
||||
GMPEncryptedBufferMetadata* aMetadata,
|
||||
uint64_t aDurationUsecs) = 0;
|
||||
|
||||
// Called when the decryption operations are complete.
|
||||
// Do not call the GMPDecryptorCallback's functions after this is called.
|
||||
|
|
|
@ -198,7 +198,8 @@ private:
|
|||
|
||||
void
|
||||
WidevineDecryptor::Decrypt(GMPBuffer* aBuffer,
|
||||
GMPEncryptedBufferMetadata* aMetadata)
|
||||
GMPEncryptedBufferMetadata* aMetadata,
|
||||
uint64_t aDurationUsecs)
|
||||
{
|
||||
if (!mCallback) {
|
||||
Log("WidevineDecryptor::Decrypt() this=%p FAIL; !mCallback", this);
|
||||
|
|
|
@ -64,7 +64,8 @@ public:
|
|||
uint32_t aServerCertSize) override;
|
||||
|
||||
void Decrypt(GMPBuffer* aBuffer,
|
||||
GMPEncryptedBufferMetadata* aMetadata) override;
|
||||
GMPEncryptedBufferMetadata* aMetadata,
|
||||
uint64_t aDurationUsecs) override;
|
||||
|
||||
void DecryptingComplete() override;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче