如何检查手机是否支持RTP
我想知道设备/手机是否支持RTP、RTCP。以下是我目前检查
String ar [] =Manager.getSupportedProtocols(null);
for (int i=0;i<ar.length;i++){
System.out.println("Supported Protocols are :"+ar[i]);
}
我使用 NetBeans IDE 的方式,并在 6.1 中给出上述代码
http
file
device
capture
,而更高版本(6.7 等)给出 rtsp https
包括上述协议。 我的问题是我检查的方式是否正确?
另一个问题是
rtsp 有 rtp 和 rtcp。但是当我尝试创建等待 rtp 数据包的套接字连接时,会抛出异常
javax.microedition.io.ConnectionNotFoundException: ConnectionNotFound error in
socket::open : error = 10051\n
为了创建套接字连接并获取流,我使用 StreamConnectionNotifier 这是我的做法;
(StreamConnectionNotifier)Connector.open("socket://xxx.xx.xx.xx:4040", Connector.READ_WRITE, true);
api 表示,如果不支持协议,则可以抛出我上面提到的异常。
即使手机支持rtsp,我也无法接收rtp吗?
I want to know whether a device/mobile phone supports RTP,RTCP. Here is how I currently check
String ar [] =Manager.getSupportedProtocols(null);
for (int i=0;i<ar.length;i++){
System.out.println("Supported Protocols are :"+ar[i]);
}
I use NetBeans IDE and in 6.1 gives for above code
http
file
device
capture
and later versions (6.7 etc )gives rtsp https
including above protocols.
My question is that the way I check is correct?
Other question is that
rtsp has rtp and rtcp.but when I try to create a socket connection which waits for rtp packets,an exception throws
javax.microedition.io.ConnectionNotFoundException: ConnectionNotFound error in
socket::open : error = 10051\n
For creating a socket connection and to get a stream I use StreamConnectionNotifier
Here is how I do it;
(StreamConnectionNotifier)Connector.open("socket://xxx.xx.xx.xx:4040", Connector.READ_WRITE, true);
The api says an exception which I mentioned above can be thrown if the protocol is not supported.
Can't I receive rtp even-though the phone supports rtsp?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论