4

最近我在https://github.com/jonbo372/efflux上找到了一个 RTP/RTSP 库。我想学习和使用该项目,但我无法获得任何示例或手册。谁能提供这些材料?

4

2 回答 2

0

我无法让它工作,但我认为它一定是这样的:

String server = "example.com";  // you need to set this
long ssrc = 0; // you need to set this
String sessionid = "???"; // you need to set this
int server_data_port = 0; // you need to set this
int server_ctrl_port = 0; // you need to set this
int my_data_port = 8000; // you can pick this
int my_ctrl_port = 8001; // you can pick this
int payloadType = 0;    // set from RTP spec.  I want to send H.264 but don't see a number for that.  http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xml

RtpParticipant pThem = RtpParticipant.createReceiver(server, server_data_port, server_ctrl_port);
pThem.getInfo().setSsrc(ssrc);

RtpParticipant pMe = RtpParticipant.createReceiver("0.0.0.0", my_data_port, my_ctrl_port);
pMe.getInfo().setSsrc(ssrc); // I guess both have the same ssrc?

RtpSession session = new SingleParticipantSession(sessionid, payloadType, pMe, pThem);

session.addDataListener(new RtpSessionDataListener() {
    @Override
    public void dataPacketReceived(RtpSession session, RtpParticipantInfo participant, DataPacket packet) {
             // Do something with the data
        }});

session.init();
于 2013-04-26T13:47:25.873 回答
0

没有一个似乎很容易获得。您可以尝试查看此处的测试,以了解使用情况。

于 2012-11-26T03:11:25.390 回答