/* * Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2020. All rights reserved. * Description: NxMetadataRetrieverWrapper class implement * Author: NxPlayer software group * Create: 2019-11-21 */ #ifndef ANDROID_NXMETADATARETRIEVER_WRAPPER_H #define ANDROID_NXMETADATARETRIEVER_WRAPPER_H #include #include #include #include "NxMetadataRetrieverInterface.h" namespace android { class NxMetadataRetrieverWrapper : public MediaMetadataRetrieverBase { public: NxMetadataRetrieverWrapper(); ~NxMetadataRetrieverWrapper() override; status_t setDataSource(const sp &httpService, const char *url, const KeyedVector *headers) override; status_t setDataSource(int fd, int64_t offset, int64_t length) override; status_t setDataSource(const sp &source, const char *mime) override; sp getFrameAtTime(int64_t timeUs, int option, int colorFormat, bool metaOnly) override; sp getImageAtIndex(int index, int colorFormat, bool metaOnly, bool thumbnail) override; sp getImageRectAtIndex(int index, int colorFormat, int left, int top, int right, int bottom) override; #if defined(PLATFORM_SDK_VERSION) && (PLATFORM_SDK_VERSION < 31) status_t getFrameAtIndex(std::vector> *frames, int frameIndex, int numFrames, int colorFormat, bool metaOnly) override; #elif defined(PLATFORM_SDK_VERSION) && (PLATFORM_SDK_VERSION >= 31) sp getFrameAtIndex(int frameIndex, int colorFormat, bool metaOnly) override; #endif MediaAlbumArt *extractAlbumArt() override; const char *extractMetadata(int keyCode) override; private: bool Init(); sp GetThumbImage(sp &thumbnail, const ThumbnailInfo &picInfo) const; NxMetadataRetrieverInterface *m_nxMetadataRetriever; void *m_libHandle; /* loaded library handle */ NxMetadataRetrieverInterface::CreateNxMetadataRetrieverInterfaceInstanceFunc m_createInstance; NxMetadataRetrieverInterface::DestroyNxMetadataRetrieverInterfaceInstanceFunc m_destroyInstance; int m_instIdx; /* instance number */ static int g_nextInstIdx; }; }; #endif