summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/wifi-display
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2013-03-28 13:34:10 -0700
committerAndreas Huber <andih@google.com>2013-03-28 13:52:09 -0700
commit57190e05c9f58e22087a2b8411e4b9ff81a92a63 (patch)
tree3f6802eca2b84cc62d5c887fb8747b20e993861d /media/libstagefright/wifi-display
parent857583fd2ecbeb8696ede1f93b7291449fb2d133 (diff)
downloadframeworks_av-57190e05c9f58e22087a2b8411e4b9ff81a92a63.zip
frameworks_av-57190e05c9f58e22087a2b8411e4b9ff81a92a63.tar.gz
frameworks_av-57190e05c9f58e22087a2b8411e4b9ff81a92a63.tar.bz2
Fix SHUTDOWN after SETUP and before PLAY in wifi display.
Change-Id: Ieb8ce1ac3130254839975a3677162b64156735bc related-to-bug: 8499893
Diffstat (limited to 'media/libstagefright/wifi-display')
-rw-r--r--media/libstagefright/wifi-display/source/WifiDisplaySource.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp
index 792a9c5..4a49811 100644
--- a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp
+++ b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp
@@ -273,7 +273,8 @@ void WifiDisplaySource::onMessageReceived(const sp<AMessage> &msg) {
if (!strcasecmp(val, "pause") && mState == PLAYING) {
mState = PLAYING_TO_PAUSED;
sendTrigger(mClientSessionID, TRIGGER_PAUSE);
- } else if (!strcasecmp(val, "play") && mState == PAUSED) {
+ } else if (!strcasecmp(val, "play")
+ && mState == PAUSED) {
mState = PAUSED_TO_PLAYING;
sendTrigger(mClientSessionID, TRIGGER_PLAY);
}
@@ -422,7 +423,8 @@ void WifiDisplaySource::onMessageReceived(const sp<AMessage> &msg) {
NULL /* interlaced */));
mClient->onDisplayConnected(
- mClientInfo.mPlaybackSession->getSurfaceTexture(),
+ mClientInfo.mPlaybackSession
+ ->getSurfaceTexture(),
width,
height,
mUsingHDCP
@@ -1351,6 +1353,15 @@ status_t WifiDisplaySource::onPlayRequest(
return ERROR_MALFORMED;
}
+ if (mState != AWAITING_CLIENT_PLAY) {
+ ALOGW("Received PLAY request but we're in state %d", mState);
+
+ sendErrorResponse(
+ sessionID, "455 Method Not Valid in This State", cseq);
+
+ return INVALID_OPERATION;
+ }
+
ALOGI("Received PLAY request.");
if (mPlaybackSessionEstablished) {
finishPlay();
@@ -1673,7 +1684,10 @@ void WifiDisplaySource::HDCPObserver::notify(
status_t WifiDisplaySource::makeHDCP() {
sp<IServiceManager> sm = defaultServiceManager();
sp<IBinder> binder = sm->getService(String16("media.player"));
- sp<IMediaPlayerService> service = interface_cast<IMediaPlayerService>(binder);
+
+ sp<IMediaPlayerService> service =
+ interface_cast<IMediaPlayerService>(binder);
+
CHECK(service != NULL);
mHDCP = service->makeHDCP(true /* createEncryptionModule */);