本人运用jlibrtp-0.2.2发送数据

bianjun1341 2011-09-08 11:38:07
运用jlibrtp-0.2.2发送数据,怎么收不到包啊!!请大虾,大牛们给点建议。。。
public class MySendDemo {
public RTPSession rtpSession = null;
static int pktCount = 0;
public MySendDemo(){
DatagramSocket rtpSocket = null;
DatagramSocket rtcpSocket = null;

try {
rtpSocket = new DatagramSocket(16386);
rtcpSocket = new DatagramSocket(16387);
} catch (Exception e) {
System.out.println("RTPSession failed to obtain port");
}

rtpSession = new RTPSession(rtpSocket, rtcpSocket);
}
public static void main(String[] args) {
MySendDemo aDemo = new MySendDemo();
Participant p = new Participant("192.168.0.115",16384,16385);
aDemo.rtpSession.addParticipant(p);
aDemo.run();
System.out.println("pktCount: " + pktCount);
}
private void run() {
if(RTPSession.rtpDebugLevel > 1) {
System.out.println("-> Run()");
}

String sendDate = "123456789";
for (int i = 0; i < 10000; i++) {
rtpSession.sendData(sendDate.getBytes());
}


}
}

代码中是否有问题啊?????
...全文
1080 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
FateAKong 2012-03-28
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 charly722 的回复:]

你的类没有实现RTPAppIntf接口,public class MySendDemo implements RTPAppIntf,你再试试
[/Quote]

你好 我也是正在android上用jlibrtp这个库 也遇到了类似问题 您说的的这个接口我实现了。。实际上我把两个可以互相传数据的java端 改成了 接收端放到android上 发送端不变 还是java 然后就不能传数据了
android这块自己刚接触 您要是做过还请多指导啊!
我看log发现接收端挪到安卓之后 两边RTCP协议的RTCPPaktSDES包好像出了问题 就是本身两个都是java端的时候 两边都会有一个adding participant的过程 相当于互相识别了 放到队列里了 但是现在就没有!
charly722 2012-02-15
  • 打赏
  • 举报
回复
你的类没有实现RTPAppIntf接口,public class MySendDemo implements RTPAppIntf,你再试试
moodsui 2011-11-08
  • 打赏
  • 举报
回复
学习一下 谢谢分享
jienobody 2011-09-15
  • 打赏
  • 举报
回复
有个service的问题:
private MyService myService=null;//先创建

Intent intent1=new Intent(Clinent2Activity.this,MyService.class);Clinent2Activity.this.startService(intent1);//启动service
bindService(intent1,serviceConnection, Context.BIND_AUTO_CREATE);//绑定

可是到了这里为什么 myService还是为null

初次使用service,求指导啊!
tairikun01 2011-09-15
  • 打赏
  • 举报
回复
正在学习中,留名
bianjun1341 2011-09-08
  • 打赏
  • 举报
回复
没有人吗????

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