Commit 9db0ef88b448457a874e4a97d178c71aae5546ed

Authored by ming
1 parent 38f08eea

代码优化

Showing 1 changed file with 5 additions and 3 deletions
src/main.cpp
@@ -28,6 +28,8 @@ @@ -28,6 +28,8 @@
28 #define MIN_RTP_PORT 10000 28 #define MIN_RTP_PORT 10000
29 #define MAX_RTP_PORT 60000 29 #define MAX_RTP_PORT 60000
30 30
  31 +string data_home = "/mnt/f/fiss/data/";
  32 +
31 // ȡ MIN_RTP_PORT(10000)~MAX_RTP_PORT(60000)֮�������˿�(ż���������������˿ڿ���) 33 // ȡ MIN_RTP_PORT(10000)~MAX_RTP_PORT(60000)֮�������˿�(ż���������������˿ڿ���)
32 int allocRtpPort() { 34 int allocRtpPort() {
33 35
@@ -125,7 +127,7 @@ void postDecoded(const void * userPtr, AVFrame * gpuFrame){ @@ -125,7 +127,7 @@ void postDecoded(const void * userPtr, AVFrame * gpuFrame){
125 return; 127 return;
126 } 128 }
127 129
128 - string path = "/mnt/f/fiss/data/" + decoder->getName() + ".jpg"; 130 + string path = data_home + decoder->getName() + ".jpg";
129 saveJpeg(path.c_str(), pHwRgb[0], gpuFrame->width, gpuFrame->height, stream[0]); // 验证 CUDAToRGB 131 saveJpeg(path.c_str(), pHwRgb[0], gpuFrame->width, gpuFrame->height, stream[0]); // 验证 CUDAToRGB
130 } 132 }
131 } else if (decoder->getName() == "dec2") 133 } else if (decoder->getName() == "dec2")
@@ -150,7 +152,7 @@ void postDecoded(const void * userPtr, AVFrame * gpuFrame){ @@ -150,7 +152,7 @@ void postDecoded(const void * userPtr, AVFrame * gpuFrame){
150 return; 152 return;
151 } 153 }
152 154
153 - string path = "/mnt/f/fiss/data/" + decoder->getName() + ".jpg"; 155 + string path = data_home + decoder->getName() + ".jpg";
154 saveJpeg(path.c_str(), pHwRgb[1], gpuFrame->width, gpuFrame->height, stream[1]); // 验证 CUDAToRGB 156 saveJpeg(path.c_str(), pHwRgb[1], gpuFrame->width, gpuFrame->height, stream[1]); // 验证 CUDAToRGB
155 } 157 }
156 } 158 }
@@ -220,7 +222,7 @@ void postDecoded0(const void * userPtr, AVFrame * gpuFrame){ @@ -220,7 +222,7 @@ void postDecoded0(const void * userPtr, AVFrame * gpuFrame){
220 return; 222 return;
221 } 223 }
222 224
223 - string path = "/mnt/f/fiss/data/" + decoder->getName() + ".jpg"; 225 + string path = data_home + decoder->getName() + ".jpg";
224 saveJpeg(path.c_str(), pHwData, gpuFrame->width, gpuFrame->height, nullptr); // 验证 CUDAToRGB 226 saveJpeg(path.c_str(), pHwData, gpuFrame->width, gpuFrame->height, nullptr); // 验证 CUDAToRGB
225 } 227 }
226 } 228 }