我正处于一个项目的早期阶段,该项目需要使用 RTP 广播DataStream
从MediaLocation
. 我正在关注一些示例代码,这些代码当前失败并rptManager.initalize(localAddress)
出现错误“无法打开本地数据端口:xxxx ”,具体来说:
Exception in thread "main" javax.media.rtp.InvalidSessionAddressException: Can't open local data port: 34586
at com.sun.media.rtp.RTPSessionMgr.initialize(RTPSessionMgr.java:2688)
at com.sun.media.rtp.RTPSessionMgr.initialize(RTPSessionMgr.java:2515)
at RTPBroadcast.main(RTPBroadcast.java:20)
我正在 Lucid 上开发,我的防火墙已完全禁用。老实说,我有点难过。我的代码如下:
// http://jcs.mobile-utopia.com/jcs/26201_RTPManager.java
public class RTPBroadcast {
public static void main (String[] args) throws InvalidSessionAddressException, IOException, UnsupportedFormatException {
RTPManager rtpManager = RTPManager.newInstance();
SessionAddress localAddress = new SessionAddress();
rtpManager.initialize(localAddress);
InetAddress ipAddress = InetAddress.getByName("192.168.1.5");
SessionAddress remoteAddress = new SessionAddress(ipAddress, 3000);
rtpManager.addTarget(remoteAddress);
DataSource dataOutput = new ScreenSource();
SendStream sendStream = rtpManager.createSendStream( dataOutput, 1);
sendStream.start();
}
}
关于可能导致问题的任何想法?