[Live-devel] low latency transmit

Yu, Bo BYu at drs-rsta.com
Tue Apr 23 06:46:06 PDT 2013


Hi,

Can MultiFramedRTPSink::sendPacketIfNecessary() be enhanced safely with the following code ? I would like to transmit all packets within one video frame as soon as possible instead of scheduling packet one by one ? uSecondsToGo gets 1 usec but cause the schedule to run and actually add a lot of latency between packets.



if (fNoFramesLeft) {

    // We're done:

    onSourceClosure(this);

  } else {



    if (fOutBuf->haveOverflowData()) {

            sendNext(this);

    }

    else {



    // We have more frames left to send.  Figure out when the next frame

    // is due to start playing, then make sure that we wait this long before

    // sending the next packet.

    struct timeval timeNow;

    gettimeofday(&timeNow, NULL);

    int secsDiff = fNextSendTime.tv_sec - timeNow.tv_sec;

    int64_t uSecondsToGo = secsDiff*1000000 + (fNextSendTime.tv_usec - timeNow.tv_usec);

    if (uSecondsToGo < 0 || secsDiff < 0) { // sanity check: Make sure that the time-to-delay is non-negative:

      uSecondsToGo = 0;

    }



    // Delay this amount of time:

    nextTask() = envir().taskScheduler().scheduleDelayedTask(uSecondsToGo, (TaskFunc*)sendNext, this);

    }



  }


Bo



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130423/9d4216db/attachment-0001.html>


More information about the live-devel mailing list