/** Method that destroy the references of this class */
  public void recycle() {
    // Destroy the media discovery task
    mPictureDiscoverer.recycle();
    synchronized (mEffectsSync) {
      if (mEffects != null) {
        mEffects.release();
      }
      if (mBorders != null) {
        mBorders.release();
      }
    }

    // Destroy the background task
    if (mBackgroundTask != null) {
      mBackgroundTask.mRun = false;
      try {
        synchronized (mBackgroundTask.mLoadSync) {
          mBackgroundTask.interrupt();
        }
      } catch (Exception e) {
        // Ignore
      }
    }
    mBackgroundTask = null;
  }
 /**
  * Method that update the effect context if the EGL context change
  *
  * @param effectCtx The new effect context
  */
 public void updateEffectContext(final EffectContext effectCtx) {
   synchronized (mEffectsSync) {
     if (mEffects != null) {
       mEffects.release();
       mEffects = null;
     }
     mEffects = new Effects(mContext, effectCtx);
     if (mBorders != null) {
       mBorders.release();
       mBorders = null;
     }
     mBorders = new Borders(mContext, effectCtx);
   }
   emptyTextureQueue(true);
 }