From 6162c220b4431cf65e536e7767d440451c798118 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 9094566e..b673415d 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -296,7 +296,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) { @@ -3046,7 +3046,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) @@ -3364,7 +3364,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; @@ -3598,6 +3598,12 @@ bool CPhoneDevice::PostProcessPhoto(const PHOTO_INFO& photoInfo, const vector characteristics, std::vector >& results, uint32_t ldr, uint32_t duration, std::vector >& frames); @@ -248,7 +248,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) @@ -273,7 +273,7 @@ protected: // bool MatchCaptureSizeRequest(ACameraManager *cameraManager, const char *selectedCameraId, unsigned int width, unsigned int height, uint32_t cameraOrientation_, bool TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, const std::string& path, std::vector& osds, std::shared_ptr powerCtrlPtr); - 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) @@ -318,7 +318,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 f2ca1508..9cf6950d 100644 --- a/app/src/main/cpp/camera2/ndkcamera.cpp +++ b/app/src/main/cpp/camera2/ndkcamera.cpp @@ -1376,7 +1376,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 d8e8bdf0..72b3a77f 100644 --- a/app/src/main/cpp/camera2/ndkcamera.h +++ b/app/src/main/cpp/camera2/ndkcamera.h @@ -165,7 +165,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);