diff options
author | Lajos Molnar <lajos@google.com> | 2014-12-15 20:21:59 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-12-15 20:22:00 +0000 |
commit | 2aa82e786be2e986be1ecb48d72b095b040efe9a (patch) | |
tree | e2e8358ae1fa9e904bcf76879b0c4d790d1c1b29 /media | |
parent | 6e430fbd927b9cc043639eb728ddc921392a60e8 (diff) | |
parent | eee82e44548f17253c2e06b25725f91c7b549ec2 (diff) | |
download | frameworks_av-2aa82e786be2e986be1ecb48d72b095b040efe9a.zip frameworks_av-2aa82e786be2e986be1ecb48d72b095b040efe9a.tar.gz frameworks_av-2aa82e786be2e986be1ecb48d72b095b040efe9a.tar.bz2 |
Merge "MediaCodecList: handle binder death" into lmp-mr1-dev
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/MediaCodecList.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/media/libstagefright/MediaCodecList.cpp b/media/libstagefright/MediaCodecList.cpp index 5b8be46..cf6e937 100644 --- a/media/libstagefright/MediaCodecList.cpp +++ b/media/libstagefright/MediaCodecList.cpp @@ -62,6 +62,14 @@ static Mutex sRemoteInitMutex; sp<IMediaCodecList> MediaCodecList::sRemoteList; +sp<MediaCodecList::BinderDeathObserver> MediaCodecList::sBinderDeathObserver; + +void MediaCodecList::BinderDeathObserver::binderDied(const wp<IBinder> &who __unused) { + Mutex::Autolock _l(sRemoteInitMutex); + sRemoteList.clear(); + sBinderDeathObserver.clear(); +} + // static sp<IMediaCodecList> MediaCodecList::getInstance() { Mutex::Autolock _l(sRemoteInitMutex); @@ -72,8 +80,11 @@ sp<IMediaCodecList> MediaCodecList::getInstance() { interface_cast<IMediaPlayerService>(binder); if (service.get() != NULL) { sRemoteList = service->getCodecList(); + if (sRemoteList != NULL) { + sBinderDeathObserver = new BinderDeathObserver(); + binder->linkToDeath(sBinderDeathObserver.get()); + } } - if (sRemoteList == NULL) { // if failed to get remote list, create local list sRemoteList = getLocalInstance(); |