Exemplo n.º 1
0
void
GMPDecryptorChild::Init(GMPDecryptor* aSession)
{
  MOZ_ASSERT(aSession);
  mSession = aSession;
  // The ID of this decryptor is the IPDL actor ID. Note it's unique inside
  // the child process, but not necessarily across all gecko processes. However,
  // since GMPDecryptors are segregated by node ID/origin, we shouldn't end up
  // with clashes in the content process.
  SendSetDecryptorId(DecryptorId());
}
Exemplo n.º 2
0
RefPtr<MediaDataDecoder::InitPromise>
GMPVideoDecoder::Init()
{
  MOZ_ASSERT(IsOnGMPThread());

  mMPS = do_GetService("@mozilla.org/gecko-media-plugin-service;1");
  MOZ_ASSERT(mMPS);

  RefPtr<InitPromise> promise(mInitPromise.Ensure(__func__));

  nsTArray<nsCString> tags;
  InitTags(tags);
  UniquePtr<GetGMPVideoDecoderCallback> callback(new GMPInitDoneCallback(this));
  if (NS_FAILED(mMPS->GetDecryptingGMPVideoDecoder(mCrashHelper,
                                                   &tags,
                                                   GetNodeId(),
                                                   std::move(callback),
                                                   DecryptorId()))) {
    mInitPromise.Reject(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
  }

  return promise;
}