net.sf.fmj.media
Class SleepHelper
java.lang.Object
net.sf.fmj.media.SleepHelper
public class SleepHelper
- extends java.lang.Object
Helps calculate and sleep based on buffer timestamps; useful for rendering
media at the correct rate.
TODO: it is strange that we use this in the RendererNode (which calls the Renderer),
and in the RTPSyncBufferMux (but not in the MuxNode).
This implies that Multiplexers are responsible for timing but not Renderers.
This is perhaps a reasonable assumption, but needs to be checked against JMF.
- Author:
- Ken Larson
Field Summary |
static long |
MILLI_TO_NANO
The number of nanoseconds in a millisecond. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MILLI_TO_NANO
public static long MILLI_TO_NANO
- The number of nanoseconds in a millisecond.
SleepHelper
public SleepHelper()
reset
public void reset()
sleep
public void sleep(long currentTimestamp)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
calculateSleep
public long calculateSleep(long currentTimestamp)