From 5a68fc340e5b61ec29d8283433ddb003d6871abc Mon Sep 17 00:00:00 2001 From: Li Sun Date: Fri, 3 Jul 2015 15:13:43 +0800 Subject: RTSP: add RTSP extensions for IPV6 support Change access modifiers and add overridables in rtsp stack. Make ARTSPConnection/ARTPConnection extensible for IPV6 support. Provide default implementations in AVMediaServiceExensions and AVMediaServiceFactory. Change-Id: Iaa67070d1832d56e0569dabfd8327c1998f04493 --- media/libstagefright/rtsp/MyHandler.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'media/libstagefright/rtsp/MyHandler.h') diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h index 0d0baf3..2981685 100644 --- a/media/libstagefright/rtsp/MyHandler.h +++ b/media/libstagefright/rtsp/MyHandler.h @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -115,8 +116,6 @@ struct MyHandler : public AHandler { mUIDValid(uidValid), mUID(uid), mNetLooper(new ALooper), - mConn(new ARTSPConnection(mUIDValid, mUID)), - mRTPConn(new ARTPConnection), mOriginalSessionURL(url), mSessionURL(url), mSetupTracksSuccessful(false), @@ -140,6 +139,9 @@ struct MyHandler : public AHandler { mPausing(false), mPauseGeneration(0), mPlayResponseParsed(false) { + mConn = AVMediaServiceFactory::get()->createARTSPConnection( + mUIDValid, uid); + mRTPConn = AVMediaServiceFactory::get()->createARTPConnection(); mNetLooper->setName("rtsp net"); mNetLooper->start(false /* runOnCallingThread */, false /* canCallJava */, @@ -722,16 +724,19 @@ struct MyHandler : public AHandler { // We are going to continue even if we were // unable to poke a hole into the firewall... - pokeAHole( + AVMediaServiceUtils::get()->pokeAHole( + this, track->mRTPSocket, track->mRTCPSocket, - transport); + transport, + mSessionHost); } mRTPConn->addStream( track->mRTPSocket, track->mRTCPSocket, mSessionDesc, index, - notify, track->mUsingInterleavedTCP); + notify, track->mUsingInterleavedTCP, + mConn->isIPV6()); mSetupTracksSuccessful = true; } else { @@ -1648,8 +1653,9 @@ private: request.append(interleaveIndex + 1); } else { unsigned rtpPort; - ARTPConnection::MakePortPair( - &info->mRTPSocket, &info->mRTCPSocket, &rtpPort); + AVMediaServiceUtils::get()->makePortPair( + &info->mRTPSocket, &info->mRTCPSocket, &rtpPort, + mConn->isIPV6()); if (mUIDValid) { HTTPBase::RegisterSocketUserTag(info->mRTPSocket, mUID, -- cgit v1.1