[Live-devel] Android rtsp client complied with NDK cannot receive any multicast video data

piaoyang5097 at sjtu.edu.cn piaoyang5097 at sjtu.edu.cn
Sat Jul 25 05:09:51 PDT 2015


Hi,
  I'm working on an live streaming platform. I put the live555 rtsp server on the windows PC, then I developed a android application which used testRTSPclient to receive the video data through JNI.
  Now the problem is:
  When the server on the win-pc used unicast, my android app can receieve the data smoothly,  but when the server used multicast, my android app can only get the SDP information with no video data received.
  In the way of multicast, the SDP information is as follows.
07-25 19:26:43.940: I/recrtsp_jni(28905): Got a SDP description: 
07-25 19:26:43.940: I/recrtsp_jni(28905):  v=0
07-25 19:26:43.940: I/recrtsp_jni(28905): o=- 1437823591858813 1 IN IP4 192.168.3.9
07-25 19:26:43.940: I/recrtsp_jni(28905): s=without audio
07-25 19:26:43.940: I/recrtsp_jni(28905): i=group
07-25 19:26:43.940: I/recrtsp_jni(28905): t=0 0
07-25 19:26:43.940: I/recrtsp_jni(28905): a=tool:LIVE555 Streaming Media v2014.11.12
07-25 19:26:43.940: I/recrtsp_jni(28905): a=type:broadcast
07-25 19:26:43.940: I/recrtsp_jni(28905): a=control:*
07-25 19:26:43.940: I/recrtsp_jni(28905): a=source-filter: incl IN IP4 * 192.168.3.9
07-25 19:26:43.940: I/recrtsp_jni(28905): a=rtcp-unicast: reflection
07-25 19:26:43.940: I/recrtsp_jni(28905): a=range:npt=0-
07-25 19:26:43.940: I/recrtsp_jni(28905): a=x-qt-text-nam:without audio
07-25 19:26:43.940: I/recrtsp_jni(28905): a=x-qt-text-inf:group
07-25 19:26:43.940: I/recrtsp_jni(28905): m=video 6032 RTP/AVP 96
07-25 19:26:43.940: I/recrtsp_jni(28905): c=IN IP4 232.16.229.111/255
07-25 19:26:43.940: I/recrtsp_jni(28905): b=AS:12000
07-25 19:26:43.940: I/recrtsp_jni(28905): a=rtpmap:96 H264/90000
07-25 19:26:43.940: I/recrtsp_jni(28905): a=fmtp:96 packetization-mode=1;profile-level-id=4D4029;sprop-parameter-sets=Z01AKZpmCg/YC1AQEBBenAA=,aO48gA==
07-25 19:26:43.940: I/recrtsp_jni(28905): a=control:track1
  I was sure that my router did support IP multicast, and when I used testRTSPclient on the windows, it worked fine to receive the multicast video data.
   After searching for the similar topics, I see it seems that I have to acquire a multicasting permission with wifi at first. So I did:
- put permissions in AndroidManifest.xml

<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE""/>  
<uses-permission android:name="android.permission.INTERNET"/>  
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
- put following java codes in android Activity::onCreate()

WifiManager wm = (WifiManager)getSystemService(Context.WIFI_SERVICE);  
if( wm != null ) {  
    mMCLock = wm.createMulticastLock( TAG );  
    mMCLock.acquire();  
}
  
  But it still doesn't work. I have read FAQ and gone through the live555 mailing archives, finding nothing helpful. Could you help me?


More information about the live-devel mailing list