code: public void stopRecording() {
          if (mState != STATE.RECORDING)
              throw new IllegalArgumentException("StopRecording called in invalid state");
          mState = STATE.STOPPING;
          Log.i(TAG, "stopRecording");
          synchronized (mReadyForFrameFence) {
              mEosRequested = true;
          }
      }
docs: Stop recording. After this call you must call either {@link #release()} to release resources if you're not going to
  make any subsequent recordings, or {@link #reset(io.kickflip.sdk.av.SessionConfig)} to prepare
  the encoder for the next recording
  <p/>
  Called from UI thread