恢复图像处理对象需要才加载机制

This commit is contained in:
gb 2023-08-18 13:57:44 +08:00
parent bdd6002d1e
commit 8d34638f36
1 changed files with 5 additions and 3 deletions

View File

@ -234,7 +234,7 @@ hg_scanner::hg_scanner(ScannerSerial serial, const char* dev_name, usb_io* io, i
thread_devslock_handle_.reset(new std::thread(&hg_scanner::thread_devslock_handle, this)); thread_devslock_handle_.reset(new std::thread(&hg_scanner::thread_devslock_handle, this));
#endif #endif
ImagePrc_pHandle_ = hg_imgproc::init(pid_, isx86_Advan_); ImagePrc_pHandle_ = nullptr; // hg_imgproc::init(pid_, isx86_Advan_);;
} }
hg_scanner::~hg_scanner() hg_scanner::~hg_scanner()
{ {
@ -1077,7 +1077,7 @@ void hg_scanner::thread_handle_image_process(void)
{ {
if (!ImagePrc_pHandle_) if (!ImagePrc_pHandle_)
{ {
//ImagePrc_pHandle_ = hg_imgproc::init(pid_, isx86_Advan_); ImagePrc_pHandle_ = hg_imgproc::init(pid_, isx86_Advan_);
if (!ImagePrc_pHandle_) if (!ImagePrc_pHandle_)
{ {
VLOG_MINI_1(LOG_LEVEL_FATAL, "[thread_handle_image_process]:Get Image Process is NULL pid is %d.\n", pid_); VLOG_MINI_1(LOG_LEVEL_FATAL, "[thread_handle_image_process]:Get Image Process is NULL pid is %d.\n", pid_);
@ -2283,8 +2283,10 @@ int hg_scanner::setting_text_direction(void* data, long* len)
if (!exact) if (!exact)
strcpy((char*)data, str.c_str()); strcpy((char*)data, str.c_str());
if (image_prc_param_.bits.text_direction == TEXT_DIRECTION_AUTO && ImagePrc_pHandle_) if (image_prc_param_.bits.text_direction == TEXT_DIRECTION_AUTO /*&& ImagePrc_pHandle_*/)
{ {
if (!ImagePrc_pHandle_)
ImagePrc_pHandle_ = hg_imgproc::init(pid_, isx86_Advan_);
hg_imgproc::init_auto_txt_hanld(ImagePrc_pHandle_); hg_imgproc::init_auto_txt_hanld(ImagePrc_pHandle_);
} }
else if (image_prc_param_.bits.text_direction != TEXT_DIRECTION_AUTO && ImagePrc_pHandle_) else if (image_prc_param_.bits.text_direction != TEXT_DIRECTION_AUTO && ImagePrc_pHandle_)