欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
QT網(wǎng)絡(luò)視頻監(jiān)控系統(tǒng)代碼
[打印本頁]
作者:
chn756464426
時間:
2019-4-11 14:45
標題:
QT網(wǎng)絡(luò)視頻監(jiān)控系統(tǒng)代碼
可以實現(xiàn)在web上查看攝像頭采集的圖像
0.png
(11.69 KB, 下載次數(shù): 13)
下載附件
2019-4-11 17:09 上傳
單片機源程序如下:
#include<stdio.h>
#include"srv.h"
#include"cam.h"
#include"web.h"
pthread_mutex_t cam_mutex;
pthread_mutex_t sync_mutex;
pthread_t cam_tid;
pthread_t web_tid;
int sync_flag = 2;
int main(int argc,char *argv[])
{
int ret;
pthread_mutex_init(&cam_mutex,NULL);
pthread_mutex_init(&sync_mutex,NULL);
#if 1
ret = pthread_create(&cam_tid,NULL,thread_cam,NULL);
if(ret)
{
errno = ret;
perror("create camera thread ");
exit(EXIT_FAILURE);
}else
printf("create camera thread success\n");
ret = pthread_detach(cam_tid);
if(ret)
{
errno = ret;
perror("detach camera thread ");
exit(EXIT_FAILURE);
}else
printf("detach camera thread success\n");
#endif
#if 0
ret = pthread_create(&zgb_tid,NULL,thread_zgb,NULL);
if(ret)
{
errno = ret;
perror("create zigbee thread ");
exit(EXIT_FAILURE);
}else
printf("create zigbee thread success\n");
ret = pthread_detach(zgb_tid);
if(ret)
{
errno = ret;
perror("detach zigbee thread\n");
exit(EXIT_FAILURE);
}else
printf("detach zigbee thread success\n");
#endif
#if 0
while(1)
{
pthread_mutex_lock(&sync_mutex);
if(0 == sync_flag)
{
pthread_mutex_unlock(&sync_mutex);
pthread_mutex_destroy(&sync_mutex);
break;
}else{
pthread_mutex_unlock(&sync_mutex);
sleep(1);
}
}
#endif
#if 1
ret = pthread_create(&web_tid,NULL,thread_web,NULL);
if(ret)
{
errno = ret;
perror("create web server thread\n");
exit(EXIT_FAILURE);
}else
printf("create web server thread success\n");
ret = pthread_detach(web_tid);
if(ret)
{
errno = ret;
perror("detach web server thread\n");
exit(EXIT_FAILURE);
}else
printf("detach web server thread success\n");
#endif
int listenfd = init_socket(8880,argv[1]);
while(1)
{
int connectfd = accept(listenfd,NULL,NULL);
printf("%d\n",connectfd);
if(-1 == connectfd)
{
perror("accept ");
exit(EXIT_FAILURE);
}
pthread_t srv_tid;
ret = pthread_create(&srv_tid,NULL,thread_srv,&connectfd);
if(ret)
{
errno = ret;
perror("create server thread\n");
exit(EXIT_FAILURE);
}else
printf("create server thread success\n");
ret = pthread_detach(srv_tid);
if(ret)
{
errno = ret;
perror("detach server thread\n");
exit(EXIT_FAILURE);
}else
printf("detach server thread success\n");
}
pthread_mutex_destroy(&cam_mutex);
sercache_destroy(jpegn) ;
sercache_destroy(head);
return 0;
}
復(fù)制代碼
所有資料51hei提供下載:
video monitor.7z
(373.5 KB, 下載次數(shù): 33)
2019-4-11 17:10 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
歡迎光臨 (http://m.raoushi.com/bbs/)
Powered by Discuz! X3.1