|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.media.server.impl.rtp.RtpSocketImpl
public class RtpSocketImpl
| Field Summary | |
|---|---|
protected java.util.Collection<org.mobicents.media.server.spi.dsp.Codec> |
codecs
|
protected org.mobicents.media.server.spi.MediaType |
mediaType
Media type |
protected boolean |
registered
|
static int |
RTCP_CUT_OFF_TIME
|
static int |
RTCP_MIN_TIME
|
protected java.net.InetSocketAddress |
rtcpRemoteAddress
|
protected java.net.InetSocketAddress |
rtpRemoteAddress
|
| Constructor Summary | |
|---|---|
RtpSocketImpl(RtpFactory factory,
java.util.Collection<org.mobicents.media.server.spi.dsp.Codec> codecs,
org.mobicents.media.server.spi.MediaType media,
boolean silenceSuppression)
Creates a new instance of RtpSocket |
|
| Method Summary | |
|---|---|
void |
bind()
Binds Datagram to the address sprecified. |
void |
close()
|
org.mobicents.media.server.spi.rtp.AVProfile |
getAVProfile()
Gets currently used audio/video profile |
long |
getBytesReceived()
Statistical method. |
long |
getBytesSent()
Statistical method. |
RtpClock |
getClock()
Gets current RTP clock instance. |
java.util.Collection<org.mobicents.media.server.spi.dsp.Codec> |
getCodecs()
Gets the list of used codecs. |
org.mobicents.media.Format |
getFormat()
Gets the currently used format. |
int |
getJitter()
Gets the jitter for time of packet arrival |
RtpSocketListener |
getListener()
Gets the currently assigned listener. |
java.lang.String |
getLocalAddress()
Gets address to which this socked is bound. |
int |
getLocalPort()
Returns port number to which this socked is bound. |
org.mobicents.media.server.spi.MediaType |
getMediaType()
|
int |
getPacketsReceived()
Gets the number of received packets |
int |
getPacketsSent()
Gets the number of sent packets |
ReceiveStream |
getReceiveStream()
Gets receiver stream. |
SendStream |
getSendStream()
(Non Java-doc). |
boolean |
isClosed()
|
boolean |
isSilenceSuppressed()
Indicates the status of silence suppression algorithm. |
void |
notify(java.lang.Exception e)
Notifies the listener that something goes wrong. |
void |
receiveRtcp(RtcpPacket rtcpPacket)
|
void |
receiveRtp(RtpPacket rtpPacket)
This method is called when rtp socket receives new rtp frame. |
void |
register(java.nio.channels.Selector selector)
Registers this socket usign specified selector. |
void |
release()
Closes this socket and resets its streams; This method is called by RtpSocket user. |
boolean |
rtcpExpired()
|
void |
send(byte[] packet)
Sends rtp packet to the remote peer. |
void |
send(RtpPacket packet)
Sends media data to remote peer. |
void |
setClock(RtpClock clock)
Assign RTP clock implementation. |
void |
setDtmfPayload(int dtmf)
Assigns RFC2833 DTMF playload number. |
void |
setFormat(int payloadId,
org.mobicents.media.Format format)
Specifies format and payload id which will be used by this socket for transmission This methods should be used by other components which are responsible for SDP negotiation. |
void |
setJitter(int jitter)
Assign new value of packet time arrival jitter. |
void |
setListener(RtpSocketListener listener)
Assigns listener which will receive notifications. |
void |
setPeer(java.net.InetAddress address,
int port)
Assigns remote end. |
void |
setSilenceSuppression(boolean value)
Modifies silence suppression flag. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int RTCP_MIN_TIME
public static final int RTCP_CUT_OFF_TIME
protected org.mobicents.media.server.spi.MediaType mediaType
protected java.net.InetSocketAddress rtpRemoteAddress
protected java.net.InetSocketAddress rtcpRemoteAddress
protected java.util.Collection<org.mobicents.media.server.spi.dsp.Codec> codecs
protected boolean registered
| Constructor Detail |
|---|
public RtpSocketImpl(RtpFactory factory,
java.util.Collection<org.mobicents.media.server.spi.dsp.Codec> codecs,
org.mobicents.media.server.spi.MediaType media,
boolean silenceSuppression)
throws java.io.IOException,
org.mobicents.media.server.spi.ResourceUnavailableException
timer - used to synchronize receiver stream.rtpMap - RTP payloads list.
java.io.IOException
org.mobicents.media.server.spi.ResourceUnavailableException| Method Detail |
|---|
public void bind()
throws java.io.IOException,
org.mobicents.media.server.spi.ResourceUnavailableException
bind in interface org.mobicents.media.server.spi.rtp.RtpSocketjava.io.IOException
org.mobicents.media.server.spi.ResourceUnavailableException
public void register(java.nio.channels.Selector selector)
throws java.nio.channels.ClosedChannelException
selector - the selector for registration.
java.nio.channels.ClosedChannelExceptionpublic org.mobicents.media.Format getFormat()
public java.util.Collection<org.mobicents.media.server.spi.dsp.Codec> getCodecs()
getCodecs in interface org.mobicents.media.server.spi.rtp.RtpSocket
public void setFormat(int payloadId,
org.mobicents.media.Format format)
setFormat in interface org.mobicents.media.server.spi.rtp.RtpSocketpayloadId - rtp payload numberformat - the format object.public void setDtmfPayload(int dtmf)
setDtmfPayload in interface org.mobicents.media.server.spi.rtp.RtpSocketdtmf - the DTMF payload number.public void setSilenceSuppression(boolean value)
value - the new value for flag.public boolean isSilenceSuppressed()
public java.lang.String getLocalAddress()
getLocalAddress in interface org.mobicents.media.server.spi.rtp.RtpSocketpublic int getLocalPort()
getLocalPort in interface org.mobicents.media.server.spi.rtp.RtpSocketpublic int getJitter()
getJitter in interface org.mobicents.media.server.spi.rtp.RtpSocketpublic void setJitter(int jitter)
setJitter in interface org.mobicents.media.server.spi.rtp.RtpSocketjitter - the value of jitter in milliseconds.public void setClock(RtpClock clock)
clock - the RTP clock instance;public RtpClock getClock()
public ReceiveStream getReceiveStream()
getReceiveStream in interface org.mobicents.media.server.spi.rtp.RtpSocketpublic org.mobicents.media.server.spi.rtp.AVProfile getAVProfile()
getAVProfile in interface org.mobicents.media.server.spi.rtp.RtpSocketpublic int getPacketsReceived()
getPacketsReceived in interface org.mobicents.media.server.spi.rtp.RtpSocketpublic int getPacketsSent()
getPacketsSent in interface org.mobicents.media.server.spi.rtp.RtpSocketpublic void release()
release in interface org.mobicents.media.server.spi.rtp.RtpSocketpublic void close()
public boolean isClosed()
public RtpSocketListener getListener()
public void setListener(RtpSocketListener listener)
listener - the listener instance.
public void setPeer(java.net.InetAddress address,
int port)
throws java.io.IOException
setPeer in interface org.mobicents.media.server.spi.rtp.RtpSocketaddress - the address of the remote party.port - the port number of the remote party.
java.io.IOExceptionpublic SendStream getSendStream()
getSendStream in interface org.mobicents.media.server.spi.rtp.RtpSocketorg.mobicents.media.server.impl.rtp.RtpSocket#startSendStream(PushBufferDataSource);
public void send(RtpPacket packet)
throws java.io.IOException
RtpPacket - -
the packet which contains media data and rtp header
java.io.IOException
public void send(byte[] packet)
throws java.io.IOException
packet - the rtp packet as binary arrary
java.io.IOExceptionpublic void receiveRtp(RtpPacket rtpPacket)
rtpPacket - public void receiveRtcp(RtcpPacket rtcpPacket)
public void notify(java.lang.Exception e)
e - the exception.public boolean rtcpExpired()
public long getBytesReceived()
getBytesReceived in interface org.mobicents.media.server.spi.rtp.RtpSocketpublic long getBytesSent()
getBytesSent in interface org.mobicents.media.server.spi.rtp.RtpSocketpublic org.mobicents.media.server.spi.MediaType getMediaType()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||