Exemplo n.º 1
0
void RTCPInstance::onExpire1() {
  // Note: fTotSessionBW is kbits per second
  double rtcpBW = 0.05*fTotSessionBW*1024/8; // -> bytes per second

  OnExpire(this, // event
	   numMembers(), // members
	   (fSink != NULL) ? 1 : 0, // senders
	   rtcpBW, // rtcp_bw
	   (fSink != NULL) ? 1 : 0, // we_sent
	   &fAveRTCPSize, // ave_rtcp_size
	   &fIsInitial, // initial
	   dTimeNow(), // tc
	   &fPrevReportTime, // tp
	   &fPrevNumMembers // pmembers
	   );
}
Exemplo n.º 2
0
void RTCPInstance::schedule(double nextTime) {
	fNextReportTime = nextTime;

	double secondsToDelay = nextTime - dTimeNow();
	if (secondsToDelay < 0) secondsToDelay = 0;
#ifdef DEBUG
#ifdef __LINUX__
	fprintf(stderr, "schedule(%f->%f)\n", secondsToDelay, nextTime);
#else
	fprintf(stderr, "schedule(%ld->%ld) us\n", (int64_t)(secondsToDelay*1000000), (int64_t)(nextTime*1000000));
#endif
#endif
	int64_t usToGo = (int64_t)(secondsToDelay * 1000000);
	nextTask() = envir().taskScheduler().scheduleDelayedTask(usToGo,
			(TaskFunc*)RTCPInstance::onExpire, this);
}
Exemplo n.º 3
0
void RTCPInstance::onReceive(int typeOfPacket, int totPacketSize,
			     unsigned ssrc) {
  fTypeOfPacket = typeOfPacket;
  fLastReceivedSize = totPacketSize;
  fLastReceivedSSRC = ssrc;

  int members = (int)numMembers();
  int senders = (fSink != NULL) ? 1 : 0;

  OnReceive(this, // p
	    this, // e
	    &members, // members
	    &fPrevNumMembers, // pmembers
	    &senders, // senders
	    &fAveRTCPSize, // avg_rtcp_size
	    &fPrevReportTime, // tp
	    dTimeNow(), // tc
	    fNextReportTime);
}
Exemplo n.º 4
0
static void rtcp_on_expire(RtspdSession_t* session) 
{
	// Note: fTotSessionBW is kbits per second
	double rtcpBW = 0.05*session->total_session_bw*1024/8; // -> bytes per second

	//RTSPD_TRACE("OnExpire(%d)\n", session->avg_rtcp_size);

	OnExpire(session, // event
		   session->members, // members
		   session->senders, // senders
		   rtcpBW, // rtcp_bw
		   1 , // we_sent
		   &session->avg_rtcp_size, // ave_rtcp_size
		   &session->initial, // initial
		   dTimeNow(), // tc
		   &session->prev_report_time, // tp
		   &session->pmembers// pmembers
		   );
}