diff options
author | Andreas Huber <andih@google.com> | 2012-09-26 12:54:26 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2012-09-26 12:54:26 -0700 |
commit | eb11600a248cfe5b95ddd3e5aaae02bd2ab65276 (patch) | |
tree | 9b808c55bfce6bc2bf6235065bc3748d3e2806c7 /media/libstagefright/wifi-display/source/WifiDisplaySource.cpp | |
parent | 44b175c31a96804d8f981c43145967473491540f (diff) | |
download | frameworks_av-eb11600a248cfe5b95ddd3e5aaae02bd2ab65276.zip frameworks_av-eb11600a248cfe5b95ddd3e5aaae02bd2ab65276.tar.gz frameworks_av-eb11600a248cfe5b95ddd3e5aaae02bd2ab65276.tar.bz2 |
Make sure we only release the HDCP module once shutdown has completed.
Change-Id: I4b614afe2b55ac53b4aa63311e5bea8fd6c4462e
related-to-bug: 7223555
Diffstat (limited to 'media/libstagefright/wifi-display/source/WifiDisplaySource.cpp')
-rw-r--r-- | media/libstagefright/wifi-display/source/WifiDisplaySource.cpp | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp index e9811f5..daa70f6 100644 --- a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp +++ b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp @@ -230,20 +230,18 @@ void WifiDisplaySource::onMessageReceived(const sp<AMessage> &msg) { case kWhatStop: { - uint32_t replyID; - CHECK(msg->senderAwaitsResponse(&replyID)); + CHECK(msg->senderAwaitsResponse(&mStopReplyID)); if (mSessionID != 0 && mClientSessionID != 0) { status_t err = sendM5( mClientSessionID, true /* requestShutdown */); if (err == OK) { - mStopReplyID = replyID; break; } } - finishStop(replyID); + finishStop(); break; } @@ -339,7 +337,7 @@ void WifiDisplaySource::onMessageReceived(const sp<AMessage> &msg) { CHECK(msg->findInt32("ext1", &ext1)); CHECK(msg->findInt32("ext2", &ext2)); - ALOGV("Saw HDCP notification code %d, ext1 %d, ext2 %d", + ALOGI("Saw HDCP notification code %d, ext1 %d, ext2 %d", msgCode, ext1, ext2); switch (msgCode) { @@ -355,6 +353,12 @@ void WifiDisplaySource::onMessageReceived(const sp<AMessage> &msg) { break; } + case HDCPModule::HDCP_SHUTDOWN_COMPLETE: + { + finishStop2(); + break; + } + default: { ALOGE("HDCP failure, shutting down."); @@ -1080,8 +1084,7 @@ status_t WifiDisplaySource::onTeardownRequest( } if (mStopReplyID != 0) { - finishStop(mStopReplyID); - mStopReplyID = 0; + finishStop(); } else { disconnectClient(UNKNOWN_ERROR); } @@ -1089,21 +1092,29 @@ status_t WifiDisplaySource::onTeardownRequest( return OK; } -void WifiDisplaySource::finishStop(uint32_t replyID) { +void WifiDisplaySource::finishStop() { disconnectClient(OK); #if REQUIRE_HDCP if (mHDCP != NULL) { mHDCP->shutdownAsync(); - mHDCP.clear(); + return; } #endif + finishStop2(); +} + +void WifiDisplaySource::finishStop2() { +#if REQUIRE_HDCP + mHDCP.clear(); +#endif + status_t err = OK; sp<AMessage> response = new AMessage; response->setInt32("err", err); - response->postReply(replyID); + response->postReply(mStopReplyID); } status_t WifiDisplaySource::onGetParameterRequest( @@ -1195,8 +1206,7 @@ void WifiDisplaySource::sendErrorResponse( response.append("\r\n"); - status_t err = mNetSession->sendRequest(sessionID, response.c_str()); - CHECK_EQ(err, (status_t)OK); + mNetSession->sendRequest(sessionID, response.c_str()); } int32_t WifiDisplaySource::makeUniquePlaybackSessionID() const { |