Preview only show first 10 pages with watermark. For full document please download

多u體會`系„: 多u體ò *式ñ8çë

   EMBED


Share

Transcript

ð  ¬ Ù Nò·*Ù*ˆ‰K‚ Kh’X@ӗÿ‹$ò¦kD äUFe‘*„ñ äUFÒ*û­ÑVÇëY Ù Šñ<ŸL°[ gÛéÛñªØHë#5ðÖZ ­…òes*„Þ”X£› ISDN ÿ‘‹ˆ ’XYÅ_ûEÞ 64Kbps ­ 2Mbps ˈæòY‚ÊíH.320 <ˆ'—Ñßïdì -11- ñ˜ìʂ­ÖZÌ(ˆ‚Êí (i) H.221ñÌûˆìMc…ò ZÅ'䷈ûµŒc‹ 64 € 1920Kbps ˆÉæg ‘‹ˆ ’X1Dˆ…Úí (ii) H.231ñðäñʂ9F (MCU) YÌûí (iii) H.261 ñð$vv…ò5BBˆ…òïd4€[YÌ ûëävv5BBàh¸ 352×288 ˆ CIF (Common Intermediate Formatð¼‹Äˈ(û) (û­ 176 × 144 ˆ QCIF (Quarter Common Intermediate Formatð[àǂ¼‹Äˈ(û) ( ûí (iv) H.242ñðìMe‹& 2Mbps ˆžFægޅ{Ç ËCœýæòè YˆÌûí (v) H.243ñðe‹& 2Mbps ˆžFægޖxÿêä…{ ËCœýæòè YˆÌûí (vi) H.230 ñð…*„ˆòÌøʂ­g™òYÌ ûí (vii) –vˆZò 5ïñ ï G.711ñ' 64Kbps ægY 3KHz Å_ˆ”@ ]Zòò ˆ·Rð ï G.722ñ' 64Kbps ægY 7.5KHz Å_ˆ& ]Zòò ˆ·Rð ï G.728ñ' 16Kbps ægY¿V”@ ]ˆZòòˆ· Rí 6$ H.233 ­ H.234 ˆ:† ‚õy¸ H.32X ¨Ž݋í b) H.310ìH.321 'î H.322ñ¨Ž*¿$ 1995 ú|û>ªÜˆí H.321 ÃWð$ì H.320 Ê÷ˆ•Å ISDN …ò”@{ÕÃY ÌûëŸð_Å ISDN (BISDN) ­ ATM @ӈe‹ Ê÷í BISDN ˆ H.321 {H'­ ISDN ˆ H.320 {YæÕëH.321 <  H.261 'î H.263 …ò 5ï ‚ð- H.310 ð MPEG-2 Q: ˆ…òïdˆ4€[ë'±¿ð MPEG-2 ˆ…ò ]YÌûð6 $ H.322 õy' H.320 ¨Ž¸n,ëð$Þà5£›’Xˆ•Å… ò”@1DÕÃúYÌûë-ì ISO-Ethernet ˆà5£›’XÅ _Ÿ¸ H.322 ¨ŽÜõí‚ÊgÜ H.322 ˆñ˜Xàöeío‚ xÿêäKh’X (LAN)ë-ùxKh’XõöÆY‹­| Rë'±¿ì ATM Kh’X‚Ê“e ]æ1DˆÜõí» 10.1 ð H.310ìH.321 ­ H.322 2ˆ¨ŽYˆnZˆíAõRí c) H.324ñ*¿¨Ž$ 1996 ú>ªØHë'±ñ„¨Žˆ!” @ ŸH'ì H.320 ‚ÊÝY…òesˆæòíH.324 ¨Že‹ˆ -12- Y 5ïˆ ‚ëH.263 xëy H.261 ˆæ3wë#5Q: ˆ‚x 128 × 96 ˆ QCIF (SQCIFðSub-QCIF) (ûëÙðñ„ ˆ”@*„-9ëH.263  H..261 w _êˆ 5ï·R ‚í' c‹ 28.8/36.6 Kbps žì Yñ˜¸fëH.263 YŠòˆñ˜ éB¹íH'ã´Î¿Þ ISDN …#ˆ H.320 *„ˆíã H.324 ¨ŽˆNë» 1 ŸÌ£YˆnAõRí d) H.323ñ*¿¨Ž$ 1996 ú>ªØHë#5y‰ H.320 ¨Ž ̀<Kh’Xì’’X2û[i€ ]æ1DÜõˆ”’ X™íH.323 ð$ñðñ'îäñˆðYö“e™ëŸH'­Ñ äì H.261 …ò 5ïìG.711 Zò 5ïìH.263 …ò 5ï' î G.722ìG.723 ­ G.728 ‚2ÌûYà]íH.323 Ìûˆ‚x wǸñ¿š(Gatekeeper)ˆØ°ë'ÙÑKh’X|RšY ] æ1D…ò£½|Rˆ·YëH.323 ÌûŸÊ÷ˆ‚x LAN/H.320 ‹ægcª H.323 æñª'­ H.320/H.324 {Y£ÌðY·Rí $ H.323 ¨ŽˆÌûëHM7» 1 ˆ 5õRí e) T.120ñ*¿¨Ž$ 1996 ú>ªØHë#5ð­ÔYÚKˆ °à]­”®’?ˆðY2YÊ÷ëŸ`y T.120 *¿“eˆ H.320ìH.323 ­ H.324 *¿¨ŽZòÐ5ôàˆÌûëì» 1  ™ˆëT.120 (œ“eˆ\ÅægZòÐ5esˆ·Y딮’? ˆ;‹“eäxc‹šH'Ì '4ì¨<4­Ûзw2Y… ­†5ë'i€°à]ˆ•ˆíÞ …òp´5YæÕ ë T.120 ØH'yò“eNñ˜ˆesÌûð] T.120 ðÃÌñ ˜Uֈ­eŠª“eäñûesŸ¿“e™íäx T.120 *¿ ¨Ž#5>iô÷'îcQòµ‘DnÅe2ˆAllinakD VTEL about Engineered for Doctors) -13- Ü3F*ëØe‹ˆVTELˆF.R.E.D ðQ‘1D“e™ëAllina­ +dli÷ˆ¹ïÜ3{À (Rural Health AllianceðRHA) ¹íÔY¼ ̅#ˆ‚xò¦kD’Xë'±H'Mð¼ÌˆkDG‰ÿgfY Íﭑfð1998úºAllina­RHA¹…Òˆ19±ˆVTEL® 227*„í 'ÿg²ˆƒO¸fëF$Minneapolis3ŸÄÿˆÿô#fkÚí Ž‚…òesˆ…#ðÑGÞ¹—ˆg²Y3ëig²ˆ3Ÿº `yxH'ó»Ý€MinneapolisY‘Dë' Ýðg²“eÍ 󻈑D1DíS]½'/fˆ‘f¸fÜ+…òesˆe‹ë‚F ² /fˆ²!/Ž$¹—‘ˆ‘ëòÿ1‹ˆo½ˆ‰ŠçÁ -9€Ãuë²/ˆ}ze‹ˆ…òes…#Z²/Y½‚ˆ‘ë }zW!5økˆkÚª€·­g™ë;Ýj舲/ˆŠ ¥íÞx+ìé22ˆÿ‹™ëAllinae‹xVTEL’Xðΐ5Šî8 zˆé2æ•Ym•€¹—ÝëW!ðÑäˆò¦kDG‰“eé2 1Dí ÞSՈkDÜ3Vë¶hæòËøëò¦kDˆë‹î P5ûŸ¢g¢€P…퇜ò¦ÃîkÙp´ñ˜æï*„ Picture Archiving and Communication System, PACSëöy•òkÙ Ñ?ÔäUFìžFp´·R­Nò’Xˆ7íÞkٙÑäˆV HMŽäUFÿ’Xˆíni€kDNòˆõÔîñ˜íx*„‰?Ô p´…òìÑ!kÙNì X ·ì”b֋ìm¼øïpì £ZYp´ìg »ïo’Xˆñ˜ëÆìkŠz†SHëi€ò¦ kDÿe‘ˆ•ˆí TM -14- 2.1 *„õF…# z‰ *„@Ó xx7Ä*„MŽ’X‰õxkّD*„è?ÞނýëT5 ïoã̈‡Êìã̈N(ûgñNëÃá,½vyÞMv jWǙëÙÞÑxjWÚHÍí-!Þ*„ˆ……Ò7ÄZ±M ‚öHY¸R1{gΐx+Šˆè EúëŸHY¸3{ÒR1 {Eúè íùô”öy(œˆxFëÃ5±M1D—fÎëŸæ áÑV1Dˆ;óí `@ ½nà !3=° ,œ; ݖÀ=° CCD !Ô=° ¨J² qd² í{ 6U !3=° 4t vŒ › Ð 4 *„…#Ð -15- 2.2 &F…# x*„MŽc\îZCˆÔgŽc‹šˆÖZ˜Œë½‰ c‹šˆÖZïo5Yg˜7íCCD Þ*„Ä;Ùp´ˆùýëp´ ŽCŽg5 CCD ˆòNTSC ÿ PAL òëW‰xf›¸ž FNò“eF*ûŽW·Ríc‹šïoÍ㠍¬2ðYÖVñ g.F*„îñòéFòˆÎ{í ¨Žˆ&FÌ(ì— ˜ 486 '™ÇxŠ”ñ*„,½¦îûî¼æûëC#ÞxŠ ”ǙëCs Pentium î 32M '™ÇíâFëÞ*„q@ îr ïdì5ïd™À¿ 3êˆNí ˜ ¨< CCD p´9ÿËñ¸Op´ŽCëá™ NTSC ”… ªûò˜7ëÒ‹gŽc‹šˆ…ò˜Œí ˜ Miro PCTV Cëÿx+p´ŽCbased on bt848ñ‹gY¸ žFæ·R¨< CCD p´9ÿ˘Œˆ…òp´Në‰î f¸H*û·Rˆ RAW Dataí ˜ @™CñÞ UNIX X-Window —¿™ 16 bits '™ 24 bits ÿ 32 bitsî&5BBˆªûë'>ªꈘ7ëŸÀdkÙp ´ˆ_ví ˜   Sound Blaster 16 bits ãɈZCñY¸ZòŽî·R•" ˆÒí ˜ c\î5Yñ‹gŽc‹šZò˜Œî˜7í ˜ 17 ±'™ˆ@™Ë ˜ ’XC ˜ Í㠘 ¬ ˆ”# ]ëx*„7ԗ¿ÑßÒ'#‚±° õˆäUFò¦kDe‘*„íh_addr , (char *)&server_add.sin_addr , hp-> h_length); server_add.sin_port=htons(port); if(connect ( clientsock , ( struct sockaddr * ) & server_add , sizeof(server_add))<0) { fprintf(stderr,"ERROR: Connect false!\n"); exit(1); } Îh`H' Socket gñ÷N€ò{R1Ë fprintf(stderr,"Connect success!\n"); video_transfer(clientsock,shmem_id) -21- $ Server $ìE $ Server $ìE Client Server Socket Socket ”™ s? Listen ”Ûñ Client $1‘ µî£ Bind Socket ”™ $<à ‘µî£ Connect Server Read Write Write Read Close ”°µ” s ”¬à° µî£ Close Ð 7 Connecttion-oriented socket ˆ Client-server ¨Ž…# -22- ô´ *„…# 2.3.2 X-Window 1) X-Window y‚xŽvô´#ˆ’XÛ҈ Window *„ëäv xô´¸R1ËServer 3ClientíR1Ëʂ@™röë3 õ¸ÑßìÐÅ —Ëìî —Ëì½Ëùùù2ÿ‹*ûí3 5ú¸R1˓e1DëìÉë‚x Window WÛ7‚g‹ ÿa 7î`y‚v1DíT•R1ËÀ‹ @™röë3æoè æ ›¸’Xè  R1ËæòíÙëX-Window *ûˆz‚øyoá  R1ËCœ’Xè ñ theDisplay=XOpenDisplay(Address); /* è Î € g Ê ÿ Ú Ê  ´ Address ¸ NULL ˆ X-Window Server*/ X-Window If(theDisplay==NULL) { fprintf(stderr,”Error: Connot establish a connection to the X Server %s!\n”,XDisplayName(NULL)); exit(1); } theScreen=DefaultScreen(theDisplay); /* */ theDepth=DefaultDepth(theDisplay,theScreen); /* */ 2) X-Window í¬rö/ó-ï í¬röˆˆ< 8B ….eY…# 'Ïb‹:g‹: ëw¸ í ˆb w¸ ëˆ ]ëùx ö  ëÌ ŸHè ® íä[Ïb‹g»™ ˈèì@™ˆbîV¹ˆûí R1Ë 3ÿ‹*ûÇˈæòyïoR1ËÒ3 ÿ‹*û/Z°0gµ@íR1ËYŠZ°Y¸c‹š@¸ˆ‹Î ÿËÎ?7fìÞÍã™a‚xaÍìtF¬ÿya—¬a¿í R1˟HYŠZ°gæŒ3x Window zˆæ9ífì´ Window ˆÚÉ5Wq ëR1ËÒ3³ÒExposeZ°í X-Window ™ 33 vZ°ëW“eÙÑÑc‹šÊ÷x+Z°!ˆ ‚í R1ËïoÙZ°"Þ3HŽˆH¿ÄÙZ°7Gí¬ô àˆ X-Window ÿ‹*ûyZ°×FˆíÒ7¸2HZ°Šì7Z °ÚÿëW2H—‚xZ°ˆªûíZ°×F*û¸£Bûÿ‹*û“ eˆ‚x5üªûí X-Window Window Window Tree Window Tree Window Root Window Root Window Window Window Window Window X-Window -23- 3) Xt Intrnsics ãF·w y X-Window ˆ‚±·wÖV*ûëc  Xlib œrãÌ ˆ‘õë`yÜdÌõˆ5ŽëW!“eÃpӀc‹šÖV/]w0  /9q0ˆ ‚íÞ X-Window *ûÒ7ÄëXt Intrnsics ýˆ…ˆ Y‹ëÙÑÿ‹*ûÒ7 ïo?Ԃ‹H 1ˆc‹šÖVù‹gC œc‹šÖVíä[ù‹Äíc‹ˆÌ Â5Cœ‚xvôMask ë‹g‚ X-Window c‹?#Ĉ£[ô´í æ›Cœ‚x….›‹ˆûy WindowAttribute.border_pixelì WindowAttribute.background_pixelëävxûàhg7…._Bˆˆ < ªˆˆ<íWindowAttribute.override_redirect Ÿyí›ec‹€ ˆûëc¸i<ˆ9žë´äxûmÒ¸ True ëõ Window Manager Ãe¸cYŠ*„ž9ëì Title Barì¬æa¿ìÿa ¿ùùù2í Îhë`y Window ˆCœˆñ Window=XCreateWindow(Display, RootWindow, -24- ä0ˆMžyÒÊ….ˆ/….0ë*ûz‚xCœˆ….y /….0ˆÙ¸c¹yb….ëq˜‰MžÒ¸„… .Root Windowí„….ry@™röˆªë rö‚£¬í x,y,width,height, /*Òʅ.ˆF󠬲*/ border_widthe, /*Òʅ.ˆˆ<8B*/ InputOutput, /*Òʅ.ˆ!h*/ CopyFromParent, /*Òʅ.ˆ]wy¬… .i=-gˆ*/ Windowmask, /*äxMž`yºò܈ y.ûÒÊvô*/ &WindowAttributes); Ηgë`ÿ7Ò Window Manager ñ“™òéHints.Ò Window Manager |Þq@ˆ@íä[“™Žnx“™î?#‹ ëtheDisplay,&event);/* switch(event.type) /* { case ButtonPress: /* Žª….Z°*/ iZ°*/ ¬a¿Z°*/ -25- break; ÍãaÍZ° case KeyPress: /* */ XLookupString(&event.xkey,keybuffer,64,&keys ym,&compose);/* ASCII CODE*/ if(keybuffer[0]==27) return; break; Œˆ >ŽÍ㘠} Þ*û7ÇòëêÙ ‹€ˆ Window ö€"ÕëÞö XWindow R1Ë™¿ˆN„íœR XCloseDisplay {û‰€"Õ ¹Cœˆ Windowñ XCloseDisplay(theDisplay); Wyc‹šêyÞc‹°ù‚x….Lœr‰c€"ÕíHMŽ XDestroyWindow {û€" Windowñ XDestroyWindow(theDisplay,theWindow); -26- chX ¨4Ó ¤ r”.× ìEV X 1‘w {sScreen —D e p t h OpenDisplay Server {s.×F¤ ìE.ה r”ÍŸ B w9W i n d o w 1 ›’ gƒ ‡±mw¯.×1›’ ›’`ûÞ£ è”VÙ1‘w”&rÓ¤ Ð 9 X-Window ÿ‹*ûq@£* Xt Intrnsics ãF·wõ¸ÿ‹*û“eˆ‚[Tʈªí ˆ X-Window ÿ‹*ûæ›yÒ7¸Z°×FˆíXt Intrnsics ãF·wõ yCœÞä[Z°ªǙíXlib ÿ‹*ûˆZ°e™æ›¸‚xÉ íAë7ÉíAˆwåù‚xZ°ˆ!ëWìZ°ˆòégq @ƒ[FYíì7ÿ‹*ûyäx Window ‹ë*ûõ5ëÊZ° yŠÞ£x Window ÇÄí -ðä[ä Window ˆÿ‹*ûgÜë/Switch0ˆ0‚yÑ›Þ Æ-!;~ˆëäð*ûÒ7ÚgÜë*ûˆÒ7 ™¿öy‚xћ —ˆ·YíXt Intrnsics ãF·wõÝIˆä[Z°@*ëWÙ ˆ Z°FuԈc‹šÖVù‹íc‹ Xt Intrnsicsë*ûÒ7Úò 5 aðÿ$Z°ˆ*ûïë-Ã5½ a‚èDޛ ;~ˆÉ Ü+g5*ûˆ;—ûí¬¬ˆ8æˆ9¡c‹ Xlib {ûۈÿ ‹*ûˆ;—iíXt Intrnsics ãF·wc‹ˆnxøf¸ñ -27- º¿æ ·wí½äxøfÄ Cœˆ­ R1ˈèÎíàN„Wº¿æ bñ º¿æ ëWCœÊb|Rù‹ n=0; /*Òʺ¿æMžmFr‰ÉëˆS‚xb|Rù‹*/ a) Xt Intrnsics Xt Intrnsics X-Window Xt Intrnsics shell_main=XtInitialize(argv[0],"Mmds",NULL,0,&argc,argv); /* Xt Intrnsics */ XtSetArg(args[n],XmNiconName,"Message Window"); n++; shell_msg=XtCreateApplicationShell("MSGWIN",applicationShellWid getClass,args,n); /* Message Window */ n=0; XtSetArg(args[n],XmNiconName,"Toolbar"); n++; shell_tool=XtCreateApplicationShell("TOOLBAR",applicationShellWi dgetClass,args,n); /* Toolbar Window */ ¸ Éë‚xb| Rù‹ëΗgÀ¿'ù‹`²Cœx+Ø°ù‹ ¸ Éë‚xb|Rù ‹ b) Cœù‹í*ûÒ7ÚÞÿ‹*ûÄCœ‚xÿäxù‹g… #*ûˆc‹šÖVñ n=0; XtSetArg(args[n],XmNwidth,756); n++; /*ÒÊù‹ˆÆB _B*/ XtSetArg(args[n],XmNheight,513); n++; win_main_frame=XtCreateManagedWidget("tool",xmFormWidgetClass, shell_main,args,n); /* shell_main Form */ n=0; XtSetArg(args[n],XmNwidth,256); n++; XtSetArg(args[n],XmNheight,513); n++; draw_video=XtCreateManagedWidget("main",xmDrawingAreaWidget Class,win_main_frame,args,n); /* Form */ n=0; XtSetArg(args[n],XmNwidth,500); n++; XtSetArg(args[n],XmNheight,513); n++; XtSetArg(args[n],XmNx,256); n++; /* */ XtSetArg(args[n],XmNy,0); n++; XtSetArg(args[n],XmNscrollingPolicy,XmAUTOMATIC); n++; XtSetArg(args[n],XmNscrollBarDisplayPolicy,XmSTATIC); n++; win_main_scroll=XtCreateManagedWidget("scroll",xmScrolledWindo wWidgetClass,win_main_frame,args,n); /* */ Þ ‹ ™Cœ‚x ލCœˆ œ‚xÛÐKh ù ù‹™C ÒÊù‹ˆFó Þù‹™Cœ‚xËF …. -28- n=0; XtSetArg(args[n],XmNwidth,500); n++; XtSetArg(args[n],XmNheight,513); n++; draw_picture=XtCreateManagedWidget("draw",xmDrawingAreaWidge tClass,win_main_scroll,args,n); /* */ n=0; XtSetArg(args[n],XmNwidth,960); n++; XtSetArg(args[n],XmNheight,150); n++; win_msg=XtCreateManagedWidget("msg",xmTextFieldWidgetClass,sh ell_msg,args,n); /* */ n=0; XtSetArg(args[n],XmNwidth,122); n++; XtSetArg(args[n],XmNheight,122); n++; win_tool=XtCreateManagedWidget("tool",xmFormWidgetClass,shell_t ool,args,n); /* Form*/ /* Form */ but_connect=XtVaCreateManagedWidget("Connect",xmPushButtonWi dgetClass,win_tool,XmNwidth,61,XmNheight,61,XmNx,0,XmNy,0, NULL); ËF….ÄCœ‚xÛÐKËù ‹Y¸NÐŘ7Nj Ë ÞCœˆ ¸òé….ˆbù‹Cœ‚xîK ¸·w¿….ˆbù‹Cœ‚x ™Cœ[x·w¿a¿ but_discon=XtVaCreateManagedWidget("Disconnect",xmPushButton WidgetClass,win_tool,XmNwidth,61,XmNheight,61,XmNx,0,XmNy, 61,NULL); but_setup=XtVaCreateManagedWidget("Setup",xmPushButtonWidget Class,win_tool,XmNwidth,61,XmNheight,61,XmNx,61,XmNy,0,NU LL); but_exit=XtVaCreateManagedWidget("Exit",xmPushButtonWidgetClas s,win_tool,XmNwidth,61,XmNheight,61,XmNx,61,XmNy,61,NULL) ; íªœR*¾ Z°·R*ûíªœR*¾ Z°·R* ûyÿ‹*ûÄÊ÷ˆ{ûëc;Ù·Rc‹šˆðYFY ·Rù‚ xù‹ÄŠˆZ°ñ c) XtAddEventHandler(draw_picture,ButtonReleaseMask|ButtonPressMas k|PointerMotionMask|ExposureMask,FALSE,(XtEventHandler)event _drawpic,(XtPointer)draw_picture); /* ¸CœˆËF….èÎ Z°*¾ëä0ÒÊ΍¬a͈a— "É'tFZ -29- °ë'·RÞKˈÛÐ;¿*/ /*¸[xa¿CœèΪœR*¾*/ XtAddCallback(but_connect,XmNactivateCallback,Connect,NULL); XtAddCallback(but_discon,XmNactivateCallback,Disconnect,NULL); XtAddCallback(but_setup,XmNactivateCallback,Setup,NULL); XtAddCallback(but_exit,XmNactivateCallback,Exit,NULL); ëS ˆù‹íÇòCœˆù‹WÜr@™€röǙëï oëSˆFYëCœˆù‹À€v|ˆ7Sðÿ€ X-WindowëWÎ c‹šðYñ XtRealizeWidget(shell_main); /*‰#….ù‹îx®ù‹@™€ rö™*/ e) XtRealizeWidget(shell_msg); XtRealizeWidget(shell_tool); :ŒZ°eíZ°e‰¬ X-Window Z°H¿ÄŽZ°ë WÙZ°ñ€uԈZ°·R*¾ëÿy­Z°Šވù‹ãè ΈªœR*¾ñ f) XtMainLoop(); 4) X-Window ˆÛÐeY…# *ûˆÛÐô´ëûïo Graphics Context8w GC gïŽ ™ˆN„íGC ægÛÐ 5ˆÑ ßNòëÄë-7 ˈ» ÇïÞÄí x*„j‹ Signal ˆR òégY…òîÖZˆê\rëW‹g êc‹šˆT/aÍòéí Þc‹Ë7 ËgYR ·R ëÑq‹ itimerval ?#g‹A‚ x7 Ëñ struct itimerval{ struct timerval it_interval; struct timerval it_value; }; xÄ it_value 'õî5õg77 ËÂ$äö ËÀrëit_interval g7´ ˍˆ ëP\`Œ it_value ˆm¸äöíÙëT 5ÒÊê it_interval ˆmë7 Ë`e‚p‚pˆ©—G닀c‹š Ù it_interval ˆmÒ¸ 0ryÙ7 Ëÿë7 ˍ¸í Þ*ûÄ' Signal {ûgg+Îòéˆ{û òéˆv!ñ void handler(int); /*0‚òérÇ{û*/ signal(SIGALRM,handler); /*g+Î Alarm òéëW×F handler {ûgÚÿ*/ itival.it_initerval.tv_usec=1000; /*g+ù`Œ 1000 5õ*/ itival.it_initerval.tv_sec=0; itival.it_value.tv_usec=1000; /*g+ 1000 5õLròé*/ itival.it_value.tv_sec=0; settitimer(TIMER_REAL,&itival,(struct itimerval)0); /* Ò Ê 7 Ë*/ ÿ7 Ë õy½Òʂ7 Ëñ itival.it_value.tv_usec=0; itival.it_value.tv_sec=0; settitimer(TIMER_REAL,&itival,(struct itimerval)0); -32- 2 q@±ËÑ*¾ˆ…æ Yg*„Þ$@*ˈãÌæòë“eˆÑäˆ[íïo ävûëÑqH''Ñä89ˆ²*ûïo…æ-?Ô‚x¬ˆ* „íïoävª‹æwñC#ˆ*„ë´5|æ*„;¿ T5ð‚ x(œˆB*ûG|æë`¿æ9‘gˆ;¿í ± UNIX *„7S ëؓeˆ Pipes| Y¸89ˆ* ûËæòí-Lˆ FIFOsfirst in first outëŸR1wÓ| Name Pipesæ9ˆ Pipes T¿Þãˆ@*˅æ'îTÙÑ9҅æˆR ‚ëÙ¸ FIFOs Ÿ€y*„Ĉ‚xëHcªÌÃãˆ@* öH'c‹í - UNIX-Domain Sockets   FIFOs ã̈ÝÞ$öyÞ*„ ēe‚xF–ëZÃãˆ*¾µ@…æëTy FIFOs c‹ˆï ŽûíUNIX-Domain Sockets õc‹ˆ Berkeley ’XªûgëYëŸ w¸ Socket ÑVí-@*Ëc‹ Sockets ˆæòæ›w¸#¬ Client-Server…# í Îhy System V ˆ–v IPC {ûëäàhyò閿 Massage Queues켋íâF Share Memoryìò Emaphore ù‚x IPC ?#ò閿켋íâFìòëöH‹‚Ñ;õž w¸ Identifier »™íïoäx Identifierëùx*¾`'GïŽx IPC ?#í x*„'¼]íâFShare Memory1*¾Ëˆ…æíÙ¸ Fork 7gˆÑx*¾ËˆNy(œˆë-Ñx*¾Ëˆ…æ`@ªÑ›P 5ífìc‹šJõ…òˆàVžë`æ€Ê‚*¾ pZ•" *¾Ëˆ…æí*ûc‹¼]íâFZäx@*G¼‹‚íâFëù x*ûö¿Žÿæ9xÚÉëHZÑ@*ÇËMñ÷òéí¼]í âFˆÇNòöïÞÄ>í Þc‹¼]íâFÇòëoẎªx identifierñ #define shmem_key ((key_t)9999) /*Ê÷ share memery ˆ key m*/ /*Éë¼]íâFëíâF¬²¸ 150ByteëõR¸ 666*/ UNIX if((shmem_id=shmget(shmem_key,12,0666|IPC_CREAT))<0) { printf("Error: Can not create share memery!\n"); exit(1); } -ïo shmat {ûëT5gÊ5è?K›ˆ identifierë`H'Ž ª¼]íâFˆF–ñ if((data=(int *)shmat(shmem_id,(void *)0,0))==(int *)-1) -33- { fprintf(stderr,"\nError: Can not get share memery address!\n"); exit(1); } Lëc‹ shmdt {ûgk¼‹K›ë5è?ñ shmdt(shmem); s –‹ïU [ 7SIdentifier Shmctl ™e4–‹ïô D^és+ï Proc 1 Shmget ¬»œ1–‹ïôD 71e4ôDï ?”Ж‹ïQ±¤ ^é˜7 Shmdt 7ã¸è Shmat Proc 2 Ð 10 ¼‹íâFc‹ðY£* [ UNIX ì SRV5 “eˆ Multithreadþ ˆûëÞùx Thread Ę¼‹ã̈íâF *„N„ëìŸá—ˆ‡]íâFó“Ë W5ˆÃÌ*¾ÇÄòéñ÷ˆ‘ëŸÑ‰g*ûH'äxÒ ?í 3 j‹ Xt Intrnsics ãF·wiã̈·Y ßü Ñäˆ X-Window ÿ‹*ûò·Rg5c‹šˆZ°ëWƒ -34- [ÿ‹*ûoá°x+·YíXt Intrnsics ãF·w“eˆ‚[ ͈ Z°nñëä[Þ Xlib ÄWÓeˆZ°·Rëünˆ*ûÒ7Úc ‹Z°à« ‚g·RT/·Yí Xt Intrnsics ãF·w“eˆÊ rTimeOutˆªœR*¾ ·RëZ*ûÒ7Ú˽ý$·RÒÊîF *„ˆ7 ˈòég YR ·Rñ time_video=XtAddTimeOut(1000/video_rate,video_grab,win_main_fra me); /*\Q‚xR 7 ËëW{΀ªœR* ¾ video_grab ™*/ ´R ·R*¾q@°ÇLëe5Fk7 ˈÒÊí y5 ½rÇòk7 Ëõyc‹ XtRemoveTimeOut {ûñ if(time_video) XtRemoveTimeOut(time_video); ãF·w¤“eˆ!V UNIX *„œRÄ fork ˆ*¾· Rûëcw¸·Y*¾Work Procdureí·Y*¾ÙÑí‚x ªœRWð*ûÒ7ÚݍZ°·Rˆ‰æí‚x·Y*¾yŽ Xt Intrnsics ÞûßÎZ° rˆªœRíÿ‹*ûH‹'—ûí ‚x·Y*¾ñ Net_Procid=XtAddWorkProc(Net_Proc,shell_main); /*¸ shell_main |Rù‹Cœ‚x·Y*¾ëWè΀ Net_Proc *¾*/ -5t‚x·Y*¾õj‹Cœ YŠˆ·Y*¾ IDñ Xt Intrnsics XtRemoveWorkProc(Net_Procid); ãF·wޅ.VŸ“eˆ¼æð@….ù‹ëä[ ù‹data+i)=*(bttvbuffer+i); ‰p ´9KNۀ‚xHÛK˙ëä0yۀ‚ x….Ǚ*/ ì뎈p´`;ˆ@™ÞröǙˆó 6$*û?ëÇ ëT5‹ close {ûgÿ…òŽ/ó`H 'ˆñ XPutImage(Display,Window,gc,videoimage,0,0,0,0,255,255); /* close(grabdev); -38- Start ”Éë /ó Open ëÒÊ ÒMž ioctl ”Ž p´ ioctl ”‰ p´ñ˜€r ö™ XPutImage ÏÕÔÄ=. ›Æ QåC C D]â¨t ]÷± Ð 11 …òp´NŽ£*Ð yòÖZNˆŽñx*„c‹ˆyZ×F*û/óy$ /dev •¬Äˆ dsp   mixer ëävxyŽ Linux *„xA “eˆZ/óíDsp <ˆyZˆŽ£ìŽ£ÅNÒÊìygžùùù 2ëîyZˆ¬Ðî•"ímixer ¸.ZËë‹gJõZ/óˆ˜7 ŒŽ£yZ¥B¬²í cˆMžìN?#»Ç¸ëÉëc‹û  …òŽÑ›!VëÃocT5ïo read   write {û`¿i€¬Ð  •"ˆ7íÉëûŸyc‹ open gÉëZ/óñ if((AudioDev = open ("/dev/dsp", O_RDWR | O_NONBLOCK)) < 0) { printf ("Failed! Couldn't Open Audio Device!\n"); return(False); } ÒÊyZŽ£ˆK›¬²ñ temp=10240; ioctl(AudioDev, SNDCTL_DSP_SETFRAGMENT, &temp); ÒÊyZŽ£ˆ‰ë½¬²ëä0Òʸ‚x byteñ temp=1; -39- ioctl (AudioDev, SNDCTL_DSP_SAMPLESIZE, &temp); if(temp != 1) { printf ("Failed! Couldn't Set Sample Size!\n"); close(AudioDev); PlayAudio=False; return(False); } ÒÊyZˆŽ£ÅNëä0Òʸ 8kHzñ temp=8000; if (ioctl (AudioDev, SNDCTL_DSP_SPEED, &temp)) { printf ("Failed! Couldn't Set Sample Frequency!\n"); close(AudioDev); return(False); } ÎhyÒÊ.ZËëÉëû  dsp /ó‚£íWy.ZËT Þ yÐCSound BlasterPro w'™À “eëì7 /óëõy c‹ dsp /ógJõZ½ñ Mixer=open("/dev/mixer",O_RDWR|O_NDELAY,0); if(Mixer<0) Mixer=AudioDev; c‹ ioctl gÒÊZ½ˆ¬²ëxÄ MIXER_WRITE g75JõZ ½ˆygëVolume ¸Z½ˆ¬²ñ ioctl(Mixer,MIXER_WRITE(Channel),&Volume); ìëŠ/óˆÒÊ`€°ˆëx ˆÒÊìygžìŽ£ò éK¬²õÜd‘gÒÊmëÃGêFí yZˆ˜7î¬Ðïo read   write {û‰yZN˜7€5Yë ÿ¬Ðæï€9KÄñ write(AudioDev,AudioBuffer,1024); read(AudioDev,AudioBuffer,1024); -40- Start ”Éë /ó Open ëÒÊ ÒMž ioctl ”Žy ZN ioctl Z/ó " Ð 12 yZNŽ•"£*Ð -41- ”‰yZ ñ˜€5Y Write 2.4 *„q@£* Þ X-Window @ӗëFx*„ë*„ºº¿æMžîÒê9ë ´¨ÛŠõµŒ¨Û·R*¾í-´¨ÛH'c1ÿyWÃP5ì ûZÿ CCDõµŒ*„ë*„q@ õ'ÿä[Òˆz`— q@ëxõõ}Éí´µŒ*„õeà7žx(œˆ*¾'·R’XN ñ˜ìpZNñ˜ìpZ•"ʂîc‹š˜Œí´€c‹š} Éòéõ}Éx*„í XWindow Ó- é w9 4 C&r›’ Ó-¤é ¾¿&r ch Ó-chÓ “ Q„s+Óg `ûÓg g s+Óg± Ð 13 *„q@£*8Ð -42- Q„ÞȨlùÞ ¾¿ [é …òª‹ˆq@£* …òNÎ 1) x*„Ä…òª‹ˆ{ûq@yŽ7 ËëFëx*„¸…òª ‹{ûó7 ËyÜdZV¿ùõ@™ 20 x FrameíWyÞ ‚ʺ`—ë Ñäû[š±ˆf]Šëfì’Xˆøü ëZ Vˆñ˜NU\ðÿy’X ]_ØëZ’Xˆñ˜ˆNðõðÎ 6yYg*„‚ N„Րë1ýíâFó›ˆFYZ*„-œí 5üyû[i€R:ˆê\éBë-þˆz``y…òª‹|q@€ B*û‚AëWy7 ˈò•½þ‚…òª‹{ûˆq@í ÙëÞ{ûq@ˆÉ¿Ç·ë`5Ž{ûyx¹íq@ˆí x*„y݋‚xÀóˆi<9žgí¬•òª‹{ûˆq@º Åë*ûÞÉ¿q@ Øi9žyxÒʸvë y¸vˆõ}É ª‹{ûˆq@í {ûÊ Ù¬’XgˆN"ŒÉëˆ XIamge N9K Äë½@™€röǙí 7 ˈÒʸñ signal(SIGALRM,grab); /*ÒÊ7 Ë*/ timev.it_interval.tv_usec=1000000/20; timev.it_interval.tv_sec=0; timev.it_value.tv_usec=1000000/20; /* 20 timev.it_value.tv_sec=0; setitimer(ITIMER_REAL,&timev,(struct itimerval *)0); Òʸùõ x frame*/ ª‹{ûĈ'Ð*ûï¸ñ theImage->data=videobuffer; /*‰ÛÐ9Kg¨g€Îò{ …òp´Nˆp´9K*/ /*‰ÛÐ9KˆNfÛ$röǙ*/ XPutImage(theDisplay,theWindow,gc,theImage,0,0,0,0,255,255); -43- Ž7 ËòëF p´NŽ{û Start y }É{û iyxPµŒ x €X I m a g e ˆ ÐÅN9K Ž’Xò{ ñgÇ …òN ‰X I m a g e 7 @™€rö™ Ð 14 …òª‹q@£*ÐÎ{ …òNñ äx{ûˆq@rû ÇòÎ{ˆ{û‚£ëÃ̈T ÞðNˆ·Rëä0yŽŽ¨< CCD p´9ÿËñŒˆNë žFæLñŒ’XN9Kë2y’Xª‹ˆññ ioctl(grabdev,BTTV_GRAB,&videobuffer); /*‰ CCD ŽˆN €íâF9KÄ*/ -44- Ž7 ËòëF NŽ{û Start CCD y }É{û iyxPµŒ x Ž’Xò{ ñgÇ …òN Ž…òN ‰ŽN€ ’Xñ9K Ð 15 …òª‹q@£*Ðñ{ yZª‹ˆq@£* 2) yZª‹{ûˆrûòV‚£ëWyÃ̈ÝÞ$cˆÎ { {ˆ{ûy‚£ˆíٸޅòª‹Äëñ{Î…òp ´y*ûðp´ŽC1ŽFYëÎ{üyïo X-Window {ûœ R뉅ò9KˆNfۀröǙí -yZª‹Ž ¬ÐyZˆFYöyïoZC/óë¬ZC /ó1ŽˆFY¸yZˆ¬Ðë-ðZC/ó1aŒˆF Yõ¸yZˆ•"ëyZª‹{ûˆ*ûì—ñ read(audio,recvbuf)1024; /*ŽyZˆ˜Œ€9KÄ*/ write(audio,sendbuf,rval);/*‰Ž’Xª‹Ž€ˆyZN•"7 g*/ -45- Ž7 ËòëF yZNñÎ{û Ž’Xò{ ñgÇ yZN Start iyxPµŒ x y €5Y˜7 ‰c\˜Œˆ yZŽ6›9K }É{û ‰yZN€ ’Xñ9K Ð 16 yZª‹q@£*Ð ’Xª‹ˆq@£* 3) x*„‰’Xñ˜ª‹ /óN‹àÉgë/ó ‹T|‰ŽˆN€’Xñ9KÄëW‰’XÎ9KˆN •"ÿ@™7gëÃGRe’Xˆñ˜í-’Xñ˜ª‹ŸT|N ޒX™ˆñ÷ëÃRe/óˆïŽí 䣈̻ûëH'Þö*„ˆ;~BëZà·9¡æëêH' Zq@ˆNÃÙoäû†ˆ2H-í/ó‹ŸT5ÞëØ ’Xª‹Î°‚4Në`H'‰ä´N•"ÿ@™7gí-’X ª‹T5Þ/óŽ°‚4NL`H'É¿‰Nñ€’XÇ ™í ’Xª‹ˆ*ûì—ñ if((rval=write(clientsock,sendbuf,1024))<0) /* a Œ 1024Byte € socket Ä*/ { fprintf(stderr,”ERROR:Can not write data!”); } if((rval=reade(clientsock,recvbuf,1024))<0) 1024Byte*/ -46- /* ¬ socket Ž { fprintf(stderr,”ERROR:Can not remote data!”); } if(rval==0) { fprintf(stderr,”ERROR:Connect break!\n”); return; } Ž7 ËòëF ’XNñÎ{û Ž’Xò{ ñgÇ ’XN Start iyxPµŒ x ‰’XN€ ’XÎ9K y }É{û 2.5 *„;¿ ‰’Xñ9K N€’Xí{ Ð 17 ’Xª‹q@£*Ð x*„š7“e—A;¿ñ ˜ ò¦kDe‘­£BñMŽ’XZkÚ g²Hïo…ò/ó  c\gi€ò¦e‘­£Bí ˜ äUF ™éÙ­ôñïoò¦…òesˆTûëîkÙN ˆñ˜H'Zà]kÙNëµ-µ@éو·Yí ˜ ”®’?e9'î ™î£Bñ‚{c‹šH'c‹¬Þr ö™ÛÐÿ¨™Në-S‚ˆc‹šˆröõHÌ ïÿ ?7íZ…æˆNòéê¿°Jí ˜ kÙNæïîñ˜ ˜ ‘ínàB -47- 3.1 *„ëY?7 z– ygë)Ò *„q@ˆûŸvvë‚vy‹Î$¥.¿—q@*û ë‹Î ‰è F–ìZ½¬²ìŽ£ÅNùùù2'MžˆûÎÞq@*û LVíìñ A. mmds –server 9999 B. mmds 140.134.28.73 9999 »™Y¸R1{ˆ# ëx2Hc‹šè ˆ Port ¸ 9999í »™3{ˆ# q@*ûëèê# Fó 140.134.28.73ëPort ˆäUFò¦kD*„R1{í *„ˆMžq@û¸ mmds [Address][Port][Option]ë8‰ˆMž [Option]ì—ñ -server [Port Number] ÒʸR1ËëW!ÒÊ Port ¸ [Port Number]ëÚʸ 9999 -sample [Number] ÒÊp´Ž£ˆ frame žëÚʸ 20ëÒ ÊmH¸ 5-30 -value [Number] ÒÊZ½ˆ¬²ëÚʸ 120ëÒÊmH¸ 0-255 ˆõžm -help @™Mž“™ S‚vq@[¸‹Î˜Œ mmdsëº'šÒmëFë½';¿a ¿gÒÊq@ˆûîMží*„$röˆq@?7ìÐ 18 ™ëJ ™8ˆ….¸#….Main Windowë‹g@™#5…òVNî x+kÙp´Ðë•ò*„“eˆ…òp´ˆ@™ëî‚ÊÀp´ ˆ@™ëx+5T/kDÒˆp´Nìb֋ÐÅìÿ”Ðì X ·ëõyx7‰go‘ˆÒíg™8¸òé…. Message Windowë‹g@™*„YŠˆòéîv͌ˆ£BN íJ—ˆ….¸·w¿….ToolBarë<ˆ*„“eˆ; ¿ñ A B 9999 ´c‹ša—a¿ `H' ò{ˆc‹šè ëÿyޓ™{ Ǘ:Œò{c‹šˆF–  Portë*„`e5F ò{ˆc‹šC œè í -48- a¿y‹gêæ*„ˆÒÊmëìyZˆŽ£ÅNìyZZ½ˆ ¬²ì…òp´ˆ frame žùùù2íÿy-ìëFyZì…òÒ ˆc‹í a¿Zc‹šÄ•òˆè ëWH½c‹òVˆè a¿gµ @­S‚{ˆè í a—a¿rx*„ˆq@í*„‰ÿ….ì€"óˆ N„ëWڀq@ˆ Shell Äí‰Ê‚õ£ÂF X-Windowí -49- Ð 18 *„q@ÖVÐ -50- 1 5 6 7 8 3 2 4 Ð 19 *„….àÐ c‹ša—Ð 19 Ĉ/50è a¿Lë*„aS7ì—Ðˆè žßð@….ë‹gÒÊè ˆF–îè ˆ Portëè F–¸ò{c ‹šˆ# F–ë- Port ¸ò{c‹šÒʸ server ʋg2H c‹šè ˆ Port ïí Ð 20 è ð@…. c‹ša—Ð 19 Ĉ/60*„ÒÊa¿Lë*„aSìÐ 21 ˆ -51- *„ÒÊð@….ë‹gÒÊ*„Ĉ‚ÊMží Ð 21 *„ÒÊð@…. Message WindowÐ 16 Ĉ…./40ë´c‹š$äx….a —±MaÍëöe‹Îïw$….ÄìÐ 22ëW!$ò{@™ 7gë*„W5Fün¨+y£‚ñgˆòéíìò{õ¨+ RemoteëxÝ{õ¨+¸ LocalëòéÎ$xLí-´*„YŠ±Mÿ 7æŒc‹šˆòé ëŸeYŠ$….ÇÄëW¨+¸*„òéí äx….ˆ‹óǂÞ$c‹š yû['c\…æì/óq ÿ©öËîÿy‰Sg²ëŸH'ïoF͌ð@òég…æí •òx*„ÏT™%ˆò阌ë‰g½ÿ½`²:ŒÄ˜Œî Äa?ˆ;¿ Ëîë'±¿i€ê؈˜Œ@Óí Ð 22 òéîð@…. ´c‹š$ MainWindow ÄJˆ®….ìÐ 19 Ĉ…. 3a —¬JÍë*„r|aS7ìÐ 23 ˆÐÅ`Œð@….ëäxð@ ….ryc‹¼æð@….ª‹ÐYˆíð@….ĈyÅKh¸î ëZc‹šžŽ@™$rö™ˆkÙp´NíÐÅN Fó(•òT™ P6 (ûˆ RAW DATA ÐÅN)í´c‹ša— OK a¿ëÊÇLër‰ÐÅ`ŒëW@™$rö™ MainWindow ÄJ ˆ®….™ í -52- Ð 23 ÐÅÉëð@…. ´ÐÅ@™$rö™ÇLë*„e5@ê\’Xí{c‹šˆr öíc‹šH'Ì wï\ˆNí-´c‹š$®…. 3 aG¬gÍ ëH'$Ðř 75<ˆ ë!V5?4ˆ ;¿ ëZc‹š:†ÐÅ (ìÐ 20 ™)ía—¬ÄÍõH‰:† $Йˆ %Õë'Ø`²ˆïLÿwïí -53- Ð 24 c‹š:†N$ÐÅǙ -54- 3.2 ygë)Ò äUFò¦kDe‘*„€ÅǺøÌ» äUFò¦kDe‘*„Ä &FÒ…Ò äUF&F/ó$ UNIX —ˆNïŽëÑV*ûÇëSë