|
|
/****************************************************************************
|
|
|
*
|
|
|
* Copyright (c) 2023 by Rockchip Corp. All rights reserved.
|
|
|
*
|
|
|
* The material in this file is confidential and contains trade secrets
|
|
|
* of Rockchip Corporation. This is proprietary information owned by
|
|
|
* Rockchip Corporation. No part of this work may be disclosed,
|
|
|
* reproduced, copied, transmitted, or used in any way for any purpose,
|
|
|
* without the express written permission of Rockchip Corporation.
|
|
|
*
|
|
|
*****************************************************************************/
|
|
|
#pragma once
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
#include "EBookType.h"
|
|
|
#include "EBookImage.h"
|
|
|
|
|
|
class EBookBackend;
|
|
|
class EBookContext;
|
|
|
|
|
|
class EBook
|
|
|
{
|
|
|
public:
|
|
|
/**
|
|
|
* @brief EBook构造函数
|
|
|
*/
|
|
|
EBook();
|
|
|
/**
|
|
|
* @brief EBook析构函数
|
|
|
*/
|
|
|
~EBook();
|
|
|
/**
|
|
|
* @brief 禁用引用构造函数
|
|
|
*/
|
|
|
EBook(const EBook &) = delete;
|
|
|
/**
|
|
|
* @brief 禁用拷贝构造函数
|
|
|
*/
|
|
|
EBook &operator=(const EBook &) = delete;
|
|
|
|
|
|
/**
|
|
|
* @brief 初始化函数
|
|
|
*
|
|
|
* @param version_str [IN] 外部传入的版本信息,用于版本适配
|
|
|
* @return EBookError::
|
|
|
* - None, success
|
|
|
* - Ohter, fail
|
|
|
*/
|
|
|
EBookError Init(const char *version_str);
|
|
|
|
|
|
/**
|
|
|
* @brief 获取EBook屏幕信息
|
|
|
*
|
|
|
* @param width [OUT] 屏幕像素宽度
|
|
|
* @param height [OUT] 屏幕像素高度
|
|
|
* @param width_mm [OUT] 屏幕物理宽度,单位mm
|
|
|
* @param height_mm [OUT] 屏幕物理高度,单位mm
|
|
|
*
|
|
|
* @return EBookError::
|
|
|
* - None, success
|
|
|
* - Other, fail
|
|
|
*/
|
|
|
EBookError GetEBookInfo(int *width, int *height, int *width_mm,
|
|
|
int *height_mm);
|
|
|
|
|
|
/**
|
|
|
* @brief 设置EBook电源模式
|
|
|
*
|
|
|
* @param power_mode [IN] 电源模式
|
|
|
*
|
|
|
* @return EBookError::
|
|
|
* - None, success
|
|
|
* - Other, fail
|
|
|
*/
|
|
|
EBookError SetEBookPowerMode(int power_mode);
|
|
|
|
|
|
/**
|
|
|
* @brief 同步处理模式,EB算法Cache完当前帧后返回
|
|
|
*
|
|
|
* @param int_src [IN] 输入图像信息
|
|
|
* @param out_fence [OUT] 返回完成输入图像转换的Fence标志
|
|
|
* @return EBookError:
|
|
|
* - None, success
|
|
|
* - Other, fail
|
|
|
*/
|
|
|
EBookError Commit(const EBookImageInfo *int_src, int *out_fence);
|
|
|
|
|
|
private:
|
|
|
int mMagic_; /* 魔数,用于头文件校验 */
|
|
|
EBookVersion mVersion_; /* 版本号 */
|
|
|
EBookError bInitState_;
|
|
|
std::shared_ptr<EBookContext> mCtx_;
|
|
|
std::shared_ptr<EBookBackend> mEBookBackend_;
|
|
|
bool mValid_;
|
|
|
mutable pthread_mutex_t mLock_;
|
|
|
|
|
|
/**
|
|
|
* @brief 检查SR头文件版本
|
|
|
*
|
|
|
* @param version_str [IN] 版本号字符串
|
|
|
* @return EBookError::
|
|
|
* - Valid ptr, success
|
|
|
* - Null ptr , fail
|
|
|
*/
|
|
|
EBookError CheckVersion(const char *version_str);
|
|
|
};
|