From 9db0ef88b448457a874e4a97d178c71aae5546ed Mon Sep 17 00:00:00 2001 From: ming Date: Fri, 13 Jan 2023 14:35:02 +0800 Subject: [PATCH] 代码优化 --- src/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6b20bed..11f292a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,6 +28,8 @@ #define MIN_RTP_PORT 10000 #define MAX_RTP_PORT 60000 +string data_home = "/mnt/f/fiss/data/"; + // ȡ MIN_RTP_PORT(10000)~MAX_RTP_PORT(60000)֮�������˿�(ż���������������˿ڿ���) int allocRtpPort() { @@ -125,7 +127,7 @@ void postDecoded(const void * userPtr, AVFrame * gpuFrame){ return; } - string path = "/mnt/f/fiss/data/" + decoder->getName() + ".jpg"; + string path = data_home + decoder->getName() + ".jpg"; saveJpeg(path.c_str(), pHwRgb[0], gpuFrame->width, gpuFrame->height, stream[0]); // 验证 CUDAToRGB } } else if (decoder->getName() == "dec2") @@ -150,7 +152,7 @@ void postDecoded(const void * userPtr, AVFrame * gpuFrame){ return; } - string path = "/mnt/f/fiss/data/" + decoder->getName() + ".jpg"; + string path = data_home + decoder->getName() + ".jpg"; saveJpeg(path.c_str(), pHwRgb[1], gpuFrame->width, gpuFrame->height, stream[1]); // 验证 CUDAToRGB } } @@ -220,7 +222,7 @@ void postDecoded0(const void * userPtr, AVFrame * gpuFrame){ return; } - string path = "/mnt/f/fiss/data/" + decoder->getName() + ".jpg"; + string path = data_home + decoder->getName() + ".jpg"; saveJpeg(path.c_str(), pHwData, gpuFrame->width, gpuFrame->height, nullptr); // 验证 CUDAToRGB } } -- libgit2 0.21.4