VT: SFP: bind socket to specific network
This will call an API of android_setsocknetwork().
"rtp-param-set-socket-network" is added to update routing table
from media engine of android.
RTP/RTCP sockets will be bound to the networkhandle provided
through the above parameter.
This patch is effected only for Rx(NuPlayer) session.
Bug: 121230209
Change-Id: Id14708049e684f8dd5711c2b9fefb67c6cafbfc6
Signed-off-by: Byeongjo Park <bjo.park@samsung.com>
diff --git a/media/libmediaplayerservice/nuplayer/RTPSource.cpp b/media/libmediaplayerservice/nuplayer/RTPSource.cpp
index d4d5bef..7e77456 100644
--- a/media/libmediaplayerservice/nuplayer/RTPSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/RTPSource.cpp
@@ -102,7 +102,7 @@
int sockRtp, sockRtcp;
ARTPConnection::MakeRTPSocketPair(&sockRtp, &sockRtcp, info->mLocalIp, info->mRemoteIp,
- info->mLocalPort, info->mRemotePort);
+ info->mLocalPort, info->mRemotePort, info->mSocketNetwork);
sp<AMessage> notify = new AMessage('accu', this);
@@ -691,6 +691,9 @@
info->mSelfID = atoi(value);
} else if (key == "rtp-param-ext-cvo-extmap") {
info->mCVOExtMap = atoi(value);
+ } else if (key == "rtp-param-set-socket-network") {
+ int64_t networkHandle = atoll(value);
+ setSocketNetwork(networkHandle);
}
return OK;
@@ -731,6 +734,20 @@
return OK;
}
+void NuPlayer::RTPSource::setSocketNetwork(int64_t networkHandle) {
+ ALOGV("setSocketNetwork: %llu", (unsigned long long)networkHandle);
+
+ TrackInfo *info = NULL;
+ for (size_t i = 0; i < mTracks.size(); ++i) {
+ info = &mTracks.editItemAt(i);
+
+ if (info == NULL)
+ break;
+
+ info->mSocketNetwork = networkHandle;
+ }
+}
+
// Trim both leading and trailing whitespace from the given string.
//static
void NuPlayer::RTPSource::TrimString(String8 *s) {