summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MediaCodecList.cpp
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2014-08-07 15:18:35 -0700
committerLajos Molnar <lajos@google.com>2014-08-07 17:40:13 -0700
commit1381d4b5c0385aec3741073e5998773b064c1fb0 (patch)
tree6087b737255d34703a90d1952d48bb97646e492a /media/libstagefright/MediaCodecList.cpp
parent60b1c0e79d12a1c70758bc8d060156924635f8ba (diff)
downloadframeworks_av-1381d4b5c0385aec3741073e5998773b064c1fb0.zip
frameworks_av-1381d4b5c0385aec3741073e5998773b064c1fb0.tar.gz
frameworks_av-1381d4b5c0385aec3741073e5998773b064c1fb0.tar.bz2
media/playerservice: add getCodecList() to MediaPlayerService
Bug: 11990470 Change-Id: I8fa45946fd9b76f9b975fc59062819c57e6881ef
Diffstat (limited to 'media/libstagefright/MediaCodecList.cpp')
-rw-r--r--media/libstagefright/MediaCodecList.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/media/libstagefright/MediaCodecList.cpp b/media/libstagefright/MediaCodecList.cpp
index 60809c1..7f8b7f5 100644
--- a/media/libstagefright/MediaCodecList.cpp
+++ b/media/libstagefright/MediaCodecList.cpp
@@ -64,7 +64,22 @@ sp<IMediaCodecList> MediaCodecList::sRemoteList;
// static
sp<IMediaCodecList> MediaCodecList::getInstance() {
- return getLocalInstance();
+ Mutex::Autolock _l(sRemoteInitMutex);
+ if (sRemoteList == NULL) {
+ sp<IBinder> binder =
+ defaultServiceManager()->getService(String16("media.player"));
+ sp<IMediaPlayerService> service =
+ interface_cast<IMediaPlayerService>(binder);
+ if (service.get() != NULL) {
+ sRemoteList = service->getCodecList();
+ }
+
+ if (sRemoteList == NULL) {
+ // if failed to get remote list, create local list
+ sRemoteList = getLocalInstance();
+ }
+ }
+ return sRemoteList;
}
MediaCodecList::MediaCodecList()