sample/vs_android.cc
/**
 * See the C method errorCallback at the top of this file
 */
See the C method errorCallback at the top of this file
See the C method errorCallback at the top of this file
void VsAndroidCapture::errorCallback(AAudioStream *stream,
                                    aaudio_result_t error) {
  LOGI("errorCallback has result: %s", AAudio_convertResultToText(error));
  aaudio_stream_state_t streamState = AAudioStream_getState(stream);
  if (streamState == AAUDIO_STREAM_STATE_DISCONNECTED) {
    std::function<void(void)> restartStreams = std::bind(&VsAndroidCapture::restartStreams, this);
    std::thread streamRestartThread(restartStreams);
    streamRestartThread.detach();
  }
}
void VsAndroidCapture :: errorCallback ( AAudioStream * stream , aaudio_result_t error ) { LOGI ( " " , AAudio_convertResultToText ( error ) ) ; aaudio_stream_state_t streamState = AAudioStream_getState ( stream ) ; if ( streamState == AAUDIO_STREAM_STATE_DISCONNECTED ) { std :: function < void ( void ) > restartStreams = std :: bind ( & VsAndroidCapture :: restartStreams , this ) ; std :: thread streamRestartThread ( restartStreams ) ; streamRestartThread . detach ( ) ; } }
See the C method errorCallback at the top of this file
See the C method errorCallback at the top of this file
// Handle stream restart on a separate thread