public class TransformTCPOutputStream extends RTPConnectorTCPOutputStream implements TransformOutputStream
PACKET_QUEUE_CAPACITY, POOL_CAPACITY, targets
Constructor and Description |
---|
TransformTCPOutputStream(java.net.Socket socket)
Initializes a new TransformTCPOutputStream which is to send
packet data out through a specific TCP socket.
|
Modifier and Type | Method and Description |
---|---|
PacketTransformer |
getTransformer()
Gets the
PacketTransformer used by this instance to transform
RawPacket s. |
protected RawPacket[] |
packetize(byte[] buf,
int off,
int len,
java.lang.Object context)
Creates a RawPacket element from a specific byte[]
buffer in order to have this instance send its packet data through its
RTPConnectorOutputStream.write(byte[], int, int) method. |
void |
setTransformer(PacketTransformer transformer)
Sets the
PacketTransformer to be used by this instance to
transform RawPacket s. |
doLogPacket, isSocketValid, sendToTarget
addTarget, close, getNumberOfBytesSent, getOutputBitrate, getOutputBitrate, getPacketLoggingService, logDroppedPacket, removeTarget, removeTargets, setEnabled, setMaxPacketsPerMillis, setPriority, syncWrite, write, write
public TransformTCPOutputStream(java.net.Socket socket)
socket
- the TCP socket used to send packet data outpublic PacketTransformer getTransformer()
PacketTransformer
used by this instance to transform
RawPacket
s.getTransformer
in interface TransformOutputStream
PacketTransformer
used by this instance to transform
RawPacket
sprotected RawPacket[] packetize(byte[] buf, int off, int len, java.lang.Object context)
RTPConnectorOutputStream.write(byte[], int, int)
method. Returns an array of one or more
elements, with the created RawPacket as its first element (and
null for all other elements)
Allows extenders to intercept the array and possibly filter and/or
modify it.
Transforms the array of RawPacket
s returned by the super
packetize(byte[],int,int,Object)
implementation using the
associated PacketTransformer
.packetize
in class RTPConnectorOutputStream
buf
- the packet data to be sent to the targets of this instance.
The contents of buf
starting at off
with the specified
len
is copied into the buffer of the returned RawPacket
.off
- the offset of the packet data in buflen
- the length of the packet data in bufcontext
- the Object
provided to
RTPConnectorOutputStream.write(byte[], int, int, java.lang.Object)
. The implementation of
RTPConnectorOutputStream
ignores the context
.public void setTransformer(PacketTransformer transformer)
PacketTransformer
to be used by this instance to
transform RawPacket
s.setTransformer
in interface TransformOutputStream
transformer
- the PacketTransformer
to be used by this
instance to transform RawPacket
s
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.