/* * 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_GALLERY_IAPI_ADAPTER_H #define HW_GALLERY_IAPI_ADAPTER_H #include #include #include #include "gralloc_priv.h" namespace android { const int NUMOUTPUTBUFFER = 3; const int TYPE_NORMAL_K = 0; const int TYPE_NORMAL_2K = 1; const int TYPE_NORMAL_S4K = 2; const int TYPE_NORMAL_4K = 3; const int TYPE_NORMAL_8K = 4; const int WIDTH_K = 1280; const int HEIGHT_K = 720; const int WIDTH_2K = 1920; const int HEIGHT_2K = 1080; const int WIDTH_S4K = 3840; const int HEIGHT_S4K = 2160; const int WIDTH_4K = 4096; const int HEIGHT_4K = 2160; const int WIDTH_8K = 7680; const int HEIGHT_8K = 4320; const int SECONDS_TO_MICROSECONDS = 1000000; const int SECONDS_TO_MILLLISECONDS = 1000; const int MILLLISECONDS_TO_NANOSECONDS = 1000000; const int FRAME_MILL_100 = 100000; const int FRAME_MILL_120 = 120000; const int EXT_OK = 0; const int EXT_ERR = 1; const uint32_t CS_SRGB = 0; const uint32_t CS_DCIP3 = 1; const uint32_t CS_ADOBE_RGB = 2; const uint32_t CS_REC2020 = 3; struct ExtendFrameInfo { uint32_t colorSpace; }; class HwGalleryIapiAdapter { public: static HwGalleryIapiAdapter* GetInstance(); HwGalleryIapiAdapter(){}; virtual ~HwGalleryIapiAdapter(){}; HwGalleryIapiAdapter(const HwGalleryIapiAdapter&) = delete; HwGalleryIapiAdapter& operator=(const HwGalleryIapiAdapter&) = delete; virtual int VoWindowSetting(unsigned int w, unsigned int h) = 0; virtual int Init(unsigned int w, unsigned int h) = 0; virtual int CreateDequeueThread() = 0; virtual int VoDeinit() = 0; virtual int VoDoFramex(const private_handle_t& handle, const ExtendFrameInfo &info) = 0; virtual int VoGetFormat(unsigned int& type) = 0; virtual void VoGetWindowHandle(uint& windowHandle) = 0; virtual int VoDoFramexSync() = 0; virtual int RMRegister() = 0; virtual int RMUnRegister() = 0; virtual int RMAcquireResource() = 0; }; } // namespace android #endif // HW_GALLERY_IAPI_ADAPTER_H