You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.1 KiB
63 lines
2.1 KiB
4 months ago
|
/*
|
||
|
* 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 <binder/IMemory.h>
|
||
|
#include <utils/String8.h>
|
||
|
#include <utils/KeyedVector.h>
|
||
|
#include <utils/RefBase.h>
|
||
|
#include <HidlSupport.h>
|
||
|
|
||
|
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<String8, String8> *headers = nullptr) = 0;
|
||
|
virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0;
|
||
|
virtual sp<IMemory> getFrameAtTime(int64_t timeUs, ThumbnailParam &inParam, ThumbnailInfo &outInfo) = 0;
|
||
|
virtual sp<IMemory> getImageAtIndex(int index, ThumbnailParam &inParam, ThumbnailInfo &outInfo) = 0;
|
||
|
virtual sp<IMemory> getImageRectAtIndex(int index, ThumbnailParam &inParam,
|
||
|
ThumbnailRect &rectInfo, ThumbnailInfo &outInfo) = 0;
|
||
|
virtual status_t getFrameAtIndex(std::vector<sp<IMemory>> *frames, int frameIndex, int numFrames,
|
||
|
ThumbnailParam &inParam, std::vector<ThumbnailInfo> &outInfo) = 0;
|
||
|
virtual sp<IMemory> 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
|