summaryrefslogtreecommitdiff
authorshipeng.sun <shipeng.sun@amlogic.com>2019-07-05 10:57:51 (GMT)
committer Shipeng Sun <shipeng.sun@amlogic.com>2019-07-08 09:45:28 (GMT)
commit2897d015772493b80a959ac61cfa86418cec2c58 (patch)
treec4a52168450281a1bc52e05ce98f36e69cf3aa96
parent2a1b512d567931633ff9badc63d973219ab608bd (diff)
downloadav-2897d015772493b80a959ac61cfa86418cec2c58.zip
av-2897d015772493b80a959ac61cfa86418cec2c58.tar.gz
av-2897d015772493b80a959ac61cfa86418cec2c58.tar.bz2
wifi-display: Miracast screened black screen [1/1]
PD#TV-6822 Problem: Vivo phone screened black screen through Miracast and could not exit Solution: 1. Sometime miracast connect the source device display connect success but refuse sink's connect, also report Nu-NetworkSession: writeMore on socket 319 failed w/ error -111, we remove the retry, then report RTSP_RESET to jni, then report to apk exit to the connect activity, try to reconnect. Verify: marconi Change-Id: If3d063656f9449b74989f2b9d4d2f486e16b2cc4 Signed-off-by: shipeng.sun <shipeng.sun@amlogic.com>
Diffstat
-rw-r--r--libstagefright/wifi-display/sink/WifiDisplaySink.cpp43
1 files changed, 8 insertions, 35 deletions
diff --git a/libstagefright/wifi-display/sink/WifiDisplaySink.cpp b/libstagefright/wifi-display/sink/WifiDisplaySink.cpp
index dbed7ce..786d0d6 100644
--- a/libstagefright/wifi-display/sink/WifiDisplaySink.cpp
+++ b/libstagefright/wifi-display/sink/WifiDisplaySink.cpp
@@ -136,6 +136,10 @@ namespace android
void WifiDisplaySink::setTeardown(void)
{
+ if (mState < CONNECTED) {
+ ALOGI("No need call setTeardown in state is %d", mState);
+ return;
+ }
AString url = AStringPrintf("rtsp://%s/wfd1.0/streamid=0", mRTSPHost.c_str());
sendTeardown(mSessionID, !mSetupURI.empty()? mSetupURI.c_str() : url.c_str());
}
@@ -313,42 +317,11 @@ namespace android
if (sessionID == mSessionID)
{
ALOGI("Lost control connection.");
-
// The control connection is dead now.
-#if 0
- mNetSession->destroySession(mSessionID);
- mSessionID = 0;
-
- if (mRTPSink != NULL)
- {
- looper()->unregisterHandler(mRTPSink->id());
- mRTPSink.clear();
- }
-#endif
- ALOGI("Quiting WifiDisplaySink.");
- if (err == -111) //"Connection refused"
- {
- if (mConnectionRetry++ < MAX_CONN_RETRY)
- {
- mNetSession->destroySession(mSessionID);
- mSessionID = 0;
- ALOGI("Retry rtsp connection %d", mConnectionRetry);
- retryStart(100000ll); //delay 100ms
- }
- else
- {
- sp<AMessage> msg = new AMessage(kWhatSinkNotify, mSinkHandler);
- ALOGI("Post msg kWhatSinkNotify - RTSP_ERROR x2");
- msg->setString("reason", "RTSP_ERROR x2");
- msg->post();
- }
- }
- else {
- sp<AMessage> msg = new AMessage(kWhatSinkNotify, mSinkHandler);
- ALOGI("post msg kWhatSinkNotify - connection reset by peer");
- msg->setString("reason", "RTSP_RESET");
- msg->post();
- }
+ sp<AMessage> msg = new AMessage(kWhatSinkNotify, mSinkHandler);
+ ALOGI("post msg kWhatSinkNotify - connection reset by peer");
+ msg->setString("reason", "RTSP_RESET");
+ msg->post();
//looper()->stop();
}
break;