java - Does Android's RTP library support multicast? -
i trying multicast audio stream 1 device many others using android's rtp classes.
i do not want use third party libraries if @ possible.
i able stream 2 way audio between 2 devices using audiostream
, audiogroup
set each other's ip addresses, stream multicast group.
if try instantiate audiostream
multicast address such 239.1.1.1
, then, on other device use audiostream.associate()
same multicast address, streams not heard.
i have read android devices not supporting multicast, devices (both samsung galaxy tab 2s) support it. have added following code try obtain multicast lock:
wifimanager wifi = (wifimanager) getsystemservice(context.wifi_service); multicastlock = wifi.createmulticastlock("multicastlock"); multicastlock.setreferencecounted(true); multicastlock.acquire();
additionally have following permissions in manifest file:
<uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_wifi_state" /> <uses-permission android:name="android.permission.change_wifi_multicast_state" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.record_audio" />
after looking lot, have discovered rtp classes support sending multicast, not receiving. presumably because sockets used not multicastsocket
s.
also, interested, tab 2 in fact 1 of devices doesn't support joining multicast groups (i.e. not send igmp join packets), if set static multicast groups in network infrastructure, packets received - hence why mentioned above knew support it.
a quick way of seeing if android device supports joining multicast groups looking presence of /proc/net/igmp
file.
Comments
Post a Comment