如何使用java外排库
最近我在上发现了一个RTP/RTSP库。我想学习和使用该项目,但我不能得到任何的例子或手册。有人能提供这些材料吗 似乎没有一个是容易获得的。您可以尝试查看测试,了解使用方法。我无法让它工作,但我认为它一定是这样的:如何使用java外排库,java,rtsp,rtp,Java,Rtsp,Rtp,最近我在上发现了一个RTP/RTSP库。我想学习和使用该项目,但我不能得到任何的例子或手册。有人能提供这些材料吗 似乎没有一个是容易获得的。您可以尝试查看测试,了解使用方法。我无法让它工作,但我认为它一定是这样的: String server = "example.com"; // you need to set this long ssrc = 0; // you need to set this String sessionid = "???"; // you need to set th
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();
我查看了所有的测试代码,但每一个都只引用了项目的一小部分。它没有完整的RTP会话示例。