Bug 1306314 - Pipe decryptor ID through to WidevineAdapter. r=gerald

MozReview-Commit-ID: HqRoImDhuFl

--HG--
extra : rebase_source : 7c8459af145e948a15eade34a842df92184353d4
This commit is contained in:
Chris Pearce 2016-11-11 14:55:56 +13:00
Родитель 5926bef365
Коммит 7af167a212
7 изменённых файлов: 31 добавлений и 13 удалений

Просмотреть файл

@ -277,12 +277,15 @@ GMPChild::RecvSetNodeId(const nsCString& aNodeId)
}
GMPErr
GMPChild::GetAPI(const char* aAPIName, void* aHostAPI, void** aPluginAPI)
GMPChild::GetAPI(const char* aAPIName,
void* aHostAPI,
void** aPluginAPI,
uint32_t aDecryptorId)
{
if (!mGMPLoader) {
return GMPGenericErr;
}
return mGMPLoader->GetAPI(aAPIName, aHostAPI, aPluginAPI);
return mGMPLoader->GetAPI(aAPIName, aHostAPI, aPluginAPI, aDecryptorId);
}
bool

Просмотреть файл

@ -76,7 +76,7 @@ private:
void ActorDestroy(ActorDestroyReason aWhy) override;
void ProcessingError(Result aCode, const char* aReason) override;
GMPErr GetAPI(const char* aAPIName, void* aHostAPI, void** aPluginAPI);
GMPErr GetAPI(const char* aAPIName, void* aHostAPI, void** aPluginAPI, uint32_t aDecryptorId = 0);
nsTArray<UniquePtr<GMPContentChild>> mGMPContentChildren;

Просмотреть файл

@ -206,7 +206,7 @@ GMPContentChild::RecvPGMPDecryptorConstructor(PGMPDecryptorChild* aActor)
GMPDecryptorHost* host = static_cast<GMPDecryptorHost*>(child);
void* ptr = nullptr;
GMPErr err = mGMPChild->GetAPI(GMP_API_DECRYPTOR, host, &ptr);
GMPErr err = mGMPChild->GetAPI(GMP_API_DECRYPTOR, host, &ptr, aActor->Id());
GMPDecryptor* decryptor = nullptr;
if (GMP_SUCCEEDED(err) && ptr) {
decryptor = static_cast<GMPDecryptor*>(ptr);
@ -250,7 +250,7 @@ GMPContentChild::RecvPGMPVideoDecoderConstructor(PGMPVideoDecoderChild* aActor,
auto vdc = static_cast<GMPVideoDecoderChild*>(aActor);
void* vd = nullptr;
GMPErr err = mGMPChild->GetAPI(GMP_API_VIDEO_DECODER, &vdc->Host(), &vd);
GMPErr err = mGMPChild->GetAPI(GMP_API_VIDEO_DECODER, &vdc->Host(), &vd, aDecryptorId);
if (err != GMPNoErr || !vd) {
NS_WARNING("GMPGetAPI call failed trying to construct decoder.");
return false;

Просмотреть файл

@ -39,7 +39,8 @@ public:
GMPErr GetAPI(const char* aAPIName,
void* aHostAPI,
void** aPluginAPI) override;
void** aPluginAPI,
uint32_t aDecryptorId) override;
void Shutdown() override;
@ -80,7 +81,10 @@ public:
return initFunc(aPlatformAPI);
}
GMPErr GMPGetAPI(const char* aAPIName, void* aHostAPI, void** aPluginAPI) override
GMPErr GMPGetAPI(const char* aAPIName,
void* aHostAPI,
void** aPluginAPI,
uint32_t aDecryptorId) override
{
if (!mLib) {
return GMPGenericErr;
@ -190,9 +194,10 @@ GMPLoaderImpl::Load(const char* aUTF8LibPath,
GMPErr
GMPLoaderImpl::GetAPI(const char* aAPIName,
void* aHostAPI,
void** aPluginAPI)
void** aPluginAPI,
uint32_t aDecryptorId)
{
return mAdapter->GMPGetAPI(aAPIName, aHostAPI, aPluginAPI);
return mAdapter->GMPGetAPI(aAPIName, aHostAPI, aPluginAPI, aDecryptorId);
}
void

Просмотреть файл

@ -42,7 +42,10 @@ public:
// These are called in place of the corresponding GMP API functions.
virtual GMPErr GMPInit(const GMPPlatformAPI* aPlatformAPI) = 0;
virtual GMPErr GMPGetAPI(const char* aAPIName, void* aHostAPI, void** aPluginAPI) = 0;
virtual GMPErr GMPGetAPI(const char* aAPIName,
void* aHostAPI,
void** aPluginAPI,
uint32_t aDecryptorId) = 0;
virtual void GMPShutdown() = 0;
virtual void GMPSetNodeId(const char* aNodeId, uint32_t aLength) = 0;
};
@ -83,7 +86,10 @@ public:
GMPAdapter* aAdapter = nullptr) = 0;
// Retrieves an interface pointer from the GMP.
virtual GMPErr GetAPI(const char* aAPIName, void* aHostAPI, void** aPluginAPI) = 0;
virtual GMPErr GetAPI(const char* aAPIName,
void* aHostAPI,
void** aPluginAPI,
uint32_t aDecryptorId) = 0;
// Calls the GMPShutdown function exported by the GMP lib, and unloads the
// plugin library.

Просмотреть файл

@ -88,7 +88,8 @@ WidevineAdapter::GMPInit(const GMPPlatformAPI* aPlatformAPI)
GMPErr
WidevineAdapter::GMPGetAPI(const char* aAPIName,
void* aHostAPI,
void** aPluginAPI)
void** aPluginAPI,
uint32_t aDecryptorId)
{
Log("WidevineAdapter::GMPGetAPI(%s, 0x%p, 0x%p) this=0x%p",
aAPIName, aHostAPI, aPluginAPI, this);

Просмотреть файл

@ -21,7 +21,10 @@ public:
// These are called in place of the corresponding GMP API functions.
GMPErr GMPInit(const GMPPlatformAPI* aPlatformAPI) override;
GMPErr GMPGetAPI(const char* aAPIName, void* aHostAPI, void** aPluginAPI) override;
GMPErr GMPGetAPI(const char* aAPIName,
void* aHostAPI,
void** aPluginAPI,
uint32_t aDecryptorId) override;
void GMPShutdown() override;
void GMPSetNodeId(const char* aNodeId, uint32_t aLength) override;