/* * Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2020. All rights reserved. * Description: NxMetadataRetrieverInterface class * Author: NxPlayer software group * Create: 2019-11-21 */ #ifndef ANDROID_NXMETADATARETRIEVER_INTERFACE_H #define ANDROID_NXMETADATARETRIEVER_INTERFACE_H #include #include #include #include #include namespace android { using ::android::hardware::hidl_string; struct ThumbnailParam { uint32_t extraSize; int colorFormat; int option; bool metaOnly; bool thumbnail; }; struct ThumbnailRect { int left; int top; int right; int bottom; }; struct ThumbnailInfo { uint32_t width; uint32_t height; uint32_t rotation; uint32_t picSize; }; class NxMetadataRetrieverInterface : public RefBase { public: NxMetadataRetrieverInterface() {} ~NxMetadataRetrieverInterface() override {} virtual status_t setDataSource(const char *url, const KeyedVector *headers = nullptr) = 0; virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; virtual sp getFrameAtTime(int64_t timeUs, ThumbnailParam &inParam, ThumbnailInfo &outInfo) = 0; virtual sp getImageAtIndex(int index, ThumbnailParam &inParam, ThumbnailInfo &outInfo) = 0; virtual sp getImageRectAtIndex(int index, ThumbnailParam &inParam, ThumbnailRect &rectInfo, ThumbnailInfo &outInfo) = 0; virtual status_t getFrameAtIndex(std::vector> *frames, int frameIndex, int numFrames, ThumbnailParam &inParam, std::vector &outInfo) = 0; virtual sp getFrameAtIndex(int frameIndex, ThumbnailParam &inParam, ThumbnailInfo &outInfo) = 0; virtual std::string extractAlbumArt() = 0; virtual const char* extractMetadata(int keyCode) = 0; using CreateNxMetadataRetrieverInterfaceInstanceFunc = NxMetadataRetrieverInterface *(*)(int); using DestroyNxMetadataRetrieverInterfaceInstanceFunc = void (*)(NxMetadataRetrieverInterface *, int); }; }; #endif