From 2694aec84a6e0dcbe23dff9e54397d6e672980db Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 3 Dec 2024 17:27:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=8B=E6=9C=BAapp?= =?UTF-8?q?=E6=8B=8D=E7=85=A7=E6=80=BB=E6=98=AF=E9=80=9A=E9=81=931?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复停止服务时crash bug --- app/src/main/cpp/MicroPhoto.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/cpp/MicroPhoto.cpp b/app/src/main/cpp/MicroPhoto.cpp index b556c70f..6cc9e202 100644 --- a/app/src/main/cpp/MicroPhoto.cpp +++ b/app/src/main/cpp/MicroPhoto.cpp @@ -389,6 +389,10 @@ Java_com_xypower_mpapp_MicroPhotoService_takePhoto( std::string configFilePathStr = jstring2string(env, configFilePath); CFG_CHANNEL cfg; + cfg.camera_id = channel - 1; + cfg.quality = DEFAULT_JPEG_QUALITY; + cfg.requestTemplate = 2; + IDevice::PHOTO_INFO photoInfo(channel, preset); CTerminal::LoadChannelConfig(channel, configFilePathStr, cfg); CTerminal::ConvertChannelConfigToPhotoInfo(cfg, photoOrVideo != JNI_FALSE, photoInfo); @@ -501,6 +505,7 @@ Java_com_xypower_mpapp_MicroPhotoService_uninit( } pTerminal->SignalExit(); pTerminal->Shutdown(); + dev = pTerminal->GetDevice(); if (dev != NULL) { delete dev;