public final class RTPFramer extends Object implements Framer<TransportPacket,RtpPacket>
| Constructor and Description |
|---|
RTPFramer() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(Buffer data)
There is no real good test to make sure that the data indeed is an RTP packet.
|
RtpPacket |
frame(TransportPacket parent,
Buffer buffer)
Ask the framer to frame the buffer into a packet.
|
Protocol |
getProtocol() |
public Protocol getProtocol()
getProtocol in interface Framer<TransportPacket,RtpPacket>public boolean accept(Buffer data) throws IOException
Framer will read a few bytes in an effort to
figure out if the incoming data may be something it recognizes. E.g., a
HTTP Framer could check if the first bytes match "GET", "POST",
"PUT" and "DELETE" if if so assume that the payload indeed is HTTP and
therefore return true. Of course, you may never really know until you
actually have parsed the entire body but this method should return quick
and if turns out that the data isn't what it thought, throw an exception
and the framework will take care of it.accept in interface Framer<TransportPacket,RtpPacket>data - the data to check whether it could be a frame of this typeIOExceptionpublic RtpPacket frame(TransportPacket parent, Buffer buffer) throws IOException
FramerPacket has not been parsed, just framed.frame in interface Framer<TransportPacket,RtpPacket>parent - the parent frame or null if the frame doesn't have one.buffer - the buffer containing all the raw dataIOException - in case something goes wrong when reading data from the
bufferCopyright © 2021. All Rights Reserved.