GMPErr GMPLoaderImpl::GetAPI(const char* aAPIName, void* aHostAPI, void** aPluginAPI) { return mGetAPIFunc ? mGetAPIFunc(aAPIName, aHostAPI, aPluginAPI) : GMPGenericErr; }
bool GMPChild::RecvPGMPVideoEncoderConstructor(PGMPVideoEncoderChild* aActor) { auto vec = static_cast<GMPVideoEncoderChild*>(aActor); void* ve = nullptr; GMPErr err = mGetAPIFunc("encode-video", &vec->Host(), &ve); if (err != GMPNoErr || !ve) { return false; } vec->Init(static_cast<GMPVideoEncoder*>(ve)); return true; }
bool GMPChild::RecvPGMPVideoDecoderConstructor(PGMPVideoDecoderChild* aActor) { auto vdc = static_cast<GMPVideoDecoderChild*>(aActor); void* vd = nullptr; GMPErr err = mGetAPIFunc("decode-video", &vdc->Host(), &vd); if (err != GMPNoErr || !vd) { return false; } vdc->Init(static_cast<GMPVideoDecoder*>(vd)); return true; }
bool GMPChild::RecvPGMPDecryptorConstructor(PGMPDecryptorChild* aActor) { GMPDecryptorChild* child = static_cast<GMPDecryptorChild*>(aActor); GMPDecryptorHost* host = static_cast<GMPDecryptorHost*>(child); void* session = nullptr; GMPErr err = mGetAPIFunc("eme-decrypt", host, &session); if (err != GMPNoErr || !session) { return false; } child->Init(static_cast<GMPDecryptor*>(session)); return true; }