Exemplo n.º 1
0
void shutdown(int exitCode)
{
    if (areAlreadyShuttingDown) return; // in case we're called after receiving a RTCP "BYE" while in the middle of a "TEARDOWN".
    areAlreadyShuttingDown = True;
    
    shutdownExitCode = exitCode;
    if (env != NULL)
    {
        env->taskScheduler().unscheduleDelayedTask(sessionTimerTask);
        env->taskScheduler().unscheduleDelayedTask(arrivalCheckTimerTask);
        env->taskScheduler().unscheduleDelayedTask(interPacketGapCheckTimerTask);
        env->taskScheduler().unscheduleDelayedTask(qosMeasurementTimerTask);
    }
    
    if (qosMeasurementIntervalMS > 0)
    {
        printQOSData(exitCode);
    }
    
    // Teardown, then shutdown, any outstanding RTP/RTCP subsessions
    if (session != NULL) {
        tearDownSession(session, continueAfterTEARDOWN);
    } else {
        continueAfterTEARDOWN(NULL, 0, NULL);
    }
}
Exemplo n.º 2
0
void shutdown(int exitCode) {
  if (env != NULL) {
    env->taskScheduler().unscheduleDelayedTask(sessionTimerTask);
    env->taskScheduler().unscheduleDelayedTask(arrivalCheckTimerTask);
    env->taskScheduler().unscheduleDelayedTask(interPacketGapCheckTimerTask);
    env->taskScheduler().unscheduleDelayedTask(qosMeasurementTimerTask);
  }

  if (qosMeasurementIntervalMS > 0) {
    printQOSData(exitCode);
  }

  // Close our output files:
  closeMediaSinks();

  // Teardown, then shutdown, any outstanding RTP/RTCP subsessions
  tearDownStreams();
  Medium::close(session);

  // Finally, shut down our client:
  Medium::close(ourClient);

  // Adios...
  exit(exitCode);
}
Exemplo n.º 3
0
void shutdown(int exitCode) {
  if (areAlreadyShuttingDown) return; // in case we're called after receiving a RTCP "BYE" while in the middle of a "TEARDOWN".
  areAlreadyShuttingDown = True;

  shutdownExitCode = exitCode;
  if (env != NULL) {
    env->taskScheduler().unscheduleDelayedTask(sessionTimerTask);
    env->taskScheduler().unscheduleDelayedTask(arrivalCheckTimerTask);
    env->taskScheduler().unscheduleDelayedTask(interPacketGapCheckTimerTask);
    env->taskScheduler().unscheduleDelayedTask(qosMeasurementTimerTask);
  }

  if (qosMeasurementIntervalMS > 0) {
    printQOSData(exitCode);
  }

  // Teardown, then shutdown, any outstanding RTP/RTCP subsessions
  Boolean shutdownImmediately = True; // by default
  if (session != NULL) {
    RTSPClient::responseHandler* responseHandlerForTEARDOWN = NULL; // unless:
    if (waitForResponseToTEARDOWN) {
      shutdownImmediately = False;
      responseHandlerForTEARDOWN = continueAfterTEARDOWN;
    }
    tearDownSession(session, responseHandlerForTEARDOWN);
  }

  if (shutdownImmediately) continueAfterTEARDOWN(NULL, 0, NULL);
}
Exemplo n.º 4
0
bool CMediaNet::CloseRTSP()
{
	// 退出线程。	
	if ( m_pMediaNetThread && GetRtspStatus() != RTSPStatus_Idle )
	{
		m_runFlag = 1;
		int nStatus;
		SDL_WaitThread( m_pMediaNetThread, &nStatus );

		m_pMediaNetThread = 0;
		SetRtspStatus( RTSPStatus_Idle );
	}
	

	if (env != NULL) {
		env->taskScheduler().unscheduleDelayedTask(sessionTimerTask);
		env->taskScheduler().unscheduleDelayedTask(arrivalCheckTimerTask);
		env->taskScheduler().unscheduleDelayedTask(interPacketGapCheckTimerTask);
		env->taskScheduler().unscheduleDelayedTask(qosMeasurementTimerTask);
	}

	int exitCode = 0;
	if (qosMeasurementIntervalMS > 0) {
		printQOSData(exitCode);
	}

	// Close our output files:
	closeMediaSinks();

	// Teardown, then shutdown, any outstanding RTP/RTCP subsessions
	tearDownStreams();
	Medium::close(session);



	// Finally, shut down our client:
	Medium::close(ourClient);

	session = NULL;
	ourClient = NULL;

	if ( env )
	{
		delete &( env->taskScheduler() );
		env->reclaim();
	}	

	env = NULL;

	return true;
}
Exemplo n.º 5
0
void shutdown(int exitCode) {
  shutdownExitCode = exitCode;
  if (env != NULL) {
    env->taskScheduler().unscheduleDelayedTask(sessionTimerTask);
    env->taskScheduler().unscheduleDelayedTask(arrivalCheckTimerTask);
    env->taskScheduler().unscheduleDelayedTask(interPacketGapCheckTimerTask);
    env->taskScheduler().unscheduleDelayedTask(qosMeasurementTimerTask);
  }

  if (qosMeasurementIntervalMS > 0) {
    printQOSData(exitCode);
  }

  // Teardown, then shutdown, any outstanding RTP/RTCP subsessions
  if (session != NULL) {
    tearDownSession(session, continueAfterTEARDOWN);
  } else {
    continueAfterTEARDOWN(NULL, 0, NULL);
  }
}