Loading include/media/stagefright/MediaCodecList.h +6 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,12 @@ struct MediaCodecList : public BnMediaCodecList { static sp<IMediaCodecList> getLocalInstance(); private: class BinderDeathObserver : public IBinder::DeathRecipient { void binderDied(const wp<IBinder> &the_late_who __unused); }; static sp<BinderDeathObserver> sBinderDeathObserver; enum Section { SECTION_TOPLEVEL, SECTION_DECODERS, Loading media/libstagefright/MediaCodecList.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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(); Loading Loading
include/media/stagefright/MediaCodecList.h +6 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,12 @@ struct MediaCodecList : public BnMediaCodecList { static sp<IMediaCodecList> getLocalInstance(); private: class BinderDeathObserver : public IBinder::DeathRecipient { void binderDied(const wp<IBinder> &the_late_who __unused); }; static sp<BinderDeathObserver> sBinderDeathObserver; enum Section { SECTION_TOPLEVEL, SECTION_DECODERS, Loading
media/libstagefright/MediaCodecList.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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(); Loading