|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.red5.server.stream.VideoFrameDropper
public class VideoFrameDropper
State machine for video frame dropping in live streams.
We start sending all frame types. Disposable interframes can be dropped any time without affecting the current state. If a regular interframe is dropped, all future frames up to the next keyframes are dropped as well. Dropped keyframes result in only keyframes being sent. If two consecutive keyframes have been successfully sent, regular interframes will be sent in the next iteration as well. If these frames all went through, disposable interframes are sent again.
So from highest to lowest bandwidth and back, the states go as follows:
Field Summary | |
---|---|
protected static Logger |
log
|
Fields inherited from interface org.red5.server.stream.IFrameDropper |
---|
SEND_ALL, SEND_INTERFRAMES, SEND_KEYFRAMES, SEND_KEYFRAMES_CHECK |
Constructor Summary | |
---|---|
VideoFrameDropper()
Constructs a new VideoFrameDropper. |
Method Summary | |
---|---|
boolean |
canSendPacket(RTMPMessage message,
long pending)
Checks if a message may be sent to the subscriber. |
void |
dropPacket(RTMPMessage message)
Notify that a packet has been dropped. |
void |
reset()
Reset the frame dropper. |
void |
reset(int state)
Reset the frame dropper to a given state. |
void |
sendPacket(RTMPMessage message)
Notify that a message has been sent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Logger log
Constructor Detail |
---|
public VideoFrameDropper()
Method Detail |
---|
public void reset()
reset
in interface IFrameDropper
public void reset(int state)
reset
in interface IFrameDropper
state
- the state to reset the frame dropper topublic boolean canSendPacket(RTMPMessage message, long pending)
canSendPacket
in interface IFrameDropper
message
- the message to checkpending
- the number of pending messages
true
if the packet may be sent, otherwise
false
public void dropPacket(RTMPMessage message)
dropPacket
in interface IFrameDropper
message
- the message that was droppedpublic void sendPacket(RTMPMessage message)
sendPacket
in interface IFrameDropper
message
- the message that was sent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |