// Note: Consider keeping ActorDestroy sync'd up when making changes here.
void
GMPVideoEncoderParent::Shutdown()
{
    LOGD(("%s::%s: %p", __CLASS__, __FUNCTION__, this));
    MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread());

    // Notify client we're gone!  Won't occur after Close()
    if (mCallback) {
        mCallback->Terminated();
        mCallback = nullptr;
    }
    mVideoHost.DoneWithAPI();
    if (mIsOpen) {
        // Don't send EncodingComplete if we died
        mIsOpen = false;
        unused << SendEncodingComplete();
    }
}
// Note: Consider keeping ActorDestroy sync'd up when making changes here.
void
GMPVideoEncoderParent::Shutdown()
{
  LOGD(("%s::%s: %p", __CLASS__, __FUNCTION__, this));
  MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread());

  if (mShuttingDown) {
    return;
  }
  mShuttingDown = true;

  // Notify client we're gone!  Won't occur after Close()
  if (mCallback) {
    mCallback->Terminated();
    mCallback = nullptr;
  }

  mIsOpen = false;
  if (!mActorDestroyed) {
    Unused << SendEncodingComplete();
  }
}