Ver código fonte

Z991239-1812 #comment other 解决坐席抓拍下摄像头花屏问题

陈礼鹏80274480 4 anos atrás
pai
commit
90cc4c34dc
1 arquivos alterados com 7 adições e 2 exclusões
  1. 7 2
      Other/libvideoqueue/libvideoqueue.cpp

+ 7 - 2
Other/libvideoqueue/libvideoqueue.cpp

@@ -12,6 +12,7 @@
 #else
 #include <stdlib.h>
 #include <string.h>
+#include <assert.h>
 #endif // RVC_OS_WIN
 
 
@@ -380,9 +381,9 @@ public:
 				else
 				{
 					videoq_frame*videotemp = (videoq_frame*)aVideoFrameAddr[m_pQueue->frontindex];
-#ifdef RVC_OS_WIN
 					assert(Video->height == videotemp->height);
 					assert(Video->width == videotemp->width);
+#ifdef RVC_OS_WIN
 					//Video->format = videotemp->format;
 					//Video->framesize = videotemp->framesize;
 					//Video->height = videotemp->height;
@@ -407,7 +408,11 @@ public:
 						ippiCopy_8u_C3R((unsigned char*)aImgDataAddr[m_pQueue->frontindex], videotemp->width*3, Video->data[0], Video->linesize[0], roiSize);
 					}
 #else
-					memcpy(Video->data[0], (unsigned char*)aImgDataAddr[m_pQueue->frontindex], videotemp->framesize);
+					for (int i = 0; i < videotemp->height; i++)
+					{
+						memcpy(Video->data[0] + i*Video->linesize[0], (unsigned char*)aImgDataAddr[m_pQueue->frontindex] + i * Video->width*3, Video->width*3);
+					}
+
 #endif // RVC_OS_WIN
 					m_ShareMem.Unlock();
 					return true;