Class AudioChannel
- java.lang.Object
-
- org.jivesoftware.smackx.jingleold.mediaimpl.jmf.AudioChannel
-
public class AudioChannel extends Object
An Easy to use Audio Channel implemented using JMF. It sends and receives jmf for and from desired IPs and ports. Also has a rport Symetric behavior for better NAT Traversal. It send data from a defined port and receive data in the same port, making NAT binds easier.Send from portA to portB and receive from portB in portA.
Sending portA ---> portB
Receiving portB ---> portA
Transmit and Receive are interdependence. To receive you MUST transmit.
-
-
Constructor Summary
Constructors Constructor Description AudioChannel(javax.media.MediaLocator locator, String localIpAddress, String remoteIpAddress, int localPort, int remotePort, javax.media.Format format, JingleMediaSession jingleMediaSession)
Creates an Audio Channel for a desired jmf locator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
main(String[] args)
void
setTrasmit(boolean active)
Set transmit activity.String
start()
Starts the transmission.void
stop()
Stops the transmission if already started.
-
-
-
Constructor Detail
-
AudioChannel
public AudioChannel(javax.media.MediaLocator locator, String localIpAddress, String remoteIpAddress, int localPort, int remotePort, javax.media.Format format, JingleMediaSession jingleMediaSession)
Creates an Audio Channel for a desired jmf locator. For instance: new MediaLocator("dsound://")- Parameters:
locator
- media locatorlocalIpAddress
- local IP addressremoteIpAddress
- remote IP addresslocalPort
- local port numberremotePort
- remote port numberformat
- audio formatjingleMediaSession
- the jingle media session.
-
-
Method Detail
-
start
public String start()
Starts the transmission. Returns null if transmission started ok. Otherwise it returns a string with the reason why the setup failed. Starts receive also.- Returns:
- result description
-
stop
public void stop()
Stops the transmission if already started. Stops the receiver also.
-
setTrasmit
public void setTrasmit(boolean active)
Set transmit activity. If the active is true, the instance should transmit. If it is set to false, the instance should pause transmit.- Parameters:
active
- active state
-
-