本文整理汇总了Java中javax.media.rtp.RTPManager类的典型用法代码示例。如果您正苦于以下问题:Java RTPManager类的具体用法?Java RTPManager怎么用?Java RTPManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RTPManager类属于javax.media.rtp包,在下文中一共展示了RTPManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stop
import javax.media.rtp.RTPManager; //导入依赖的package包/类
/**
* Stops the transmission if already started.
* Stops the receiver also.
*/
public void stop() {
if (!started) return;
synchronized (this) {
try {
started = false;
if (processor != null) {
processor.stop();
processor = null;
for (RTPManager rtpMgr : rtpMgrs) {
rtpMgr.removeReceiveStreamListener(audioReceiver);
rtpMgr.removeSessionListener(audioReceiver);
rtpMgr.removeTargets("Session ended.");
rtpMgr.dispose();
}
sendStreams.clear();
}
}
catch (Exception e) {
e.printStackTrace();
}
}
}
示例2: initRTP
import javax.media.rtp.RTPManager; //导入依赖的package包/类
public void initRTP(int port) throws UnknownHostException,
IOException, InvalidSessionAddressException {
rtpManager = RTPManager.newInstance();
rtpManager.addReceiveStreamListener(this);
rtpManager.initialize(new SessionAddress(InetAddress
.getByName(sipHandler.getLocalHost()), port));
}
示例3: addTarget
import javax.media.rtp.RTPManager; //导入依赖的package包/类
public void addTarget( int localPort, RTPManager mgr, String ip, int port) {
try {
SessionAddress addr= new SessionAddress( InetAddress.getByName( ip),
new Integer( port).intValue());
mgr.addTarget( addr);
tx.addTargetToList( localPort + "", ip, port + "");
} catch( Exception e) {
e.printStackTrace();
}
}