午夜毛片免费看,老师老少妇黄色网站,久久本道综合久久伊人,伊人黄片子

一種基于3g網(wǎng)絡(luò)的無線監(jiān)視系統(tǒng)的制作方法

文檔序號:7938847閱讀:151來源:國知局
專利名稱:一種基于3g網(wǎng)絡(luò)的無線監(jiān)視系統(tǒng)的制作方法
技術(shù)領(lǐng)域
本發(fā)明涉及嵌入式系統(tǒng)與Iinux網(wǎng)絡(luò)程序設(shè)計技術(shù)領(lǐng)域,具體包括Iinux內(nèi)核的移植,各種部件的驅(qū)動,以及視頻采集與傳輸,接收與顯示程序的編寫。具體地說是一種基于3G網(wǎng)絡(luò)的無線監(jiān)視系統(tǒng)。
背景技術(shù)
隨著技術(shù)的發(fā)展,人們對視頻監(jiān)控系統(tǒng)的需求量越來越大。傳統(tǒng)的有線視頻監(jiān)控系統(tǒng)不僅安裝復(fù)雜,而且有著維護困難,查看視頻監(jiān)控不方便等弊端。隨著嵌入式處理器與 3G網(wǎng)絡(luò)的發(fā)展,使得構(gòu)建一套小巧輕便的無線視頻監(jiān)控系統(tǒng)成為可能。本發(fā)明利用了 Iinux 2. 6. 30. 4內(nèi)核與3G網(wǎng)絡(luò),在基于S3C2440A的硬件電路板上實現(xiàn)了一套無線視頻監(jiān)控系統(tǒng)。

