Class TransformTCPOutputStream
- java.lang.Object
-
- org.jitsi.impl.neomedia.RTPConnectorOutputStream
-
- org.jitsi.impl.neomedia.RTPConnectorTCPOutputStream
-
- org.jitsi.impl.neomedia.transform.TransformTCPOutputStream
-
- All Implemented Interfaces:
javax.media.rtp.OutputDataStream,TransformOutputStream
public class TransformTCPOutputStream extends RTPConnectorTCPOutputStream implements TransformOutputStream
Extends RTPConnectorTCPOutputStream with transform logic. In this implementation, TCP socket is used to send the data out. When a normal RTP/RTCP packet is passed down from RTPManager, we first transform the packet using user define PacketTransformer and then send it out through network to all the stream targets.- Author:
- Bing SU (nova.su@gmail.com), Lubomir Marinov
-
-
Field Summary
-
Fields inherited from class org.jitsi.impl.neomedia.RTPConnectorOutputStream
PACKET_QUEUE_CAPACITY, POOL_CAPACITY, targets
-
-
Constructor Summary
Constructors Constructor Description TransformTCPOutputStream(Socket socket)Initializes a new TransformTCPOutputStream which is to send packet data out through a specific TCP socket.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PacketTransformergetTransformer()Gets thePacketTransformerused by this instance to transformRawPackets.protected RawPacket[]packetize(byte[] buf, int off, int len, Object context)Creates a RawPacket element from a specific byte[] buffer in order to have this instance send its packet data through itsRTPConnectorOutputStream.write(byte[], int, int)method.voidsetTransformer(PacketTransformer transformer)Sets thePacketTransformerto be used by this instance to transformRawPackets.-
Methods inherited from class org.jitsi.impl.neomedia.RTPConnectorTCPOutputStream
doLogPacket, isSocketValid, sendToTarget
-
Methods inherited from class org.jitsi.impl.neomedia.RTPConnectorOutputStream
addTarget, close, getNumberOfBytesSent, getOutputBitrate, getOutputBitrate, getPacketLoggingService, logDroppedPacket, removeTarget, removeTargets, setEnabled, setMaxPacketsPerMillis, setPriority, syncWrite, write, write
-
-
-
-
Constructor Detail
-
TransformTCPOutputStream
public TransformTCPOutputStream(Socket socket)
Initializes a new TransformTCPOutputStream which is to send packet data out through a specific TCP socket.- Parameters:
socket- the TCP socket used to send packet data out
-
-
Method Detail
-
getTransformer
public PacketTransformer getTransformer()
Gets thePacketTransformerused by this instance to transformRawPackets.- Specified by:
getTransformerin interfaceTransformOutputStream- Returns:
- the
PacketTransformerused by this instance to transformRawPackets
-
packetize
protected RawPacket[] packetize(byte[] buf, int off, int len, Object context)
Creates a RawPacket element from a specific byte[] buffer in order to have this instance send its packet data through itsRTPConnectorOutputStream.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 ofRawPackets returned by the superpacketize(byte[],int,int,Object)implementation using the associatedPacketTransformer.- Overrides:
packetizein classRTPConnectorOutputStream- Parameters:
buf- the packet data to be sent to the targets of this instance. The contents ofbufstarting atoffwith the specifiedlenis copied into the buffer of the returnedRawPacket.off- the offset of the packet data in buflen- the length of the packet data in bufcontext- theObjectprovided toRTPConnectorOutputStream.write(byte[], int, int, java.lang.Object). The implementation ofRTPConnectorOutputStreamignores thecontext.- Returns:
- an array with a single RawPacket containing the packet data of the specified byte[] buffer.
-
setTransformer
public void setTransformer(PacketTransformer transformer)
Sets thePacketTransformerto be used by this instance to transformRawPackets.- Specified by:
setTransformerin interfaceTransformOutputStream- Parameters:
transformer- thePacketTransformerto be used by this instance to transformRawPackets
-
-