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.
92 lines
2.7 KiB
92 lines
2.7 KiB
/*
|
|
* Copyright (c) Hisilicon Technologies Co., Ltd.. 2016-2020. All rights reserved.
|
|
* Description: Support private hwgraphics hidl interface
|
|
* Author: Hisilicon
|
|
* Created: 2016.11.29
|
|
*/
|
|
#ifndef HW_GRAPHICS_IAPI_ADAPTER_H
|
|
#define HW_GRAPHICS_IAPI_ADAPTER_H
|
|
|
|
#include <hardware/hardware.h>
|
|
#include <vendor/huanglong/hardware/hwgraphics/1.0/IGraphics.h>
|
|
#include <cstdint>
|
|
#include "gralloc_priv.h"
|
|
|
|
namespace android {
|
|
using ::vendor::huanglong::hardware::hwgraphics::V1_0::CaptureType;
|
|
using ::vendor::huanglong::hardware::hwgraphics::V1_0::HwRect;
|
|
|
|
#ifndef HWGRAPHIC_CHK_RETURN
|
|
#define HWGRAPHIC_CHK_RETURN(val, ret, ...) \
|
|
do { \
|
|
if (val) { \
|
|
__VA_ARGS__; \
|
|
return (ret); \
|
|
} \
|
|
} while (0)
|
|
#endif
|
|
|
|
#ifndef HWGRAPHIC_CHK_RETURN_NOT_VALUE
|
|
#define HWGRAPHIC_CHK_RETURN_NOT_VALUE(val, ...) \
|
|
do { \
|
|
if (val) { \
|
|
__VA_ARGS__; \
|
|
return; \
|
|
} \
|
|
} while (0)
|
|
#endif
|
|
|
|
#ifndef HWGRAPHIC_CHK_PRINTF
|
|
#define HWGRAPHIC_CHK_PRINTF(val, ...) \
|
|
do { \
|
|
if (val) { \
|
|
__VA_ARGS__; \
|
|
} \
|
|
} while (0)
|
|
#endif
|
|
|
|
const int SCREENCAP_VIDEOGFX_WIDTH_LIMIT = 7680;
|
|
const int SCREENCAP_VIDEOGFX_HEIGHT_LIMIT = 4320;
|
|
const int TDE_COPY_TIMEOUT = 1000;
|
|
const int ACQUIRE_FRAME_TIMEOUT = 500;
|
|
const float RATIO_OF_UV_TO_Y_FOR_YUV420 = 0.5;
|
|
const int CAST_SYNC_TIMEOUT = 1000;
|
|
|
|
using PrivHandle = const private_handle_t *;
|
|
|
|
struct CaptureInfoData {
|
|
CaptureType captureType;
|
|
PrivHandle captureHandle{nullptr};
|
|
HwRect captureRect;
|
|
};
|
|
|
|
class HwGraphicsIapiAdapter {
|
|
public:
|
|
static HwGraphicsIapiAdapter* GetInstance();
|
|
|
|
HwGraphicsIapiAdapter(){};
|
|
|
|
virtual ~HwGraphicsIapiAdapter(){};
|
|
HwGraphicsIapiAdapter(const HwGraphicsIapiAdapter&) = delete;
|
|
HwGraphicsIapiAdapter& operator=(const HwGraphicsIapiAdapter&) = delete;
|
|
|
|
virtual int CaptureScreenByVDP(CaptureInfoData captureInfo) = 0;
|
|
|
|
virtual int InitVoModule() = 0;
|
|
|
|
virtual int CloseVoWindow(uint32_t window) = 0;
|
|
|
|
virtual int DeinitVoModule() = 0;
|
|
|
|
virtual int InitCast(uint64_t display, uint32_t format, uint32_t width, uint32_t height) = 0;
|
|
|
|
virtual int CastFrame(int32_t castHandle, const private_handle_t &handle, int fence, int &acquireFence) = 0;
|
|
|
|
virtual void SetBlackCastFrame(const bool isBlack) = 0;
|
|
|
|
virtual int CloseCast(int32_t castHandle) = 0;
|
|
};
|
|
} // namespace android
|
|
#endif // HW_GRAPHICS_IAPI_ADAPTER_H
|
|
|