示例#1
0
 /**
  * Handles and RTCP SDES packet.
  *
  * @param pkt the packet to handle.
  */
 private void addSDES(RawPacket pkt) {
   if (USE_CNAME_AS_ENDPOINT_ID) {
     for (CNAMEItem item : getCnameItems(pkt)) {
       SSRCDesc ssrc = getSSRCDesc(item.ssrc);
       if (ssrc.endpointId == null) {
         synchronized (ssrc) {
           if (ssrc.endpointId == null) ssrc.endpointId = item.cname;
         }
       }
     }
   }
 }
示例#2
0
 /**
  * Removes the RTP-NTP mapping for a given SSRC.
  *
  * @param ssrc the SSRC for which to remove the RTP-NTP mapping
  */
 void removeMapping(long ssrc) {
   if (ssrcs.containsKey(ssrc)) {
     synchronized (ssrcs) {
       SSRCDesc ssrcDesc = ssrcs.get(ssrc);
       if (ssrcDesc != null) {
         synchronized (ssrcDesc) {
           ssrcDesc.ntpTime = -1.0;
           ssrcDesc.rtpTime = -1;
         }
       }
     }
   }
 }
示例#3
0
  /** {@inheritDoc} */
  public void mapRtpToNtp(long ssrc, long rtpTime, double ntpTime) {
    SSRCDesc ssrcDesc = getSSRCDesc(ssrc);

    if (rtpTime != -1 && ntpTime != -1.0) // have valid values to update
    {
      if (ssrcDesc.rtpTime == -1 || ssrcDesc.ntpTime == -1.0) {
        synchronized (ssrcDesc) {
          if (ssrcDesc.rtpTime == -1 || ssrcDesc.ntpTime == -1.0) {
            ssrcDesc.rtpTime = rtpTime;
            ssrcDesc.ntpTime = ntpTime;
          }
        }
      }
    }
  }
示例#4
0
 /** {@inheritDoc} */
 @Override
 public void setRtpClockRate(long ssrc, long clockRate) {
   SSRCDesc ssrcDesc = getSSRCDesc(ssrc);
   if (ssrcDesc.clockRate == -1) {
     synchronized (ssrcDesc) {
       if (ssrcDesc.clockRate == -1) ssrcDesc.clockRate = clockRate;
       else if (ssrcDesc.clockRate != clockRate) {
         // this shouldn't happen...but if the clock rate really
         // changed for some reason, out timings are now irrelevant.
         ssrcDesc.clockRate = clockRate;
         ssrcDesc.ntpTime = -1.0;
         ssrcDesc.rtpTime = -1;
       }
     }
   }
 }
示例#5
0
 /** {@inheritDoc} */
 public void setEndpoint(long ssrc, String endpointId) {
   SSRCDesc ssrcDesc = getSSRCDesc(ssrc);
   synchronized (ssrcDesc) {
     ssrcDesc.endpointId = endpointId;
   }
 }