nsresult GMPParent::GetGMPVideoEncoder(GMPVideoEncoderParent** aGMPVE) { MOZ_ASSERT(GMPThread() == NS_GetCurrentThread()); if (!EnsureProcessLoaded()) { return NS_ERROR_FAILURE; } // returned with one anonymous AddRef that locks it until Destroy PGMPVideoEncoderParent* pvep = SendPGMPVideoEncoderConstructor(); if (!pvep) { return NS_ERROR_FAILURE; } GMPVideoEncoderParent *vep = static_cast<GMPVideoEncoderParent*>(pvep); *aGMPVE = vep; mVideoEncoders.AppendElement(vep); return NS_OK; }
nsresult GMPParent::GetGMPDecryptor(GMPDecryptorParent** aGMPDP) { MOZ_ASSERT(GMPThread() == NS_GetCurrentThread()); if (!EnsureProcessLoaded()) { return NS_ERROR_FAILURE; } PGMPDecryptorParent* pdp = SendPGMPDecryptorConstructor(); if (!pdp) { return NS_ERROR_FAILURE; } GMPDecryptorParent* dp = static_cast<GMPDecryptorParent*>(pdp); // This addref corresponds to the Proxy pointer the consumer is returned. // It's dropped by calling Close() on the interface. NS_ADDREF(dp); mDecryptors.AppendElement(dp); *aGMPDP = dp; return NS_OK; }
nsresult GMPParent::GetGMPVideoEncoder(GMPVideoEncoderParent** aGMPVE) { MOZ_ASSERT(GMPThread() == NS_GetCurrentThread()); if (!EnsureProcessLoaded()) { return NS_ERROR_FAILURE; } // returned with one anonymous AddRef that locks it until Destroy PGMPVideoEncoderParent* pvep = SendPGMPVideoEncoderConstructor(); if (!pvep) { return NS_ERROR_FAILURE; } GMPVideoEncoderParent *vep = static_cast<GMPVideoEncoderParent*>(pvep); // This addref corresponds to the Proxy pointer the consumer is returned. // It's dropped by calling Close() on the interface. NS_ADDREF(vep); *aGMPVE = vep; mVideoEncoders.AppendElement(vep); return NS_OK; }