public class DtmfTransformEngine extends SinglePacketTransformer implements TransformEngine
Constructor and Description |
---|
DtmfTransformEngine(AudioMediaStreamImpl stream)
Creates an engine instance that will be replacing audio packets
with DTMF ones upon request.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the transformer and underlying transform engine.
|
PacketTransformer |
getRTCPTransformer()
Always returns null since this engine does not require any
RTCP transformations.
|
PacketTransformer |
getRTPTransformer()
Returns a reference to this class since it is performing RTP
transformations in here.
|
RawPacket |
reverseTransform(RawPacket pkt)
A stub meant to handle incoming DTMF packets.
|
void |
startSending(DTMFRtpTone tone,
int minimalToneDuration,
int maximalToneDuration,
int volume)
DTMF sending stub: this is where we should set the transformer in the
proper state so that it would start replacing packets with dtmf codes.
|
void |
stop()
Stops threads that this transform engine is using for even delivery.
|
void |
stopSendingDTMF()
Interrupts transmission of a DTMFRtpTone started with the
startSendingDTMF() method.
|
RawPacket |
transform(RawPacket pkt)
Replaces pkt with a DTMF packet if this engine is in a DTMF
transmission mode or returns it unchanged otherwise.
|
reverseTransform, transform
public DtmfTransformEngine(AudioMediaStreamImpl stream)
stream
- the AudioMediaStream whose RTP packets we are
going to be replacing with DTMF.public void close()
close
in interface PacketTransformer
close
in class SinglePacketTransformer
public PacketTransformer getRTCPTransformer()
getRTCPTransformer
in interface TransformEngine
public PacketTransformer getRTPTransformer()
getRTPTransformer
in interface TransformEngine
public RawPacket reverseTransform(RawPacket pkt)
reverseTransform
in class SinglePacketTransformer
pkt
- an incoming packet that we need to parse and handle in case
we determine it to be DTMF.public RawPacket transform(RawPacket pkt)
transform
in class SinglePacketTransformer
pkt
- the audio packet that we may want to replace with a DTMF one.public void startSending(DTMFRtpTone tone, int minimalToneDuration, int maximalToneDuration, int volume)
tone
- the tone that we'd like to start sending.minimalToneDuration
- The minimal DTMF tone duration.maximalToneDuration
- The maximal DTMF tone duration.volume
- The DTMF tone volume.public void stopSendingDTMF()
public void stop()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.