From 229300f9a7c688ea2fbb58d1b3cec60336434297 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 21 Feb 2025 09:52:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0=E4=BC=A0?= =?UTF-8?q?=E9=80=92=E6=96=B9=E5=BC=8F=EF=BC=8C=E9=81=BF=E5=85=8D=E5=86=85?= =?UTF-8?q?=E5=AD=98=E6=8F=90=E5=89=8D=E8=A2=AB=E9=87=8A=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/PhoneDevice.cpp | 14 ++++++++++---- app/src/main/cpp/PhoneDevice.h | 8 ++++---- app/src/main/cpp/camera2/ndkcamera.cpp | 2 +- app/src/main/cpp/camera2/ndkcamera.h | 2 +- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 2c372503..77300ef1 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -199,7 +199,7 @@ CPhoneDevice::CPhoneCamera::~CPhoneCamera() m_dev = NULL; } -bool CPhoneDevice::CPhoneCamera::on_image(cv::Mat& rgb) +bool CPhoneDevice::CPhoneCamera::on_image(cv::Mat rgb) { if (m_dev != NULL) { @@ -2392,7 +2392,7 @@ int CPhoneDevice::CallExecv(int rotation, int frontCamera, const std::string& ou return exitCode; } -bool CPhoneDevice::OnImageReady(cv::Mat& mat) +bool CPhoneDevice::OnImageReady(cv::Mat mat) { time_t takingTime = time(NULL); if (mPhotoInfo.remedy != 0) @@ -2705,7 +2705,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat& mat) return res; } -bool CPhoneDevice::PostProcessPhoto(const PHOTO_INFO& photoInfo, const vector& osds, const std::string& path, const std::string& cameraInfo, cv::Mat& mat) +bool CPhoneDevice::PostProcessPhoto(const PHOTO_INFO& photoInfo, const vector& osds, const std::string& path, const std::string& cameraInfo, cv::Mat mat) { int baseline = 0; cv::Size textSize; @@ -2927,6 +2927,12 @@ bool CPhoneDevice::PostProcessPhoto(const PHOTO_INFO& photoInfo, const vector characteristics, std::vector >& results, uint32_t ldr, uint32_t duration, std::vector >& frames); @@ -226,7 +226,7 @@ public: void UpdatePosition(double lon, double lat, double radius, time_t ts); bool OnVideoReady(bool photoOrVideo, bool result, const char* path, unsigned int photoId); - bool OnCaptureReady(bool photoOrVideo, bool result, cv::Mat& mat, unsigned int photoId); + bool OnCaptureReady(bool photoOrVideo, bool result, cv::Mat mat, unsigned int photoId); void UpdateSignalLevel(int signalLevel); void UpdateTfCardPath(const std::string& tfCardPath) @@ -253,7 +253,7 @@ protected: bool SendBroadcastMessage(std::string action, int value); // bool MatchCaptureSizeRequest(ACameraManager *cameraManager, const char *selectedCameraId, unsigned int width, unsigned int height, uint32_t cameraOrientation_, - bool PostProcessPhoto(const PHOTO_INFO& photoInfo, const vector& osds, const std::string& path, const std::string& cameraInfo, cv::Mat& mat); + bool PostProcessPhoto(const PHOTO_INFO& photoInfo, const vector& osds, const std::string& path, const std::string& cameraInfo, cv::Mat mat); inline bool TakePhotoCb(int res, const IDevice::PHOTO_INFO& photoInfo, const string& path, time_t photoTime, const std::vector& objects) const { if (m_listener != NULL) @@ -277,7 +277,7 @@ protected: void QueryPowerInfo(std::map& powerInfo); std::string QueryCpuTemperature(); - bool OnImageReady(cv::Mat& mat); + bool OnImageReady(cv::Mat mat); bool onOneCapture(std::shared_ptr characteristics, std::shared_ptr results, uint32_t ldr, uint32_t duration, cv::Mat rgb); bool onBurstCapture(std::shared_ptr characteristics, std::vector >& results, uint32_t ldr, uint32_t duration, std::vector >& frames); bool onBurstCapture(std::shared_ptr characteristics, std::vector >& results, uint32_t ldr, uint32_t duration, std::vector >& frames); diff --git a/app/src/main/cpp/camera2/ndkcamera.cpp b/app/src/main/cpp/camera2/ndkcamera.cpp index 57fa9a15..a9e92dbf 100644 --- a/app/src/main/cpp/camera2/ndkcamera.cpp +++ b/app/src/main/cpp/camera2/ndkcamera.cpp @@ -1541,7 +1541,7 @@ void NdkCamera::onDisconnected(ACameraDevice* device) { } -bool NdkCamera::on_image(cv::Mat& rgb) +bool NdkCamera::on_image(cv::Mat rgb) { return false; } diff --git a/app/src/main/cpp/camera2/ndkcamera.h b/app/src/main/cpp/camera2/ndkcamera.h index 6c17096c..e0844307 100644 --- a/app/src/main/cpp/camera2/ndkcamera.h +++ b/app/src/main/cpp/camera2/ndkcamera.h @@ -162,7 +162,7 @@ public: void DestroySession(); - virtual bool on_image(cv::Mat& rgb); + virtual bool on_image(cv::Mat rgb); virtual void on_error(const std::string& msg); virtual void on_image(const unsigned char* nv21, int nv21_width, int nv21_height); virtual void onDisconnected(ACameraDevice* device);