2

我正处于一个项目的早期阶段,该项目需要使用 RTP 广播DataStreamMediaLocation. 我正在关注一些示例代码,这些代码当前失败并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();
    }
}

关于可能导致问题的任何想法?

4

1 回答 1

0

如果您的问题当前没有解决,请尝试查看jlibrtp而不是 jmf。

于 2010-06-26T19:45:50.887 回答