summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/wifi-display/source
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
commitff9297ac908aa01e44fda4ab9ca7a4bb514c00fd (patch)
treeecdec29e426bd54d290d4488640849504e812a13 /media/libstagefright/wifi-display/source
parent681be0398a06da7e24db4ed934a92af64d1409b1 (diff)
downloadframeworks_av-ff9297ac908aa01e44fda4ab9ca7a4bb514c00fd.zip
frameworks_av-ff9297ac908aa01e44fda4ab9ca7a4bb514c00fd.tar.gz
frameworks_av-ff9297ac908aa01e44fda4ab9ca7a4bb514c00fd.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/source')
-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 */);