Просмотр исходного кода

Z991239-1954 #comment fix: 解决record录像花屏问题

胡琛80272472 4 лет назад
Родитель
Сommit
e0b8dc5fb7
1 измененных файлов с 13 добавлено и 5 удалено
  1. 13 5
      Other/libvideoqueue/libvideoqueue.cpp

+ 13 - 5
Other/libvideoqueue/libvideoqueue.cpp

@@ -343,6 +343,10 @@ public:
 					try
 					{
 						memcpy(Video->data,(unsigned char*)aImgDataAddr[m_pQueue->frontindex],videotemp->framesize);
+						//for (int i = 0; i < videotemp->height; i++)
+						//{
+						//	memcpy((unsigned char*)Video->data + i * videotemp->width * 3, (unsigned char*)aImgDataAddr[m_pQueue->frontindex] + i * videotemp->width * 3, videotemp->width * 3);
+						//}
 					}
 					catch (...)
 					{
@@ -444,10 +448,10 @@ public:
 				else
 				{
 					videoq_frame*videotemp = (videoq_frame*)aVideoFrameAddr[m_pQueue->frontindex];
-					//Video->format = videotemp->format;
-					//Video->framesize = videotemp->framesize;
-					//Video->height = videotemp->height;
-					//Video->width = videotemp->width;
+					Video->format = videotemp->format;
+					Video->framesize = videotemp->framesize;
+					Video->height = videotemp->height;
+					Video->width = videotemp->width;
 #ifdef RVC_OS_WIN
 					if (flags) 
 					{
@@ -493,7 +497,11 @@ public:
 						}
 					}
 #else
-					memcpy(Video->data, (unsigned char*)aImgDataAddr[m_pQueue->frontindex], videotemp->framesize);
+					//memcpy(Video->data, (unsigned char*)aImgDataAddr[m_pQueue->frontindex], videotemp->framesize);
+					for (int i = 0; i < videotemp->height; i++)
+					{
+						memcpy((unsigned char*)Video->data + i * videotemp->height * 3, (unsigned char*)aImgDataAddr[m_pQueue->frontindex] + i * videotemp->width * 3, videotemp->width * 3);
+					}
 #endif // RVC_OS_WIN
 					m_ShareMem.Unlock();
 					return true;