Browse Source

Z991239-1812 #comment fix: 解决拍照慢问题

胡琛80272472 4 years ago
parent
commit
dd4489d4a2
2 changed files with 6 additions and 16 deletions
  1. 0 15
      Module/mod_snapshot/mod_snapshot.cpp
  2. 6 1
      Other/libbizchan/bizchan.cpp

+ 0 - 15
Module/mod_snapshot/mod_snapshot.cpp

@@ -315,21 +315,6 @@ public:
 				Dbg("size = %d, width= %d height= %d", size, frm->width, frm->height);
 
 				RotationDown(frm->data[0], frm->width, frm->height, 3);
-				/*
-				IplImage* pImage = cvCreateImage(cvSize(frm->width, frm->height), IPL_DEPTH_8U, 3);
-				Dbg("cvFlip 1, imageSize= %d, widthStep= %d, width= %d, height= %d", pImage->imageSize, pImage->widthStep, pImage->width, pImage->height);
-				for (int i = 0; i < frm->height; i++) {
-					memcpy(pImage->imageData+ pImage->widthStep*i, frm->data[0]+ frm->linesize[0]*i, frm->linesize[0]);
-				}
-				Dbg("cvFlip 2");
-				cvFlip(pImage);
-				Dbg("cvFlip 3");
-				//cvSaveImage(".\\jietu_opencv.jpg", pImage);
-				memcpy(frm->data[0], pImage->imageData, size);
-				Dbg("cvFlip 4");
-				cvReleaseImage(&pImage);
-				Dbg("cvFlip 5");
-				*/
 			}
 #endif
 		}

+ 6 - 1
Other/libbizchan/bizchan.cpp

@@ -1070,7 +1070,7 @@ static void  build_fd_sets(SOCKET conn, int evt, fd_set* read_fds, fd_set* write
 	FD_SET(conn, read_fds);
 	FD_SET(evt, read_fds);
 	FD_ZERO(write_fds);
-	//FD_SET(conn, write_fds);
+	FD_SET(conn, write_fds);
 	FD_ZERO(except_fds);
 	FD_SET(conn, except_fds);
 	FD_SET(evt, except_fds);
@@ -1280,6 +1280,11 @@ static void process(bizchan_t* chan) {
 					if (rc != 0)
 						break;
 				}
+				if (FD_ISSET(conn, &write_fds)) {
+					rc = on_send(chan, conn);
+					if (rc != 0)
+						break;
+				}
 				if (FD_ISSET(chan->evt[0], &read_fds)) {
 					//读取管道数据并丢弃,管道主要用于唤醒select
 					char pipe_read_buffer[4];