发送端代码:
public static void openSession() {
InitSession test = new InitSession();
byte[] data = new byte[1500];
System.out.println("Send Length:"+data.length);
long timeStarted = System.currentTimeMillis();
int i = 0;
while(i<3){
test.rtpSession.sendData(data);
i++;
}
long timeStop = System.currentTimeMillis();
System.out.println("发送用时:"+(timeStop-timeStarted));
}
错误:
RtpPkt.setPayload: Cannot carry more than 1480 bytes for now.
RtpPkt() failed, check with checkPkt()
Exception in thread "main" java.lang.NullPointerException
at jlibrtp.RtpPkt.getPayloadLength(RtpPkt.java:150)
at jlibrtp.RtpPkt.writePkt(RtpPkt.java:296)
at jlibrtp.RtpPkt.encode(RtpPkt.java:201)
at jlibrtp.RTPSession.sendData(RTPSession.java:321)
at jlibrtp.RTPSession.sendData(RTPSession.java:244)
at RTPServer.openSession(RTPServer.java:17)
at RTPServer.main(RTPServer.java:5)