diff options
author | Lajos Molnar <lajos@google.com> | 2014-08-06 16:55:46 -0700 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2014-08-07 17:40:13 -0700 |
commit | 60b1c0e79d12a1c70758bc8d060156924635f8ba (patch) | |
tree | 300d26ea36bca500a7105b7a94497dd1c2aa9fda /include/media/stagefright | |
parent | 8accee4f0e94f19866d260be6eecd6c219eb4982 (diff) | |
download | frameworks_av-60b1c0e79d12a1c70758bc8d060156924635f8ba.zip frameworks_av-60b1c0e79d12a1c70758bc8d060156924635f8ba.tar.gz frameworks_av-60b1c0e79d12a1c70758bc8d060156924635f8ba.tar.bz2 |
stagefright: rework media codec list and infos
This is in preparation of serving the codec list and codec infos
from the mediaserver
Bug: 11990470
Change-Id: Ib8e2708679c9ce461a4ba179974a740cdcdf2731
Diffstat (limited to 'include/media/stagefright')
-rw-r--r-- | include/media/stagefright/MediaCodecList.h | 54 | ||||
-rw-r--r-- | include/media/stagefright/OMXCodec.h | 4 |
2 files changed, 22 insertions, 36 deletions
diff --git a/include/media/stagefright/MediaCodecList.h b/include/media/stagefright/MediaCodecList.h index c11fcc9..8605d99 100644 --- a/include/media/stagefright/MediaCodecList.h +++ b/include/media/stagefright/MediaCodecList.h @@ -20,6 +20,9 @@ #include <media/stagefright/foundation/ABase.h> #include <media/stagefright/foundation/AString.h> +#include <media/IMediaCodecList.h> +#include <media/IOMX.h> +#include <media/MediaCodecInfo.h> #include <sys/types.h> #include <utils/Errors.h> @@ -31,32 +34,22 @@ namespace android { struct AMessage; -struct MediaCodecList { - static const MediaCodecList *getInstance(); +struct MediaCodecList : public BnMediaCodecList { + static sp<IMediaCodecList> getInstance(); - ssize_t findCodecByType( + virtual ssize_t findCodecByType( const char *type, bool encoder, size_t startIndex = 0) const; - ssize_t findCodecByName(const char *name) const; + virtual ssize_t findCodecByName(const char *name) const; - size_t countCodecs() const; - const char *getCodecName(size_t index) const; - bool isEncoder(size_t index) const; - bool codecHasQuirk(size_t index, const char *quirkName) const; + virtual size_t countCodecs() const; - status_t getSupportedTypes(size_t index, Vector<AString> *types) const; + virtual sp<MediaCodecInfo> getCodecInfo(size_t index) const { + return mCodecInfos.itemAt(index); + } - struct ProfileLevel { - uint32_t mProfile; - uint32_t mLevel; - }; - status_t getCodecCapabilities( - size_t index, const char *type, - Vector<ProfileLevel> *profileLevels, - Vector<uint32_t> *colorFormats, - uint32_t *flags, - // TODO default argument is only for compatibility with existing JNI - sp<AMessage> *capabilities = NULL) const; + // to be used by MediaPlayerService alone + static sp<IMediaCodecList> getLocalInstance(); private: enum Section { @@ -70,17 +63,8 @@ private: SECTION_INCLUDE, }; - struct CodecInfo { - AString mName; - bool mIsEncoder; - uint32_t mTypes; - uint32_t mSoleType; - uint32_t mQuirks; - KeyedVector<uint32_t, sp<AMessage> > mCaps; - sp<AMessage> mCurrentCaps; - }; - - static MediaCodecList *sCodecList; + static sp<IMediaCodecList> sCodecList; + static sp<IMediaCodecList> sRemoteList; status_t mInitCheck; Section mCurrentSection; @@ -88,9 +72,9 @@ private: int32_t mDepth; AString mHrefBase; - Vector<CodecInfo> mCodecInfos; - KeyedVector<AString, size_t> mCodecQuirks; - KeyedVector<AString, size_t> mTypes; + Vector<sp<MediaCodecInfo> > mCodecInfos; + sp<MediaCodecInfo> mCurrentInfo; + sp<IOMX> mOMX; MediaCodecList(); ~MediaCodecList(); @@ -117,6 +101,8 @@ private: status_t addFeature(const char **attrs); void addType(const char *name); + status_t initializeCapabilities(const char *type); + DISALLOW_EVIL_CONSTRUCTORS(MediaCodecList); }; diff --git a/include/media/stagefright/OMXCodec.h b/include/media/stagefright/OMXCodec.h index 5590b60..e341160 100644 --- a/include/media/stagefright/OMXCodec.h +++ b/include/media/stagefright/OMXCodec.h @@ -28,7 +28,7 @@ namespace android { -struct MediaCodecList; +struct MediaCodecInfo; class MemoryDealer; struct OMXCodecObserver; struct CodecProfileLevel; @@ -115,7 +115,7 @@ struct OMXCodec : public MediaSource, Vector<CodecNameAndQuirks> *matchingCodecNamesAndQuirks); static uint32_t getComponentQuirks( - const MediaCodecList *list, size_t index); + const sp<MediaCodecInfo> &list); static bool findCodecQuirks(const char *componentName, uint32_t *quirks); |