예제 #1
0
 /**
  * Checks whether there are packets with sequence numbers between <tt>firstSeq</tt> and
  * <tt>lastSeq</tt> which are *not* stored in <tt>data</tt>.
  *
  * @return <tt>true</tt> if there are packets with sequence numbers between <tt>firstSeq</tt> and
  *     <tt>lastSeq</tt> which are *not* stored in <tt>data</tt>.
  */
 private boolean haveMissing() {
   Set<Long> seqs = data.keySet();
   long s = firstSeq;
   while (s != lastSeq) {
     if (!seqs.contains(s)) return true;
     s = (s + 1) % (1 << 16);
   }
   return false;
 }
예제 #2
0
 private void handleRtpPacket(RawPacket pkt) {
   if (pkt != null && pkt.getPayloadType() == vp8PayloadType) {
     int ssrc = pkt.getSSRC();
     if (!activeVideoSsrcs.contains(ssrc & 0xffffffffL)) {
       synchronized (activeVideoSsrcs) {
         if (!activeVideoSsrcs.contains(ssrc & 0xffffffffL)) {
           activeVideoSsrcs.add(ssrc & 0xffffffffL);
           rtcpFeedbackSender.sendFIR(ssrc);
         }
       }
     }
   }
 }
예제 #3
0
 private void nudge() {
   for (Iterator<RecorderEvent> iter = pendingEvents.iterator(); iter.hasNext(); ) {
     RecorderEvent ev = iter.next();
     long instant = getSynchronizer().getLocalTime(ev.getSsrc(), ev.getRtpTimestamp());
     if (instant != -1) {
       iter.remove();
       ev.setInstant(instant);
       handler.handleEvent(ev);
     }
   }
 }
예제 #4
0
 @Override
 public boolean handleEvent(RecorderEvent ev) {
   if (ev == null) return true;
   if (RecorderEvent.Type.RECORDING_STARTED.equals(ev.getType())) {
     long instant = getSynchronizer().getLocalTime(ev.getSsrc(), ev.getRtpTimestamp());
     if (instant != -1) {
       ev.setInstant(instant);
       return handler.handleEvent(ev);
     } else {
       pendingEvents.add(ev);
       return true;
     }
   }
   return handler.handleEvent(ev);
 }