Transcript
ð ¬ Ù
Nò·*Ù*K KhX@Óÿ$ò¦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) vZò 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:
òïd4[ë'±¿ð 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ÿêäKhX (LAN)ë-ùxKhXõöÆY| Rë'±¿ì ATM KhXÊe]æ1DÜõí» 10.1 ð H.310ìH.321 H.322 2¨YnZí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 Ì£YnAõRí d) H.323ñ*¿¨$ 1996 ú>ªØHë#5y H.320 ¨ Í<KhXì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)Ø°ë'ÙÑKhX|RY] æ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äxcH'Ì'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Åe2AllinakD VTEL about Engineered for Doctors)
-13-
Ü3F*ëØeVTELF.R.E.D ðQ1DeëAllina +dli÷¹ïÜ3{À (Rural Health AllianceðRHA) ¹íÔY¼ Ì
#xò¦kDXë'±H'Mð¼ÌkDGÿgfY Íïfð1998úºAllinaRHA¹
Ò19±VTEL® 227*í 'ÿg²O¸fëF$Minneapolis3Äÿÿô#fkÚí
òes
#ðÑGÞ¹g²Y3ëig²3º `yxH'ó»ÝMinneapolisYDë' Ýðg²eÍ ó»D1DíS]½'/ff¸fÜ+
òeseëF ² /f²!/$¹ëòÿ1o½çÁ -9Ãuë²/}ze
òes
#Z²/Y½ë }zW!5økkÚª·gë;Ýjè²/ ¥íÞx+ìé22ÿëAllinaexVTELXðÎ5î8 zé2æYm¹ÝëW!ðÑäò¦kDGeé2 1Dí ÞSÕkDÜ3Vë¶hæòËîµøëò¦kDëî P5û¢g¢P
íò¦ÃîkÙp´ñæï* Picture Archiving and Communication System, PACSëöyòkÙ Ñ?ÔäUFìFp´·RNòX7íÞkÙÑäV HMäUFÿXínikDNòõÔîñíx*?Ô p´
òìÑ!kÙNì X ·ìbÖìm¼øïpì £ZYp´ìg »ïoXñëÆìkzSHëiò¦ kDÿeí TM
-14-
2.1
*õF
#
z *@Ó
xx7Ä*MXõ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±M1DfÎëæ áÑV1D;óí `@
½nÃ
!3=° ,;
ÝÀ=°
CCD
!Ô=°
¨J²
qd²
í{Â 6U
!3=°
4t
v
Ð 4 *
#Ð
-15-
2.2
&F
#
x*Mc\îZCÔgcÖZë½ cÖZïo5Yg7íCCD Þ*Ä;Ùp´ùýëp´ Cg5 CCD òNTSC ÿ PAL òëWxf¸ 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ëÒgc
òí 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ñgcZòî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
yxvô´#XÛÒ Window *ëäv xô´¸R1ËServer 3ClientíR1ËÊ@röë3 õ¸ÑßìÐÅ Ëìî Ëì½Ëùùù2ÿ*ûí3 5ú¸R1Ëe1DëìÉëx Window WÛ7g ÿa 7î`yv1DíTR1ËÀ @röë3æoè æ ¸Xè R1ËæòíÙëX-Window *ûzøyoá R1ËCXè ñ 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è ® íä[Ïbg» Ëèì@bîV¹ûí R1Ë 3ÿ*ûÇËæòyïoR1ËÒ3 ÿ*û/Z°0gµ@íR1ËYZ°Y¸c@¸Î ÿËÎ?7fìÞÍãaxaÍìtF¬ÿya¬a¿í R1ËHYZ°gæ3x Window zæ9ífì´ Window ÚÉ5WqëR1ËÒ3³ÒExposeZ°í X-Window 33 vZ°ëWeÙÑÑcÊ÷x+Z°! í R1ËïoÙZ°"Þ3HH¿ÄÙZ°7Gí¬ô à X-Window ÿ*ûyZ°×FíÒ7¸2HZ°ì7Z °ÚÿëW2HxZ°ªûíZ°×F*û¸£Bûÿ*û ex5üªûí
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 1cÖVùgC cÖVíä[ùÄícÌÂ5CxvôMask ëg X-Window c?#Ä£[ô´í æCx
.û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-
ä0MyÒÊ
./
.0ë*ûzxC
.y /
.0Ù¸c¹yb
.ëqMÒ¸
.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
.Lrc"ÕíHM XDestroyWindow {û" Windowñ XDestroyWindow(theDisplay,theWindow);
-26-
chX ¨4Ó ¤
r.×
ìEV X 1w {sScreen D e p t h
OpenDisplay Server
{s.×F¤ ìE.× rÍ B
w9W i n d o w 1 g ±mw¯.×1 `ûÞ£ èVÙ1w&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ÉíAwåùxZ°!ëWìZ°òégq @[FYíì7ÿ*ûyäx Window ë*ûõ5ëÊZ° yÞ£x Window ÇÄí -ðä[ä Window ÿ*ûgÜë/Switch00yÑÞ Æ-!;~ëäð*ûÒ7ÚgÜë*ûÒ7 ¿öyxÑ ·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·wcnxøf¸ñ -27-
º¿æ ·wí½äxøfÄ C R1ËèÎíàNWº¿æ bñ º¿æ ëWCÊb|Rù n=0; /*Òʺ¿æMmFrÉëSxb|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À¿'ù`²Cx+Ø°ù ¸
Éëxb|Rù
b) Cùí*ûÒ7ÚÞÿ*ûÄCxÿä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); /* */
Þ
Cx
ÞC
xÛÐKh
ù
ùC
ÒÊùFó
ÞùCxË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
.ÄCxÛÐKËù
Y¸NÐÅ7Ç
Ë
ÞC
¸òé
.bùCxîK
¸·w¿
.bùCx 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ëSFYë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*¾ëÿyZ°Þùãè Ϊ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ëWg êcT/aÍòéí ÞcË7ËgYR·RëÑq itimerval ?#gA 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Ë`epp©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|æë`¿æ9g;¿í ± 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Þ* ÄexFë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ìcJõ
òà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' ª¼]íâFFñ 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 ÿ*ûò·Rg5cZ°ëW -34-
[ÿ*ûoá°x+·YíXt Intrnsics ãF·we[ Í Z°nñëä[Þ Xlib ÄWÃeZ°·Rëün*ûÒ7Úc Z°à« g·RT/·Yí Xt Intrnsics ãF·weÊrTimeOutªR*¾ ·RëZ*ûÒ7Úýý$·RÒÊîF *7Ëòég YR·Rñ time_video=XtAddTimeOut(1000/video_rate,video_grab,win_main_fra me); /*\QxR7Ëë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ùCx·Y*¾ëWèÎ Net_Proc *¾*/ -5tx·Y*¾õjCY·Y*¾ IDñ Xt Intrnsics
XtRemoveWorkProc(Net_Procid);
ãF·wÞ
.Ve¼æð@
.ùëä[ ù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*cyZ×F*û/óy$ /dev ¬Ä dsp mixer ëävxy Linux *xA eZ/óíDsp <yZ£ì£ÅNÒÊìygùùù 2ëîyZ¬Ðî"ímixer ¸.ZËëgJõZ/ó7 £yZ¥B¬²í cMì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¬²õÜdgÒÊmëÃGêFí yZ7î¬Ðïo read write {ûyZN75Yë ÿ¬Ðæï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à7x(*¾'·RXN ñìpZNñìpZ"Êîcí´c} Éòéõ}Éx*í XWindow
Ó-
é w9 4 C&r
Ó-¤é ¾¿&r
ch Ó-chÓ Qs+Óg `ûÓg g s+Óg±
Ð 13 *q@£*8Ð
-42-
QÞȨlùÞ ¾¿ [é
òªq@£*
òNÎ
1)
x*Ä
òª{ûq@y7ËëFëx*¸
òª {ûó7ËyÜdZV¿ùõ@ 20 x FrameíWyÞ Êº`ë Ñäû[±f]ëfìXøü ëZ VñNU\ðÿyX]_ØëZXñNðõðÎ 6yYg*NÕë1ýíâFóFYZ*-í 5üyû[iR:ê\éBë-þz``y
òª|q@ B*ûAëWy7Ëò½þ
òª{ûq@í ÙëÞ{ûq@É¿Ç·ë`5{ûyx¹íq@í x*yÝxÀói<9gí¬òª{ûq@º Åë*ûÞÉ¿q@Øi9yxÒʸvë y¸võ}É ª{ûq@í {ûÊÙ¬XgN"Éë 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´Np´9K*/ /*ÛÐ9KNfÛ$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ë2yXªññ 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´C1FYëÎ{üyïo X-Window {û Rë
ò9KNfÛröÇí -yZª ¬ÐyZFYöyïoZC/óë¬ZC /ó1FY¸yZ¬Ðë-ðZC/ó1aF Yõ¸yZ"ëyZª{û*ûìñ read(audio,recvbuf)1024; /*yZ9KÄ*/ write(audio,sendbuf,rval);/*XªyZN"7 g*/
-45-
7ËòëF yZNñÎ{û
Xò{ ñgÇ yZN
Start
iyxPµ
x
y
5Y7 c\ yZ69K
}É{û
yZN Xñ9K
Ð 16 yZªq@£*Ð
Xªq@£*
3)
x*Xñª /óNïªàÉgë/óïª T|NXñ9KÄëWXÎ9KN "ÿ@7gëÃGReXñí-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 NXí{
Ð 17 Xªq@£*Ð
x*7eA;¿ñ ò¦kDe£BñMXZkÚ g²Hïo
ò/ó c\giò¦e£Bí äUF éÙôñïoò¦
òesTûëîkÙN ñH'Zà]kÙNëµ-µ@éÙ·Yí ®?e9'î î£Bñ{cH'c¬Þr öÛÐÿ¨Në-Scröõ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{í *Mq@û¸ mmds [Address][Port][Option]ë8M [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 Svq@[¸Î 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 ·ëõyx7goÒî¨íg8¸òé
. Message Windowëg@*YòéîvÍ£BN íJ
.¸·w¿
.ToolBarë<*e; ¿ñ A B 9999
´caa¿`H' ò{cè ëÿyÞ{ Ç:ò{cF Portë*`e5F ò{cC è í -48-
a¿ygêæ*ÒÊmëìyZ£ÅNìyZZ½ ¬²ì
òp´ frame ùùù2íÿy-ìëFyZì
òÒ cí a¿ZcÄòè ëWH½còVè a¿gµ @S{è í aa¿rx*q@í*ÿ
.ì"ó NëWÚq@ Shell ÄíÊõ£ÂF X-Windowí
-49-
Ð 18 *q@ÖVÐ
-50-
1
5
6
7
8
3
2
4
Ð 19 *
.àÐ caÐ 19 Ä/50è a¿Lë*aS7ìÐè ßð@
.ëgÒÊè Fîè Portëè F¸ò{c # Fë- Port ¸ò{cÒʸ server Êg2H cè Port ïí
Ð 20 è ð@
. caÐ 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 ÿ©öËîÿySg²ë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)í´ca OK a¿ëÊÇLërÐÅ`ëW@$rö MainWindow ÄJ ®
. í -52-
Ð 23 ÐÅÉëð@
. ´ÐÅ@$röÇLë*e5@ê\Xí{cr öícH'Ì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ë