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 /include | |
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 'include')
-rw-r--r-- | include/media/IMediaCodecList.h | 4 | ||||
-rw-r--r-- | include/media/MediaCodecInfo.h | 4 | ||||
-rw-r--r-- | include/media/stagefright/MediaCodecList.h | 14 |
3 files changed, 20 insertions, 2 deletions
diff --git a/include/media/IMediaCodecList.h b/include/media/IMediaCodecList.h index e93ea8b..12b52d7 100644 --- a/include/media/IMediaCodecList.h +++ b/include/media/IMediaCodecList.h @@ -21,6 +21,8 @@ #include <binder/IInterface.h> #include <binder/Parcel.h> +#include <media/stagefright/foundation/AMessage.h> + namespace android { struct MediaCodecInfo; @@ -33,6 +35,8 @@ public: virtual size_t countCodecs() const = 0; virtual sp<MediaCodecInfo> getCodecInfo(size_t index) const = 0; + virtual const sp<AMessage> getGlobalSettings() const = 0; + virtual ssize_t findCodecByType( const char *type, bool encoder, size_t startIndex = 0) const = 0; diff --git a/include/media/MediaCodecInfo.h b/include/media/MediaCodecInfo.h index cd56adb..895a13a 100644 --- a/include/media/MediaCodecInfo.h +++ b/include/media/MediaCodecInfo.h @@ -35,6 +35,8 @@ struct AMessage; struct Parcel; struct CodecCapabilities; +typedef KeyedVector<AString, AString> CodecSettings; + struct MediaCodecInfo : public RefBase { struct ProfileLevel { uint32_t mProfile; @@ -104,6 +106,7 @@ private: MediaCodecInfo(AString name, bool encoder, const char *mime); void addQuirk(const char *name); status_t addMime(const char *mime); + status_t updateMime(const char *mime); status_t initializeCapabilities(const CodecCapabilities &caps); void addDetail(const AString &key, const AString &value); void addFeature(const AString &key, int32_t value); @@ -114,6 +117,7 @@ private: DISALLOW_EVIL_CONSTRUCTORS(MediaCodecInfo); friend class MediaCodecList; + friend class MediaCodecListOverridesTest; }; } // namespace android diff --git a/include/media/stagefright/MediaCodecList.h b/include/media/stagefright/MediaCodecList.h index 53f3095..9d1d675 100644 --- a/include/media/stagefright/MediaCodecList.h +++ b/include/media/stagefright/MediaCodecList.h @@ -48,9 +48,14 @@ struct MediaCodecList : public BnMediaCodecList { return mCodecInfos.itemAt(index); } + virtual const sp<AMessage> getGlobalSettings() const; + // to be used by MediaPlayerService alone static sp<IMediaCodecList> getLocalInstance(); + // only to be used in getLocalInstance + void updateDetailsForMultipleCodecs(const KeyedVector<AString, CodecSettings>& updates); + private: class BinderDeathObserver : public IBinder::DeathRecipient { void binderDied(const wp<IBinder> &the_late_who __unused); @@ -75,11 +80,14 @@ private: status_t mInitCheck; Section mCurrentSection; + bool mUpdate; Vector<Section> mPastSections; int32_t mDepth; AString mHrefBase; - KeyedVector<AString, AString> mSettings; + sp<AMessage> mGlobalSettings; + KeyedVector<AString, CodecSettings> mOverrides; + Vector<sp<MediaCodecInfo> > mCodecInfos; sp<MediaCodecInfo> mCurrentInfo; sp<IOMX> mOMX; @@ -89,7 +97,7 @@ private: status_t initCheck() const; void parseXMLFile(const char *path); - void parseTopLevelXMLFile(const char *path); + void parseTopLevelXMLFile(const char *path, bool ignore_errors = false); static void StartElementHandlerWrapper( void *me, const char *name, const char **attrs); @@ -104,6 +112,8 @@ private: status_t addMediaCodecFromAttributes(bool encoder, const char **attrs); void addMediaCodec(bool encoder, const char *name, const char *type = NULL); + void setCurrentCodecInfo(bool encoder, const char *name, const char *type); + status_t addQuirk(const char **attrs); status_t addTypeFromAttributes(const char **attrs); status_t addLimit(const char **attrs); |