發(fā)明內(nèi)容
本發(fā)明的目的是提供一種基于3G網(wǎng)絡(luò)的無線監(jiān)視系統(tǒng)。本發(fā)明的目的是按以下方式實現(xiàn)的,本發(fā)明的目的在于構(gòu)建一套小巧輕便,可移動的無線視頻監(jiān)視系統(tǒng)。本發(fā)明包括硬件與軟件。其利用了比較成熟的3G網(wǎng)絡(luò),使其與互聯(lián)網(wǎng)結(jié)合,實現(xiàn)了異地實時監(jiān)控的功能。而且本系統(tǒng)利用了 Iinux內(nèi)核,其擴展性很強,可以用作集群監(jiān)控系統(tǒng)。實施步驟如下 硬件包括
芯片S3C2440A
IXD 東華3. 5寸觸摸屏
USB 攝像頭Venus USB 2. 0 Camera
3G卡華為EC1260
本發(fā)明實現(xiàn)的具體步驟如下
OARM9制版,可以采用任何結(jié)構(gòu)的核心板,并擴展出USB接口即可。2) BootLoader與Iinux內(nèi)核的移植。其中BootLoader可以用開源版本。Iinux 移植可以用arm9的默認配置文件進行編譯。3) USB攝像頭驅(qū)動其具體步驟為
(1)進入驅(qū)云力Linux源文件目錄下,打開文件drivers/media/video/uvc/ uvc_ driver, c。(2)將被聲明為usb_deViCe_id的結(jié)構(gòu)體數(shù)組uvc_ids[]中添加一個結(jié)構(gòu)體,其個元素數(shù)據(jù)如下
{. match_flags=USB_DEVICE_ID_MATCH_VENDORUSB_DEVICE_ID_MATCH_INT_INFO, .idVendor= 0x0ac8,
idProduct= 0x3430,
.blnterfaceClass= USB_CLASS_VIDEO,
.bInterfaceSubClass = 1, .bInterfaceProtocol = O, .driver_info= UVC_QUIRK_FIX_BANDWIDTH },
(3)保存并重新編譯模塊makemodules
(4)把驅(qū)動文件uvcvideo.ko下載到ARM9系統(tǒng)中并加載:modprobe uvcvideo. ko。4) 3G卡EC1260驅(qū)動,具體步驟如下 把PPP功能配置到內(nèi)核中
Device Drivers--->Network device support--->
<M> PPP (point-to-point protocol)Support MPPP multilink support (EXPERIMENTAL) MPPP filtering
<M>PPP support for async serial ports <M>PPP support for sync tty ports <M>PPP Deflate compression
<>PPP BSD-Compress compression
<M>PPP MPPE compression (encryption) (EXPERIMENTAL) <M>PPP over Ethernet (EXPERIMENTAL)
<>PPP over ATM
<>PPP over L2TP (EXPERIMENTAL)USB support--->
<M>USB Serial Converter support--->
<M> USB driver for GSM and CDMA modems
重新編譯內(nèi)核,插入驅(qū)動文件usbserial.ko,option, ko。此時插入華為EC1260網(wǎng)卡, 系統(tǒng)已經(jīng)可以直接驅(qū)動,并且在/dev/目錄中出現(xiàn)ttyUSBX等設(shè)備文件。5)視頻釆集與發(fā)送軟件編寫,其主要處理過程為 (1)幵啟TCP端口并監(jiān)聽
struct sockaddr_in serv_addr ; /氺也址{言>窗、氺/ struct sockaddr_in client—addr; /氺客戶地址f言;窗、氺/ server—sockfd = socket(PF—INET, SOCK—STREAM, 0)); bzero (&serv_addr, sizeof(serv_addr)); bzero(&client_addr, sizeof(client_addr)); serv_addr. sin_family=PF—INET; serv_addr. sin—port=htons(server—port); serv_addr. sin_addr. s_addr = INADDR—ANY;if (bind(server_sockfd, (struct sockaddr *)&serv_addr, sizeof(struct sockaddr)) == _1) {
perror(〃Tcp bind〃); exit(l) ;}
if (listen(server—sockfd,10) == _1) { perror(〃Tcp listen〃); exit(l) ;}
(2)如有連接則用UDP釆集與發(fā)送視頻信息
client_sockfd = accept (server_sockfd, (struct sockaddr *)&client_addr, &client_size);
sockfd = socket (AF—INET,SOCK—DGRAM,0);
ret = open—video(V4L—FILE, &vd, 8, VIDEO—PALETTE—JPEG, 320, 240); if (ret != 0) goto err;
while (1)
{
imageptr = get_frame_address(&vd);
get_first_frame(&vd);
memcpy (buffer, imageptr, MAX—BUFF);
cnt = sendto (sockfd, buffer, MAX—BUFF,0, (struct sockaddr 氺)&servaddr, sizeof (servaddr));
usleep (30000);
}
6)視頻接收與顯示軟件的編寫,其主要與處理過程為
(1)用TCP連接視頻監(jiān)控系統(tǒng),為控制線程 tcpsockfd = socket(PF—INET, SOCK—STREAM, 0);
if (connect (tcpsockfd, (struct sockaddr 水)&servaddr,sizeof (servaddr))== -1) {
perror(〃tcp connect"); exit(l) ;}
(2)用UDP接收數(shù)據(jù)并顯示,為傳輸線程 sockfd=socket (AF—INET,SOCK—DGRAM,0);
bind (sockfd, (struct sockaddr 5^) &servaddr, sizeof (servaddr));
while (1)
{
recvfrom(sockfd,buffer,MAX_BUFF,0, (struct sockaddr 水)&servaddr,sizeof(servaddr)); showpic (buffer, &vd);
ι其中Showpic函數(shù)為在LCD中顯示圖像,其利用了 Iibjpeg庫,并對其做了優(yōu)化,使其直接讀寫內(nèi)存而不經(jīng)過文件系統(tǒng),使其效率提升了至少一倍
int showpic (char *imageptr,fb_v41 *vd)
{
struct jpeg—decompress_struct cinfo; struct jpeg—error—mgr jerr; int χ, y;
unsigned char ^buffer; unsigned short ^tempbuf; cinfo. err = jpeg—std—error(&jerr); jpeg—create_decompress(&cinfo); jpeg—stdio_src(&cinfo,imageptr,MAX—BUFF); (void)jpeg—read—header(&cinfo,TRUE); (void) jpeg—start_decompress(&cinfo); buffer = (unsigned char 水)malloc(320^3); tempbuf = (unsigned short 水)malloc(320^240^2); y =0 ;
while(cinfo. output_scanline < cinfo· output—height)
{
jpeg—read—scanlines(&cinfo,&buffer,1); unsigned short color;
for ( χ = 0; χ < cinfo. output—width; x++)
{color=RGB888toRGB565 (buffer [x^3],buffer [x +l],buffer [
x*3+2]);
fb—pixel (tempbuf, 320,240,x, y, color);
}
y++;
}
memcpy(vd->fbp, (char *)tempbuf,320*240*2); jpeg—finish_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); free (buffer); free (tempbuf);
ι
本發(fā)明的優(yōu)異效果是集群無線視頻監(jiān)視系統(tǒng),利用ARM9夠造的嵌入式系統(tǒng)中實現(xiàn)視頻傳輸與顯示等工作,并采用3G網(wǎng)絡(luò)的傳輸方式,使得系統(tǒng)小巧輕便易于攜帶,具有可移動的特性,并能提供異地監(jiān)控的功能;在圖像采集與顯示的過程中進行了優(yōu)化處理,使得圖像傳輸與顯示速度較快,質(zhì)量較高。其移植了 Iinux內(nèi)核,使得其具有很強的擴展性。本系統(tǒng)采用處理器S3C2440A,由于該系統(tǒng)小巧并且基于Iinux內(nèi)核,所以不僅便捷,而且具有很強的擴展性。 附圖 說明

圖1為本系統(tǒng)軟件流程圖。
具體實施例方式參照說明書附圖對本發(fā)明的系統(tǒng)作以下詳細地說明。本發(fā)明的基于3G網(wǎng)絡(luò)的無線監(jiān)視系統(tǒng)A,是利用ARM9處理器與3G網(wǎng)路可移動與便捷的特性,利用ARM9的嵌入式系統(tǒng)實現(xiàn)視頻傳輸與顯示功能,利用Iinux 2. 6. 30. 4內(nèi)核,通過3G網(wǎng)絡(luò),將USB攝像頭采集的視頻信號傳輸?shù)竭h程終端并顯示,搭建成無線視頻監(jiān)視系統(tǒng),硬件包括芯片S3C2440A ;LCD 東華3. 5寸觸摸屏;USB攝像頭Venus USB 2.0 Camera ;3G 卡華為 EC1260 ;
具體步驟如下
OARM9制版,采用任何結(jié)構(gòu)的核心板,并擴展出USB接口 ;
2 ) BootLoader與1 inux內(nèi)核的移植,其中BootLoader用開源版本,1 inux移植用arm9 的默認配置文件進行編譯;
3)USB攝像頭驅(qū)動其具體步驟為
(1)進入驅(qū)云力Linux源文件目錄下,打開文件drivers/media/video/uvc/uvc_ driver, c ;
(2)將被聲明為usb_deviCe_id的結(jié)構(gòu)體數(shù)組uvC_ids[]中添加一個結(jié)構(gòu)體,其個元素數(shù)據(jù)如下
{. match_flags=USB_DEVICE_ID_MATCH_VENDOR USB_DEVICE_ID_MATCH_INT_INFO, .idVendor= 0x0ac8,
idProduct= 0x3430,
.blnterfaceClass= USB_CLASS_VIDEO,
.bInterfaceSubClass = 1, .bInterfaceProtocol = O,
.driver_info= UVC_QUIRK_FIX_BANDWIDTH },
(3)保存并重新編譯模塊makemodules
(4)把驅(qū)動文件uvcvideo.ko下載到ARM9系統(tǒng)中并加載:modprobe uvcvideo. ko ;
4)3G卡EC1260驅(qū)動,具體步驟如下 把PPP功能配置到內(nèi)核中
Device Drivers--->Network device support--->
<M> PPP (point-to-point protocol)Support MPPP multilink support (EXPERIMENTAL) MPPP filtering
<M>PPP support for async serial ports<M>PPP support for sync tty ports <M>PPP Deflate compression
<>PPP BSD-Compress compression
<M>PPP MPPE compression (encryption) (EXPERIMENTAL) <M>PPP over Ethernet (EXPERIMENTAL)
<>PPP over ATM <>PPP over L2TP (EXPERIMENTAL)USB support--->
<M>USB Serial Converter support--->
<M> USB driver for GSM and CDMA modems
重新編譯內(nèi)核,插入驅(qū)動文件usbserial. ko,option, ko,此時插入華為EC1260網(wǎng)卡, 系統(tǒng)直接驅(qū)動,并且在/dev/目錄中出現(xiàn)ttyUSBX設(shè)備文件; 5)視頻釆集與發(fā)送軟件編寫,其處理過程為
(1)幵啟TCP端口并監(jiān)聽
struct sockaddr_in serv_addr ; /氺也址{言>窗、氺/ struct sockaddr_in client—addr; /氺客戶地址f言;窗、氺/ server—sockfd = socket(PF—INET, SOCK—STREAM, 0)); bzero (&serv_addr, sizeof(serv_addr)); bzero(&client_addr, sizeof(client_addr)); serv_addr. sin_family=PF—INET; serv_addr. sin—port=htons(server—port); serv_addr. sin_addr. s_addr = INADDR—ANY;
if (bind(server_sockfd, (struct sockaddr *)&serv_addr, sizeof (struct sockaddr)) == _1) {
perror(〃Tcp bind〃); exit(l) ;}
if (listen(server—sockfd,10) == _1) { perror(〃Tcp listen〃); exit(l) ;}
(2)如有連接則用UDP釆集與發(fā)送視頻信息
client_sockfd = accept (server_sockfd, (struct sockaddr *)&client_addr, &client_size);
sockfd = socket (AF—INET,SOCK—DGRAM,0);
ret = open—video(V4L—FILE,&vd,8,VIDEO—PALETTE—JPEG,320,240); if (ret != 0) goto err;
while (1)
{
imageptr = get_frame_address(&vd);get_f irst_frame (&vd);
memcpy (buffer, imageptr,MAX—BUFF);
cnt = sendto (sockfd,buffer, MAX—BUFF,0, (struct sockaddr 氺)&servaddr, sizeof (servaddr));
usleep (30000);
}
6)視頻接收與顯示軟件的編寫,其主要與處理過程為
(1)用TCP連接視頻監(jiān)控系統(tǒng),為控制線程 tcpsockfd = socket(PF—INET, SOCK—STREAM, 0);
if (connect (tcpsockfd, (struct sockaddr 水)&servaddr,sizeof (servaddr))== -1) {
perror(〃tcp connect"); exit(l) ;}
(2)用UDP接收數(shù)據(jù)并顯示,為傳輸線程 sockfd=socket (AF—INET,SOCK—DGRAM,0);
bind (sockfd, (struct sockaddr 5^) &servaddr, sizeof (servaddr));
while (1)
{
recvfrom(sockfd,buffer,MAX_BUFF,O, (struct sockaddr 水)&servaddr,sizeof(servaddr)); showpic (buffer, &vd);
ι
其中showpic函數(shù)為在LCD中顯示圖像,其利用了 Iibjpeg庫,并對其做了優(yōu)化,使其直接讀寫內(nèi)存而不經(jīng)過文件系統(tǒng),使其效率提升了至少一倍
int showpic (char *imageptr,fb_v41 *vd)
{
struct jpeg—decompress_struct cinfo; struct jpeg—error—mgr jerr; int χ, y;
unsigned char ^buffer; unsigned short ^tempbuf; cinfo. err = jpeg—std—error(&jerr); jpeg—create_decompress(&cinfo); jpeg—stdio_src(&cinfo,imageptr, MAX—BUFF); (void)jpeg—read—header(&cinfo,TRUE); (void) jpeg—start_decompress(&cinfo); buffer = (unsigned char 水)malloc(320^3); tempbuf = (unsigned short 水)malloc(320^240^2); y =0 ;while(cinfo. output_scanline < cinfo· output—height)
{
jpeg—read—scanli nes(&cinfo,&buffer,1); unsigned short color;
for ( χ = 0; χ < cinfo. output—width; x++)
{color=RGB888toRGB565 (buffer [x^3],buffer [x +l],buffer [
x*3+2]);
fb—pixel (tempbuf,320,240,x, y, color);
}
y++;
} memcpy(vd->fbp, (char *)tempbuf,320*240*2); jpeg—finish_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); free (buffer); free (tempbuf); 除說明書所述的技術(shù)特征外,均為本專業(yè)技術(shù)人員的已知技術(shù)。
權(quán)利要求
1. 一種基于3G網(wǎng)絡(luò)的無線監(jiān)視系統(tǒng),其特征在于利用ARM9處理器與3G網(wǎng)路可移動與便捷的特性,利用ARM9的嵌入式系統(tǒng)實現(xiàn)視頻傳輸與顯示功能,利用Iinux 2. 6. 30. 4 內(nèi)核,通過3G網(wǎng)絡(luò),將USB攝像頭采集的視頻信號傳輸?shù)竭h程終端并顯示,搭建成無線視頻監(jiān)視系統(tǒng),硬件包括芯片S3C2440A ;LCD 東華3. 5寸觸摸屏;USB攝像頭Venus USB 2. 0 Camera ;3G 卡華為 EC1260 ; 具體步驟如下OARM9制版,采用任何結(jié)構(gòu)的核心板,并擴展出USB接口 ;2) BootLoader與1 inux內(nèi)核的移植,其中BootLoader用開源版本,1 inux移植用arm9 的默認配置文件進行編譯;3)USB攝像頭驅(qū)動其具體步驟為(1)進入驅(qū)云力Linux源文件目錄下,打開文件drivers/media/video/uvc/uvc_ driver, c ;(2)將被聲明為usb_deviCe_id的結(jié)構(gòu)體數(shù)組uvC_ids[]中添加一個結(jié)構(gòu)體,其個元素數(shù)據(jù)如下{. match_flags=USB_DEVICE_ID_MATCH_VENDOR USB_DEVICE_ID_MATCH_INT_INFO, .idVendor= 0x0ac8, idProduct= 0x3430,.blnterfaceClass= USB_CLASS_VIDEO,.bInterfaceSubClass = 1, .bInterfaceProtocol = O,.driver_info= UVC_QUIRK_FIX_BANDWIDTH },(3)保存并重新編譯模塊makemodules(4)把驅(qū)動文件uvcvideo.ko下載到ARM9系統(tǒng)中并加載:modprobe uvcvideo. ko ;4)3G卡EC1260驅(qū)動,具體步驟如下 把PPP功能配置到內(nèi)核中Device Drivers--->[*]Network device support---><M> PPP (point-to-point protocol)Support MPPP multilink support (EXPERIMENTAL) MPPP filtering<M>PPP support for async serial ports <M>PPP support for sync tty ports <M>PPP Deflate compression<>PPP BSD-Compress compression<M>PPP MPPE compression (encryption) (EXPERIMENTAL) <M>PPP over Ethernet (EXPERIMENTAL)<>PPP over ATM<>PPP over L2TP (EXPERIMENTAL)[水]USB support---><M>USB Serial Converter support---><M> USB driver for GSM and CDMA modems 重新編譯內(nèi)核,插入驅(qū)動文件usbserial. ko,option, ko,此時插入華為EC1260網(wǎng)卡, 系統(tǒng)直接驅(qū)動,并且在/dev/目錄中出現(xiàn)ttyUSBX設(shè)備文件;5)視頻釆集與發(fā)送軟件編寫,其處理過程為(1)幵啟TCP端口并監(jiān)聽struct sockaddr_in serv_addr ; /氺也址{言>窗、氺/ struct sockaddr_in client—addr; /氺客戶地址f言;窗、氺/ server—sockfd = socket(PF—INET, SOCK—STREAM, 0)); bzero (&serv_addr, sizeof(serv_addr)); bzero(&client_addr, sizeof(client_addr)); serv_addr. sin_family=PF—INET; serv_addr. sin—port=htons(server—port); serv_addr. sin_addr. s_addr = INADDR—ANY;if (bind(server_sockfd, (struct sockaddr *)&serv_addr, sizeof (struct sockaddr)) == _1) {perror(〃Tcp bind〃); exit(l) ;}if (listen(server—sockfd,10) == _1) { perror(〃Tcp listen〃); exit(l) ;}(2)如有連接則用UDP釆集與發(fā)送視頻信息client_sockfd = accept (server_sockfd, (struct sockaddr *)&client_addr, &client_size);sockfd = socket (AF—INET,SOCK—DGRAM,0);ret = open—video(V4L—FILE,&vd,8,VIDEO—PALETTE—JPEG,320,240); if (ret != 0) goto err;while (1){imageptr = get_frame_address(&vd);get_first_frame(&vd);memcpy (buffer, imageptr, MAX—BUFF);cnt = sendto(sockfd, buffer, MAX—BUFF,0, (struct sockaddr 氺)&servaddr, sizeof (servaddr));usleep (30000);}6)視頻接收與顯示軟件的編寫,其主要與處理過程為(1)用TCP連接視頻監(jiān)控系統(tǒng),為控制線程 tcpsockfd = socket(PF_INET, SOCK_STREAM, 0);if (connect (tcpsockfd, (struct sockaddr &servaddr, sizeof(servaddr))== -1) {perror(〃tcp connect"); exit(l) ;}(2)用UDP接收數(shù)據(jù)并顯示,為傳輸線程 sockfd=socket (AF—INET,SOCK—DGRAM,0);bind (sockfd, (struct sockaddr 5^) &servaddr, sizeof (servaddr));while (1){ recvfrom(sockfd,buffer,MAX_BUFF,O, (struct sockaddr 水)&servaddr,sizeof(servaddr)); showpic (buffer, &vd);ι其中showpic函數(shù)為在LCD中顯示圖像,其利用了 Iibjpeg庫,并對其做了優(yōu)化,使其直接讀寫內(nèi)存而不經(jīng)過文件系統(tǒng),使其效率提升了至少一倍int showpic (char *imageptr,fb_v41 *vd){struct jpeg—decompress_struct cinfo; struct jpeg—error—mgr jerr; int χ, y;unsigned char ^buffer; unsigned short ^tempbuf; cinfo. err = jpeg—std—error(&jerr); jpeg—create_decompress(&cinfo); jpeg—stdio_src(&cinfo,imageptr,MAX—BUFF); (void)jpeg—read—header(&cinfo,TRUE); (void) jpeg—start_decompress(&cinfo); buffer = (unsigned char 水)malloc(320^3); tempbuf = (unsigned short 水)malloc(320^240^2); y =0 ;while(cinfo. output_scanline < cinfo· output—height){jpeg—read—scanlines(&cinfo,&buffer,1); unsigned short color;for ( χ = 0; χ < cinfo. output—width; x++){color=RGB888toRGB565(buffer[x*3],buffer[x*3+l],buffer[x*3+2]);fb—pixel (tempbuf,320,240,x, y, color);}y++;}memcpy(vd->fbp, (char *)tempbuf,320*240*2); jpeg—finish_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); free (buffer); free (tempbuf);
全文摘要
本發(fā)明提供了一種基于3G網(wǎng)絡(luò)的無線視頻監(jiān)視系統(tǒng)的設(shè)計方法。該方法利用ARM9處理器與3G網(wǎng)路,并利用其成本較低,可移動與便捷的特性,在非常簡單的硬件環(huán)境下搭建了一套無線視頻監(jiān)視系統(tǒng)。由于該系統(tǒng)小巧并且基于linux內(nèi)核,所以不僅便捷易于攜帶,而且具有很強的擴展性。本系統(tǒng)的主要工作原理是系統(tǒng)采用處理器S3C2440A,利用linux2.6.30.4內(nèi)核,通過3G網(wǎng)絡(luò),將USB攝像頭采集的視頻信號傳輸?shù)竭h程終端并顯示。并在采集與顯示過程中對其做了一定的優(yōu)化。本系統(tǒng)可以用作集群視頻監(jiān)控系統(tǒng),其便捷與可移動的特性有效的保證了集群管理員對集群的24小時視頻監(jiān)控,異地監(jiān)控等。最后的測試結(jié)果表明本系統(tǒng)通訊實時性很高,傳輸視頻流暢而且圖像質(zhì)量較好。
文檔編號H04N7/18GK102333208SQ20111031119
公開日2012年1月25日 申請日期2011年10月14日 優(yōu)先權(quán)日2011年10月14日
發(fā)明者劉斐然 申請人:浪潮電子信息產(chǎn)業(yè)股份有限公司
網(wǎng)友詢問留言 已有0條留言
  • 還沒有人留言評論。精彩留言會獲得點贊!
1