diff options
author | Ronghua Wu <ronghuawu@google.com> | 2015-03-26 13:52:57 -0700 |
---|---|---|
committer | Ronghua Wu <ronghuawu@google.com> | 2015-04-13 18:01:51 -0700 |
commit | 9e6955a19bf77ebf27b770e910efbe1ebf1ceac0 (patch) | |
tree | 04fbb621d9f9262bdec827d80f9df998a48f90ff /media/libmedia | |
parent | 5795cb168634680fd5c835849c8fcf48dd6f532b (diff) | |
download | frameworks_av-9e6955a19bf77ebf27b770e910efbe1ebf1ceac0.zip frameworks_av-9e6955a19bf77ebf27b770e910efbe1ebf1ceac0.tar.gz frameworks_av-9e6955a19bf77ebf27b770e910efbe1ebf1ceac0.tar.bz2 |
media: handle overrides and measure max codec instance.
Bug: 19620911
Change-Id: I68d5919284700f37ccc6c6b9f96cd87ccdd40e6a
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/IMediaCodecList.cpp | 28 | ||||
-rw-r--r-- | media/libmedia/MediaCodecInfo.cpp | 11 |
2 files changed, 39 insertions, 0 deletions
diff --git a/media/libmedia/IMediaCodecList.cpp b/media/libmedia/IMediaCodecList.cpp index 80020db..e2df104 100644 --- a/media/libmedia/IMediaCodecList.cpp +++ b/media/libmedia/IMediaCodecList.cpp @@ -30,6 +30,7 @@ enum { CREATE = IBinder::FIRST_CALL_TRANSACTION, COUNT_CODECS, GET_CODEC_INFO, + GET_GLOBAL_SETTINGS, FIND_CODEC_BY_TYPE, FIND_CODEC_BY_NAME, }; @@ -64,6 +65,19 @@ public: } } + virtual const sp<AMessage> getGlobalSettings() const + { + Parcel data, reply; + data.writeInterfaceToken(IMediaCodecList::getInterfaceDescriptor()); + remote()->transact(GET_GLOBAL_SETTINGS, data, &reply); + status_t err = reply.readInt32(); + if (err == OK) { + return AMessage::FromParcel(reply); + } else { + return NULL; + } + } + virtual ssize_t findCodecByType( const char *type, bool encoder, size_t startIndex = 0) const { @@ -125,6 +139,20 @@ status_t BnMediaCodecList::onTransact( } break; + case GET_GLOBAL_SETTINGS: + { + CHECK_INTERFACE(IMediaCodecList, data, reply); + const sp<AMessage> info = getGlobalSettings(); + if (info != NULL) { + reply->writeInt32(OK); + info->writeToParcel(reply); + } else { + reply->writeInt32(-ERANGE); + } + return NO_ERROR; + } + break; + case FIND_CODEC_BY_TYPE: { CHECK_INTERFACE(IMediaCodecList, data, reply); diff --git a/media/libmedia/MediaCodecInfo.cpp b/media/libmedia/MediaCodecInfo.cpp index 7b4c4e2..8d3fa7b 100644 --- a/media/libmedia/MediaCodecInfo.cpp +++ b/media/libmedia/MediaCodecInfo.cpp @@ -206,6 +206,17 @@ status_t MediaCodecInfo::addMime(const char *mime) { return OK; } +status_t MediaCodecInfo::updateMime(const char *mime) { + ssize_t ix = getCapabilityIndex(mime); + if (ix < 0) { + ALOGE("updateMime mime not found %s", mime); + return -EINVAL; + } + + mCurrentCaps = mCaps.valueAt(ix); + return OK; +} + void MediaCodecInfo::removeMime(const char *mime) { ssize_t ix = getCapabilityIndex(mime); if (ix >= 0) { |