=±MÃD=
Multicast
& RTP §Y®É¼vµ¶Ç¿é
¥Ø¿ý:
-«e¨¥
-Framework
-Microsoft Direct
Show
-Filter»PFilter Graph
-¨Ï¥ÎDirectShow
-DS¾ãÅé¬[ºc
-DSªº¼u©Ê
-COM (Component
Object Model)
-Multicast
-RTP/RTCP
-¦h´CÅéÀɮ׮榡
-¨t²Îªì¨B¬[ºc
-¨t²Î³Ì«á¬[ºc
-¨t²Î¬[ºc¹Ï-- DirectShow Filter
-¶Ç°eºÝScreen Shot
-±µ¦¬ºÝScreen Shot
-«á°O
-°Ñ¦Ò¸ê®Æ
-§ë¼v¤ù©Mµ{¦¡½X¤U¸ü
¡» «e¨¥
¦¹±MÃDªº¥Øªº¬O±N»·ºÝCCD»PMIC¨ú±oªº¼v¹³»PÁnµ,À£ÁY¦¨MPEG4
(Divx)®æ¦¡¡A¥HRTP³z¹LMulticastªº¤è¦¡¡A§Y®É¶Çµ¹¦h¥x¹q¸£,¹ê§@¥¥x³£¬OWIN32 PC,³Ì²×¥Ø¼Ð¬OÅý±µ¦¬ºÝ¤£©óWIN32 PC,¤ñ¦p¬OWinCE
PDA¡BLinux PDAµ¥µ¥,¥Ø«eªº¥¥xµÛ«©óWIN32 PC¡C
¾ãÓ±MÃDªº¦¨ûÁ`¦@¦³¤¤H,¤u§@¤À¦¨¤T¤j³¡¤À,¤À§O¬ORTP¤p²Õ¡B¦h´CÅéÀɮ׮榡¤p²Õ¡BMicrosoft
DirectShow¤p²Õ,¦Ó§Ṳ́p²Õ¥Dnt³dªº³¡¤À¬OMicrosoft DirectShow³¡¤À,Áö»¡¤u§@¬O¦p¦¹¤Àªº,¦b³\¦h¤è±¤´¶·¥h¬ã¨s¨Ã¤F¸Ñ,§_«h¹ê§@¥Xªºµ{¦¡¼Ò²Õ¬OµLªkµ²¦Xªº¡C
¡» Framework
¡» Microsoft Direct Show
¼·©ñºÝ»P¶Ç°eºÝ¼vµÂ^¨ú§Þ³N¥Dn¬O±ÄMicrosoft Direct Show¹F¦¨,
Microsoft Direct Show¥]§t¦bMicrosoft DirectX¤§¤¤,n¶}µoµ{¦¡¤§«eº¥ýn¥h·L³n©x¤èºô¯¸¤U¸üDirectX SDK (¥Ø«e¬O±Ä8.0a),¾ãÓSDK¤¤¥]§t³\¦h»¡©ú¤å¥ó»Pµ{¦¡½d¨Ò,¤j³¡¤Àªº§Þ³N¤ä´©³£¬O±q¦¹¨ú±oªº¡C
Direct Show(«á²ºÙDS)¾ãÓ¬O¥HMicrosoft
COMì¥ó§¹¦¨,DS¥i¥H»¡¬O¼ÆÓCOMì¥ó²Õ¦¨,¨Ï¥ÎDS´N¬O©óµ{¦¡¤¤²£¥Í©Ò»ÝªºCOMì¥ó,¨Ã¹ï¤¸¥ó©I¥s©Ò»Ýªº¶}©ñ¤¶±,¥H¤U¶}©l¤¶²ÐDSªº²Ó¸`³¡¤À¡C
¡» Filter»PFilter Graph
Preview
¦bDS¤¤³Ì°ò¦ªº³æ¦ìºÙ¬°Filter,¨C¤@ÓFilter¥Nªí¹ï¦h´CÅé¸ê®Æ¶i¦æ¤@Ó³B²z¨BÆJ,¦bDS¤¤¦³¤TºØ«¬ºAªºFilter,¤À§O¬°Source
Filter¡BTransform Filter¡BRender Filter¡C
Filters
Source Filter¥Dnªº¤u§@¬OŪ¨úRaw
Data ; Transform Filter¥Dn¤u§@¬O¨ú±oSource FilterªºRaw Data¨Ã¥[¤u³B²z(³q±`§êºtDecoder¨¤¦â),Render
Filter¥Dn¤u§@¬O¨ú±oTransform Filter³B²zªºRaw Data¨Ã¿é¥X¨ì¾A·íªº¸Ë¸m(¤ñ¦p¼g¤JÀɮסB¿é¥X¼vµ³]³Æµ¥µ¥),¨äÃö«Y¹Ï¦p¤U¹Ï©Ò¥Ü:
Filter Graph & Filter Graph
Manager
¥Ñ¦¹¤TºØFilter¶¡²Õ¦¨ªº¹ÏºÙ¬°Filter Graph,´N¦p¤W¬yµ{¹Ï¤@¼Ë,¦Ó¦bDS¤¤¥Dn´xºÞ±±¨îFilter GraphªºCOM
Component¬°Filter Graph Manager¡C
Filter component
¦UÓFilter¦bDS¤¤¬O¥HCOM¹ê§@,¦]¦¹§Ų́ϥÎDS´N¬Û·í©ó¦bµ{¦¡²£¥Í²Å¦X»ÝnªºFilter Component,¨ä«á±NFilter²Õ¦¨¤@ÓFilter
Graph,³Ì«á±±¨îMedia Streamªº¬y¦V´Nºâ¤j¤½§i¦¨,¤ñ¤è¦p¤Uªº½d¨Ò(¼·©ñAVIªºFilter Graph):
Summary
³z¹LFilter Graph§ÚÌ¥i¥H²M·¡¤F¸Ñ¨ì¦h´CÅé¸ê®Æ¬O¦p¦ó³Q³B²zªº¡CFilterªº¬[ºcÅýÀ³¥Îµ{¦¡¹ï¦h´CÅé³B²z¯à¤O«Ü¦³¼u©Ê,µ{¦¡³]p®v¹³¬O¦b«÷¸ËGraph,«÷¥X¤@ӲŦX§Ú̦h´CÅé»Ý¨DªºFilter
Graph¡C
¡» ¨Ï¥ÎDirectShow
¨Ï¥ÎDSªº¨BÆJ¦b¦¹§ó¸Ô²Óªº»¡©ú¤@¹M:
STEP1
¥Ñ©ó§ÚÌ·|¨Ï¥Î¨ìCOM,¦]¦¹¤@¶}©l§ÚÌ¥²¶·¥ý©I¥sWindowsªì©l¤ÆCOM
LibraryªºAPI,µM«á²£¥Í¤@ÓFilter Graph Manager Component¡C
STEP2
¦A¨Ó§ÚÌ´Nn²£¥Í§¹¾ãFilter
Graph,¦Ó²£¥Íªº¤èªk¤À¬°¨âºØ,¤@ºØ¬O¦Û°Ê²£¥Í²Å¦X¦h´CÅ骺Filter Graph(¥ÑFilter Graph Manager¨Ó°µ³o¶µ¤u§@),¥t¤@ºØ¬O§Ṳ́â°Ê²£¥ÍÓÓ»ÝnªºFilter
Component¨Ã±N¹Ïµ¹«Ø¥ß°_¨Óµ¹Filter Graph ManagerºÞ²z¡C
STEP3
³Ì«áªº¨BÆJ´N¬O±±¨îMedia
Streamªº°Ê§@,¦¹®É»Ýn¤@ÓMedia Control Component¨Ó§@ºÞ²z,¨ä¤¤±±¨î¤FMedia StreamªºStop¡BPause¡BStart°Ê§@¡CÁÙ¦³Media
Stream¥i¯à·|²£¥Í¨Ç¨Æ¥ó(¦p¼·©ñ§¹²¦),³o®É§ÚÌ¥i¥H²£¥Í¤@ÓMedia Event Component¨Ó§@ºÞ²z¨Æ¥óªº°Ê§@¡C
¡» DS¾ãÅé¬[ºc
¤U¹Ï¬O¨Ó¦ÛDS SDK Document,¦b¦¹§ÚÌ¥i¥H§ó¤F¸ÑDSªº¤º³¡¬[ºc¡Cµê½u¤è¶ô³¡¤À´N¬O§Ú̵{¦¡©Ò¯à±±¨îªº³¡¤À,¤]¬O¤W¤W´X½g¤¶²Ðªº³¡¤À¡C
¡» DSªº¼u©Ê
DS¥»¨ªþ¤W³\¦hFilter,¦ý¤]¦³¥i¯à·|µo¥Í§ä¤£¨ì¦X¾AªºFilter¨Ó§¹¦¨§Ú̪º±M®×,n¬Oµo¥Í³oºØ±¡ªp§ÚÌ´N±o¥h¼g¥X¤@ÓFilter¥X¨Ó,¦Ó¼g¥X¤@ÓFilter©Ò¯A¤ÎªºI´ºª¾ÃÑÆZ¦hªº,¦b¦¹¦¸±MÃD´N¸I¨ì³oÓÀYµhªº°ÝÃD¡C°ò¥»¤WDS¥»¨¤w¸gªþ¤W¤@¨ÇBase
Class,Ä~©Ó³o¨ÇBase Class¨ÃOver Ride¤@¨Ç¤èªk´N·|¨Ïªº³oÓ¶}µo¹Lµ{®e©ö¨Ç¡C
¡» COM(Component
Object Model)
¨Ï¥ÎDS¥u»Ýª¾¦p¦ó¨Ï¥ÎCOM(Filter¥þ¬°COMì¥ó),¦ý¦pªG»Ýn¶}µoFilter´N¥²¶·¥h¤F¸ÑCOM,¨Ãª¾¹D¦p¦ó¹ê§@COMì¥ó,§_«h´N¤£¯àÄ~Äò¤U¥h,¦b¦¹Â²²¤»¡©ú¤@¤UMicrosoft
COM¡C
COM
COM¨Ã¤£¬O¤@ºØµ{¦¡»y¨¥,¤]¤£¬O¯S©wªº¨ç¦¡®w,COM¬O¤@ºØ³W®æ©w¸q,COM³W©w¤F»s§@¨ã¦³°ÊºA´À´«¯à¤O¤¸¥óªº¤èªk,¤]©w¸q¤F¥Î¤áºÝµ{¦¡»P¤¸¥ó¤§¶¡¦@¦P¦X§@ªº¼Ð·Ç¡C¨Ï¥ÎCOMÅýµ{¦¡Åܦ¨¬O¹³¥Ñì¥ó²Õ¦¨,µ{¦¡³]p®v³]p¥i¥H«½Æªº¨Ï¥Îì¥ó,¤é«án¬O³nÅé§ó·s¥un±N¶·¨O´«ªºì¥ó§ó·s,¤£¥Î¤j´Tקïµ{¦¡,Åý¤é«á³nÅéºûÅ@ªº¤u§@§ó®e©ö,´î¤Ö³nÅ馨¥»¡C
´N¦p¤U¹Ï©Ò¥Ü:
Application
쥻³æ¤@¿W¥ßªºµ{¦¡Åܦ¨¥Ñ³\¦hì¥ó²Õ¦¨,¦Óì¥ó¤]¯à¦b°õ¦æ¶¥¬q°ÊºA§ó´«,©Î³\¦³¨Ç¤H·|·Q³o¤£´N¬O§âµ{¦¡¤À¦¨´XÓ¼Ò²Õ,¦ý¬O¦bCOM¤¤A¡BB¡BC¡BD¡BE¬O¤@Ó¥i°õ¦æ¤G¶i½X(§¹¾ãªºµ{¦¡,³q±`¬ODLL),¦Ó¤£¬Ostructure
paradigmªºµ{¦¡¼g§@·®æ,¦Ó¦U¤¸¥ó³£¬O³z¹L¤¶±¨Ó·¾³q,µ{¦¡¥i¥H¦b°õ¦æ¶¥¬q§ó´«ì¥ó¡C
COM Component
COM Component¬OWin32°ÊºA³sµ²µ{¦¡®w©Î¥i°õ¦æÀɦs¦bªº¥i°õ¦æµ{¦¡½X,¥HCOM³W®æ¼Ð·Ç©Ò¼g¥X¨Óªº¤¸¥ó,§ÚÌ´NºÙ¬°COM
Component¡C
Summary
¦bDS¤¤©Ò¦³ªºFilter³£¬O¥HCOM¦s¦b,¦b¦¹§Ṳ́w¸g¥i¥H¬Ý¨ìCOMªº¤@¨Ç¦n³B,´N¬O±e¦³°ª«×ªº¼u©Ê¡C·L³nªº³\¦h§Þ³N³£¬O¥HCOM§¹¦¨,¦pOLE¡BActiveX³£¬O«Øºc¦bCOM¤W±,COMªº¥Øªº¬O¹F¦¨³nÅéIC²z·Q¡C
¡» Multicast
Preview
¦bºô¸ô¤¤ªº¶Ç°e¼Ò¦¡¥i¥H¤À¬°¤TºØ,Unicast¡BBroadcast¡BMulticast
,UnicastÄÝ©ó¤@¹ï¤@ªº¶Ç°e¤è¦¡ ,Broadcast¬O¹ï¾ãÅéºô¸ô°µ¶Ç°e,Multicast¬O¹ï¾ãÅéºô¸ôªº¯S©w´X¥x(Multicast Group)°µ¶Ç°e,Multicastªº¹ê§@¤]¥i¥H¾aUnicast©ÎBroadcast¹ê§@¥X¨Ó,¦ý¬O³oºØ¼ÒÀÀ¤è¦¡·|«D±`®ö¶Oºô¸ô¸ê·½¡C
Multicast±`À³¥Î©ó¦h´CÅé¤è±(¦pVOD),¦Ó¦¹¦¸ªº¦h´CÅé¶Ç°e¬O¥HMulticast¨Ó¶Ç°e,Åý¥[¤J¦PMulticast
Groupªº¹q¸£¥i¥H±µ¦¬»·ºÝ¦h´CÅé¡C
Mbone(Multicast Backbone)
Yn¦Uºô°ì¯à¦¬°e¥þ²y©Êªºmulticast«Ê¥]¡A´N»Ýn¨ärouter©Î¨ä¥¦µwÅé¤]n¯à¤ä´©multicast«Ê¥]ªºÂà°e°Ê§@¡A¦ýY¨äºô°ì¥u¤ä´©unicast¤è¦¡ªº¶Ç°e¡A³o®ÉÔY¨Ï¥Î¦h§}¶Ç¿é°©·Fºô¸ô(Multicast
Backbone, MBone)¡A«h§ÚÌ¥i¥HÂǦ¹¹F¨ìºô¸ô¦h§}¶Ç¿éªº¥Øªº¡C²{¦b¥@¬É¤W¤w¸g³\³\¦h¦hªºMBoneºô¸ô¡C¦]¦¹Mbone¤Þ¤J¤F³q¹D(Tunnel)ªº·§©À¡C¨Æ¹ê¤W¡AMbone¬O¤@ÓµêÀÀªººô¸ô°©·F¡AMboneÂǥѳq¹D±N¤@ÓÓªº¦h§}¶Ç¿éªººô¸ô(Multicast
Island)³s°_¨Ó
Multicast Group Address
Multicast Group Address©w¦bClass D IP,¦p¤U¹Ï:
Ipv6ªº®æ¦¡,¦p¤U¹Ï:
¡» RTP/RTCP
Preview
RTP°w¹ï»Ýn¶Ç°e§Y®É¸ê®Æªºapplication¡A¹³¬O¼v¹³¡AÁnµ¡A¼ÒÀÀ¸ê®Æ¡Kµ¥¡A´£¨Ñ¤F¦bmulticast©Îunicast¤W¡AÂI¹ïÂIªº¶Ç¿é¥\¯à¡C
RTP¨S¦³«O¯d¸ê·½ªº¯à¤O¡A¥ç¤£«OÃÒ§Y®ÉªA°ÈªºOoS¡C¦ýRTP¥i»P¥t¤@±±¨î¨ó©w(§YRTCP)µ²¦X¡A¨ÓºÊ´ú¸ê®Æ¶Ç¿éªºª¬ªp¡A¥H¤Î¼W¥[¤@¨Ç±±¨î»PÃѧOªº¥\¯à¡C
Application¤@¯ë³£¦bUDP¤§¤W¶]RTP¡A³o¨âªÌ³£´£¨Ñ¤F³¡¤Àªº¶Ç¿é¥\¯à¡QµM¦Ó¡ARTP¤]¥i¥H»P¨ä¥L¾A¦Xªº¤U¼hprotocol¤@°_¹B§@¡C
¦b¶Ç²Îªºprotocol¤¤¡AYn¼W¥[·sªº¥\¯à¡A¥u¦³±Nprotocol§ï±o§ó¤@¯ë¤Æ¡A©Î¬O¥[¤J¤@Ó»Ýn¤ÀªRªº¿ï¶µ¾÷¨î¡C¤£¦P©ó¦¹ªº¬O¡ARTP¥unקï©ÎªÌ¼W¥[header´N¥i¥H¹F¨ì¥Øªº¡C
²{¤µªºInternetÀô¹Ò¡A¨ÃµLªk§¹¥þº¡¨¬§Y®ÉªA°Èªºn¨D¡C¨Ï¥ÎRTPªº¼eÀWªA°È¡A¹³¬O¼v¹³¡A¥i¯à·|¼vÅT¨ä¥¦ºô¸ôªA°ÈªºQoS¡C¦]¦¹¡Aµ{¦¡³]pªÌ¥²¶·±Ä¨ú¤@¨Ç±¹¬I¡A¨î¦¸nªºªA°È§Q¥ÎÀW¼e¡C
¤@®a¤½¥qªº¦¨ûÌ·QÂÇ¥Ñmulticast¶Ç¹FÁnµªº¤è¦¡¡A¶i¦æ¤@³õ½u¤W·|ij¡C·|ijªº¥D®u³z¹L¬YºØ°t¸mªº¾÷¨î¡AÀò±o¤F¤@Ómulticast address¡A¥H¤Î¤@¹ïport¡A¨ä¤¤¤@Óport¬O¬°¤FRTP(¶Ç°eÁnµ)¡A¥t¤@Ó«h¬O¬°¤FRTCP(¶Ç°e±±¨îpacket)¡C³o¨Ç¦ì¸m»Pportªº¸ê°T·|¤À¥¬µ¹©Ò¦³·Q¥[¤J·|ijªº¤½¥q¦¨û¡C
¨Ï¥ÎÁnµ·|ijµ{¦¡ªº¤½¥q¦¨û¡A¥i°e¥X¤@¤p¶ôªºÁnµ¸ê®Æ¡A¨C¤@¤p¶ô¸ê®Æ«e·|³Q¥[¤WRTPªºheader¡CRTP header·|«ü¥X¨C¤@Ópacket©Ò¥]§tªº¸ê®Æ¬O¥Î¤°»òÀ£ÁY¤è¦¡¡A¹³¬OPCM, ADPCM, LPC¡Kµ¥¡C¦b·|ijªº¹Lµ{¤§¤¤¡A¶Ç°eÁnµ¸ê®Æªº¤½¥q¦¨û¡A¥i¥H§ïÅÜÁnµªºÀ£ÁY¤è¦¡¡A¥H°t¦X¸g¥Ñ¯¶ÀW³s±µ¨ìInternetªºªº·s¥[¤JªÌ¡A©Î¬O¹ïºô¸ô¾Ã¶ë°µ¥X¤ÏÀ³¡C
¦p¦P¨ä¥¦packetºô¸ô¤@¯ë¡AInternet°¸¦Ó¤]·|¿ò¥¢packet¡A©Î¬O±Npacketªº¶¶§Ç¥Î¶Ã¡C¬°¤F³B²z³o¨Ç·l®`¡ARTP header·|¥]§t®É¶¡ªº¸ê°T¡A¥H¤Î¤@Ósequence number¡C¦p¦¹¤@¨Ó¡A©Ò¦³¥[¤J·|ijªº¦¨û´N¥i¥H¨Ì¦¹¨Ó«²Õ¦¬¨ìªºpacket¡A¬Æ¦Ü¦ôp¦³¦h¤Öpacket¿ò¥¢¡C
¦]¬°¦b·|ijªº¹Lµ{¤§¤¤¡A¤½¥q¦¨ûÌ¥i¯à·|¥[¤J©ÎÂ÷¶}·|ij¡A©Ò¥Hª¾¹D¬Y¤H¦b¦ó®É¥[¤J¡AÁÙ¦³¥L±µ¦¬¸ê®Æªºª¬ªp¡A·|¬O«Ü¦³¥Îªº¡C¬°¤F¹F¨ì³oӥتº¡A¨C¤@Ó·|ij¤Wªºapplication¡A³£·|¦bRTCPªºport¤W¡A©w´Á¸s¼½¥]§t¨Ï¥ÎªÌ¦WºÙªºreception report¡CReception report·|«ü¥X¶Ç°eÁnµ¸ê®Æªº¦¨û¡A³Q±µ¦¬ªºµ{«×¦p¦ó¡A¤]¥i¥H¥Î¨Ó±±¨î¾A¦XªºÁnµÀ£ÁY¤è¦¡¡C·íµM¡A°£¤F¨Ï¥ÎªÌ¦WºÙ¡A¨ä¥¦¿ëÃѸê°T¥iµø±±¨îÀW¼eªº¨î¡A³Q¥[¤Jreception report¡C·í¬Y¤H·QÂ÷¶}¦¹¤@·|ij¡Aapplication±N°e¥XRTP BYE packet¡C
¦pªGÁnµ»P¼v¹³³£³Q¨Ï¥Î¦b·|ij¤¤¡Aapplication±N¨Ï¥Î¨âÓUDP port pair¡A¥H¤Î(©ÎµÛ)¨âÓmulticast address¡A¤À§O¨Ó¶Ç°eÁnµ»P¼v¹³ªºRTP©MRTCP¡CµM¦ÓRTP¨Ã¨S¦³¤èªkª½±µ±NÁnµ»P¼v¹³ªºsession°µµ²¦X¡A°£«Dparticipant¦bÁnµ»P¼v¹³ªºRTCP packet¤¤¡A³£¨Ï¥Î¬Û¦PªºCNAME¡C
±NÁnµ»P¼v¹³¥H¤£¦Pªºsession¨Ó¶Ç°e¡A¨ä¤¤¤@Óì¦]¬O¡A¤¹³\¥[¤J·|ijªº¤H¡A¥u¿ï¾Ü±µ¦¬¨ä¤¤¤@ºØ´CÅé¡C
ÁöµMÁnµ»P¼v¹³ªºsession¬O¤À¶}ªº¡A¦ý¬O¦P¨B¤Æ¤´µM¥i¥HÂǵÛRTCP packet¤¤ªº®É¶¡¸ê°T¨Ó¹F¨ì¡C
¦b¤§«eªº¨âÓ±¡ªp¤¤¡A§ÚÌ°²³]©Ò¦³ªºparticipant³£¯à±µ¦¬¬Û¦Pformatªº´CÅé¸ê®Æ¡CµM¦Ó¡A³o«o¤£¬O§¹¥þ¥¿½Tªº¡C
·Q¹³¬Y¤@°Ï°ìªº¤H¬O³z¹L§C³t½u¸ô³s±µ¨ìInternet¡A¦Ó¨ä¥¦°Ï°ìªº¤H«h¬O³z¹L°ª³t½u¸ô³s±µ¨ìInternet¡C»P¨ä±j¢©Ò¦³¤H³£¨Ï¥Î¸û¤ÖªºÀW¼e¡ARTP¹ç¥i¦b¾aªñ²Ä³tºô¸ô¤§³B¡A©ñ¸m¤@Ó¦W¬°mixerªº¾÷¨î¡C
Mixer·|¥ý±N¦¬¨ìªºpacket§@¦P¨B¤Æ¥H«²Õpacket¡AµM«á±N³o¨Ç«²Õ¹Lªºpacket²V©M¨ì³æ¤@ªº¸ê®Æ¬y¡A³Ì«á¦A±NÀ£ÁY¤è¦¡§ï¬°¾A¦X§C³tºô¸ôªºformat¡A¨Ã³z¹L§C³t½u¸ô±N·sformatªºpacket¶Ç°eµ¹§C³tºô¸ô¤¤ªºparticipant¡C
¦bRTPªºheader¤¤¡A·|¦³¤@ºØ¤èªk¥i¥HÅýmixer¿ëÃѨC¤@Ó²V©M¹Lªºpacketªº¶Ç°eªÌ¡A¦p¦¹¤@¨Ó¡Areceiver´N¥i¥Hª¾¹Dpacket¬O¥Ñ½Öµo¥X¨Óªº¡C
¦pªG¦³¨Çparticipant¬O³z¹L°ª³t½u¸ô³s±µ¨ìInternet¡A¥i¬O¤£¤ä´©IP Multicast¡A¹³¬O³QFirewall»PInternet¹jµ´¡A¦]¬°Firewall¥~ªºpacket³£µLªk¶i¤JFirewall¤º³¡¡C¦b³oºØ±¡ªp¤U¡ARTP±N¨Ï¥Î¤@Ó¦W¬°Translatorªº¾÷¨î¡C
Translatorªº¾÷¨î¬O¦w¸m¨âÓTranslator¡A¤@Ó¦bFirewall¥~³¡¡A¤@Ó¦bFirewall¤º³¡¡C¥~³¡ªºTranslator¶Ç°emulticast packet¡A¤º³¡ªºTranslator«h³z¹L¦w¥þªººÞ¹D¦¬¨ì³o¨Çmulticast¡A¤§«á¤º³¡ªºTranslator¦A±N³o¨Çmulticast packetÂà°eµ¹Firewall¤ºªºparticipant¡C
¦b¤@Ó¼v¹³·|ij¤¤¡Amixer¥i¥H§â¨CÓ¤Hªº¼v¹³¤À¦¨Y¤zµ¥¥÷¡AµM«á±N¥¦Ì¦X¦¨©ñ¨ì³æ¤@Ó¸ê®Æ¬y¡A¨Ó¼ÒÀÀ¸sÅ骺´º¶H¡C
¦pªG¦b¤@Ó»·¶Z·|ij¤¤¡A¦³¨â¸s¤H¤À§O¨Ï¥Î¤£¦Pªº©³¼hprotocol¡A¨Ò¦p¤@¸s¤H¨Ï¥ÎIP/UDP¡A¥t¤@¸s¤H¨Ï¥ÎST-II¡C©Î¬O¼v¹³ªºÀ£ÁY¤è¦¡¬O¤@Ópacket±µµÛ¤@Ópacket¡A¦Ó¤£»Ý«²Õ©Î²V©M¡C¦¹®É¡ATranslator¤]¥i¬£¤W¥Î³õ¡C
RTP packet: ¤@Ó¶}ÀY¦³RTP headerªºpacket¡A§Y¬°RTP packet¡C³q±`¦b©³¼hprotocol¤¤¡A¤@Ópacket¥u¥]§t¤@ÓRTP packet¡A¦ý³z¹L¤@¨Ç¯S§Oªºencapsulation¤èªk¡A©³¼hpacket¤]¥i¥H¥]§t¤@Ó¥H¤WªºRTP packet¡C
RTP payload: ¦bRTP packet¤¤¡A¯u¥¿n¶Ç°eªº¸ê®Æ¡A§Y¬°RTP payload¡C¨Ò¦p¦b¼v¹³·|ij¤¤¡A¼v¹³¸ê®Æ´N¬ORTP payload¡C
RTCP packet: ¤@Ó¶}ÀY¬ORTCP header¡A«á±±µµÛ±±¨î¸ê®Æªºpacket¡A§Y¬°RTCP packet¡C³q±`³\¦hRTCP packet·|³Qµ²¦X¡A¦A¥[¤W©³¼hªºheader¡A¦Óµ²¦X«áªºRTCP packetªø«×·|³Q¬ö¿ý¦bRTCP header¤¤ªºlengthÄæ¦ì¡C
Port: ·íRTP·Q¶Ç°eRTP packet»PRTCP packet¨ì¦P¤@ÓIP Address®É¡Aport´N¥i¥H¥Î¨Ó°Ï¤À¥Øªº¦aªº¤£¦P¡C
Transport address: ¤@¯ë³£¬OIP Address¥[¤WUDP port¡Cpacket³£¬O±q¤@Ósource transport address¶Ç¨ì¤@Ódestination transport address¡C
RTP session: ¹ï©ó¨C¤@ÓRTP¨Ï¥ÎªÌ¦Ó¨¥¡ARTP session¬O¥Ñ¤@¹ïdestination transport address©w¸q¦Ó¦¨(¤@Ó¬°¤FRTP¡A¥t¤@Ó¬°¤FRTCP)¡Cnª`·Nªº¬O¡A¤@Ó¦h´CÅé·|ij¤¤¡A¤£¦Pªº´CÅé¸ê®Æ³Ì¦n¦b¤£¦PªºRTP session¤¤¶Ç°e¡C
Synchronization source
(SSRC): SSRC¬O¤@ÓÀH¾÷¿ï¨úªºÃѧOÈ¡A¥Î·N¬O¨Ï¤@ÓRTP session¤¤ªºparticipant³£¦³¿W¤@µL¤GªºÃѧO¸ê°T¡C¦ý¬O¦P¤@ӨϥΪ̦b¤£¦PªºRTP session¤¤¡A¨Ã¤£¤@©wn¥Î¦P¤@ÓSSRC¡C
Contributing source
(CSRC): ¤§«e´£¹Lmixer¥i¥H±N¤£¦P¨Ó·½ªºRTP packet²V©M©ñ¨ì¦P¤@ÓRTP packet¤¤¡C¦¹®É¡ARTP¤]·|¦bRTP header¤¤¬ö¿ý»P³oÓpacket¦³ÃöªºSSRC¡A¦Ó³o¨ÇSSRC¦X°_¨Ó´N¥s°µCSRC¡C
End system: ¦pªG¤@Óapplication¥i¥H²£¥Í¤º®e³Q¥]¦bRTP packet¤¤³Q¶Ç°e¡A©Î¬O¥i¥HŪ¨úRTP packet¤¤ªº¤º®e¡A´N¥i¥H³QºÙ¬°End system¡C
Monitor: ¦pªG¤@Óapplication¥i¥H±µ¦¬¦b¤@ÓRTP session¤¤©Ò¦³participant°e¨ÓªºRTCP packet¡A´N¥i¥H³QºÙ¬°Monitor¡CMonitor¥i¥H³Q¤º«Ø¦bEnd system¤¤¡Q¤]¥i¥H¤£ª½±µ°Ñ»PRTP session¡A³oºØMonitor³QºÙ¬°Third Party Monitor¡C
0 |
1 |
2 |
3 |
||||||||||||||||||||||||||||
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
0 |
1 |
V=2 |
P |
X |
CC |
M |
PT |
Sequence number |
Timestamp |
||||||
Synchronization
source (SSRC) identifier |
||||||
Contributing
source (CSRC) identifier ¡K¡K |
Version (V): »¡©úRTPªºª©¥»¡C
Padding (P): ¦pªG³oÓÄæ¦ì³Q³]©w¡ARTP packet§ÀºÝ±N·|¥]§t¤@Ó¥H¤Wªºpadding octets¡A¦ý¥¦Ì¨Ã¤£¬ORTP payloadªº¤@³¡¥÷¡A¦Ó¦bpaddingªº³Ì«á¤@Óoctet·|°O¿ý¦b³oÓRTP packet¤¤¦³¦h¤ÖÓoctet¡C¦b¬Y¨ÇÀ£ÁYºtºâªk¡A©Î¬O©³¼hªº³q°T¨ó©w¡Apadding¦³¥i¯à·|³Q¥Î¨ì¡C
Extension (X): ¦pªG³oÓÄæ¦ì³Q³]©w¡A¦b©T©wªºRTP header«áÁÙn¥[¤W¤@Ó header extension¡C
CSRC count (CC): ¬ö¿ýCSRCªºÓ¼Æ¡C
Marker (M): ¥Î§@«n¨Æ¥ó¡A¹³¬O¼v¹³¤¤frameªº¬ÉÃѧOÈ¡C³oÓȪº¸ÑÄÀ¬O¯dµ¹application¥h³B²z¡C
Payload type (PT): ¥Î¨Ó©w¸qRTP payloadªºformat¡A¦Óformatªº¸ÑÄÀ«h¬O¯dµ¹application¥h³B²z¡C
Sequence number: ¨C°e¥X¤@ÓRTP packet¤§«á¡Asequence number´N·|¼W¥[¤@¡CSequence number¤]¥i¥H³Qreceiver¥Î¨Ó°»´úpacket loss¡A¥H¤Î«ì´_packetªº¶¶§Ç¡C
Timestamp: ¥Î¨Ó°O¿ýRTP packet²Ä¤@Óoctet³QŪ¨úªº¨ú¼Ë®É¶¡¡C
SSRC: ¦p¦P«e±ªº©w¸q¡Cnª`·Nªº¬O¡A¦pªG¤@Ósource§ïÅÜ¥¦ªºsource transport address¡A¥¦¥²¶·¿ï¾Ü¤@Ó·sªºSSRC¡C
CSRC list: ¦p¦P«e±ªº©w¸q¡Cnª`·Nªº¬O¡A¦pªG¤@ÓRTP packet¥]§t15Ó¥H¤WªºCSRC¡A¥u¦³15ÓCSRC¥i¥H³QÃѧO¡C
«e¤Q¤GÓoctet¤@©w·|¥X²{¦b¨CÓRTP packet¡Q¦ýCSRC list¥u¦³packet¸g¹Lmixer¤~·|³Q¶ñ¤J¡C
n¥ý»¡©úªº¬O¡A¦pªG¤@Óprotocol·Q¦³®Ä²vªº¹B§@¡AmultiplexingªºÂIÀ³¸ÓºÉ¶q´î¤Ö¡C
¦bRTP¤¤¡Amultiplexing¬OÂÇ¥Ñdestination transport address¨Ó§¹¦¨¡C¨Ò¦p¤@Ó¥]§t¼v¹³»PÁnµªº»·¶Z·|ij¡AÁnµ»P¼v¹³±N¦b¤£¦PªºRTP session¤¤³Q¶Ç°e¡C°ò¥»¤W¡ARTP¨Ã¤£§Æ±æ¼v¹³»PÁnµµ¥¤£¦Pªº¸ê®Æ¦b¦P¤@ÓRTP session¤¤³Q¶Ç°e¡AµM«á¦A®Ú¾Úpayload type©ÎSSRC¨Ódemultiplex¡C
¦b¦P¤@ÓRTP session¤¤¨Ï¥Î¦P¤@ÓSSRC·|³y¦¨¥H¤U¤Ó°ÝÃD¡Q¦Ü©ó¦b¦P¤@ÓRTP session¤¤¨Ï¥Î¤£¦PªºSSRC¡A±N¥iÁקK«e¤TÓ°ÝÃD¡A¦ý¤´·|¹J¨ì«á¨âÓ°ÝÃD¡G
¦pªG¦bsession¹B§@ªº¹Lµ{¤¤¡A¦³payload typeªº§ïÅÜ¡A±N¨S¦³¤èªkª¾¹D¬Oþ¤@Óªºpayload type³Q¨ú¥N¡C
¥i¯à»Ýn¤£¦Pªºp®É¤è¦¡¡A¥H¤Îsequence numberªÅ¶¡¡C
¤£½×¬ORTCP sender report©Î¬ORTCP receive report¡A·í°w¹ï¦P¤@ÓSSRC¡A³£¥u¯à´yz¤@Óp®É¤è¦¡¡A¥H¤Î¤@Ósequence numberªÅ¶¡¡C¦Ó¥B¡A¨S¦³payload typeÄæ¦ì¡C
RTP mixer¨S¦³¿ìªkµ²¦X¤£¬Û®eªºmedia¡C
¦pªGreceiver¥u·Q±µ¦¬RTP session¨ä¤¤¤@ºØmedia¡A±N¬O¤£¥i¯àªº¡C¦¹¥~¡Areceiver application·Q¥Î¤£¦Pªºprocess¥h±µ¦¬¤£¦Pªºmedia¡A¤]¬OÃø¥H¹F¦¨ªº¡C
0 |
1 |
2 |
3 |
||||||||||||||||||||||||||||
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
0 |
1 |
Defined by profile |
length |
header extension ¡K¡K |
defined by profile: ¥Î¨Ó±µ¦¬¤@¨Çidentifier©Îparameter¡C¥H¤¹³\n¥æ¤¬§@¥Îªºimplementation¥i¥H¥Î¤£¦Pªºheader extension¥h¸ÕÅç¡Q©Î¤¹³\¤@Ó¯S®íªºimplementation¥i¥H¥Î¤@ºØ¥H¤Wªºheader extension¥h¸ÕÅç¡C
Length: ¥Î¨Ó°O¿ý¦bextension¤¤32-bit wordªºÓ¼Æ¡C
Extension¾÷¨î¬O¬°¤F¸ÕÅç·sªºpayload-format-independent¥\¯à¡AÅý¨º¨Ç¥\¯à¥i¥H¦bRTP header¤¤¥[¤J»Ýnªº¸ê°T¡Q¦ý¬O¡AY¥u¬O¬Y¨Çpayload format©Ò»Ýnªº¦Ó¥~¸ê°T¡A«h¤£©y¨Ï¥Îheader extension¡A¦Ó¬OÀ³¸Ó¥]§t¦bRTP packet¤¤ªºpayload section¡C
RTCPªºì²z´N¬O¡A¨Ï¥Î»PRTP¶Ç°epacket¤@¼Ëªº¶Ç°e¾÷¨î¡A¨C¹j¤@¬q®É¶¡´N¶Ç°econtrol packet¡C
n
RTCP¥Dnªº¥\¯à¬O¤F¸Ñ¸ê®Ædistributionªºquality¡C¦A°t¦Xdistribution¾÷¨î¡A¹³¬OIP Multicast¡A´N¥i¥HÅýnetwork service provider³oÃþ¹ê»Ú¤W¨S¦³¥[¤JRTP sessionªº³æ¦ì¡A¥h¶EÂ_ºô¸ô¤Wªº°ÝÃD¡C
n
RTCP¥]§t¤@Ó¤£ÅܪºRTP sourceªºtransport-level identifier¡A¥s°µcanonical name©Î¬OCNAME¡CReceiver¨Ì¾aCNAME¨Ó°lÂܨC¤@Óparticipant¡CRTP¤]¨Ï¥ÎCNAME¦b¤@²Õ¬ÛÃöªºRTP sessions¤¤¡A±N¨Ó¦Û¦P¤@Óparticipantªº¦hªºdata stream§@Ápô¡C
n
«e±¨âÓ¥\¯à³£»Ýn©Ò¦³ªºparticipant¶Ç°eRTCP packet¡A©Ò¥H¬°¾AÀ³¤j¶qªºparticipant¡A¶Ç°eªº³t²v´Nn±±¨î¡C³z¹L¨C¤@Óparticipant¶Ç°eRTCP packetµ¹¨ä¥Lparticipant¡A©Ò¦³ªºparticipant¥i¥HÆ[¹î²{¦bparticipantÁ`¼Æ¥Ø¡A¦Ó³oӼƥشN¥Î¨Ópºâ¶Ç°eRTCP packetªº³t²v¡C
RTCP packet¥i¥H¥]§t¥H¤U¤ºØ¸ê°T¡Q
n
SR: ¬ö¿ýsenderªºreception statistics¡C
n
RR: ¬ö¿ýreceiverªºreception statistics¡C
n
SDES: ¦³Ãösourceªº¸ê°T¡A¹³¬OCNAME¡C
n
BYE: «ü¥X¬Y¤@participantªºÂ÷¶}¡C
n APP: «ü¥X¬Y¤@application¯S¦³ªºfunctions¡C
n
¨C¤@ÓRTCP packet³Ì«e±³£·|¦³©T©wªº³¡¤À¡AµM«á®Ú¾ÚpacketºØÃþªº¤£¦P¡A±µµÛªø«×¤£¦Pªº¸ê®Æ¡A¦ýÁ`bit¼Æ³£¬O32ªº¿¼Æ¡C
n
¦hÓRTCP packet¥i¥Hµ²¦X¡A¦Ó¤£»Ýn¥ô¦óªºseparator¡C
¨C¤@ÓRTCP packet¤@©wn¥]§tSR/RR»P¦³CNAMEªºSDES¡A¦Ó¥BSR/RR¤@©w¬O¦b³Ì«e±¡C
¡» ¦h´CÅéÀɮ׮榡
¤@¯ë§Q¥ÎRTP¨Ó°µµø°TÀ³¥Î³q±`·|¤À¨âÓSession¨Ó°µ,¤@ÓSessiont³dÁnµ¶Ç°e,¥t¤@Ó«h¬°¼v¹³,³o¼Ëªºª¬ªp¤§¤U¥²¶·¦Ò¼{¼vµ¦P¨Bªº°ÝÃD¡C¦Ó³o¦¸¬O¶Ç°e¤@Ó¤w¸g¤º§t¦³Ánµ¼v¹³ªºRaw
Data¹L¥h(AVI file),³o¼Ë´N¤£»Ýn¥h¦Ò¼{¨ì¼vµ¦P¨Bªº°ÝÃD,ÅýRaw Data¤¤ªº¦P¨B¨ó©w¦Û¤v¥h°µ,§ÚÌÁnµÀ£ÁYªº®æ¦¡¥Dn¬O±ÄMPEG Layer
III,¼v¹³À£ÁY¥Dn¬O±ÄMPEG4,³Ì«á¦X¦¨¤@ÓRIFF-AVI¶Ç°e¹L¥h¡C
Mpeg Audio
Mpeg Audio¬O±ÄFrame by FrameªºÀx¦s¤è¦¡,¤@ÓFrame´N¬O¤@ӳ̰ò¥»ªº¼·©ñ³æ¦ì,Mpeg
AudioªºÀÉ®×µ²ºc¦p¤U:
FRAME1
FRAME2
31 0(bits)
Headerªº·§z¦p¤U(¸Ô²ÓÄæ¦ì¸ê°T¥i©ó³Ì«á¦C¥Xªº°Ñ¦Ò¸ê®Æ´M§ä,¦]¬°¾ãÓ½g´T¤Ó¤j¤F,¤£¤è«K¦C¥X)
Sign |
Length(bit) |
Position(bit) |
Description |
A |
11 |
(31-21) |
Frame sync (all
bits must be set) |
B |
2 |
(20-19) |
MPEG Audio
version ID |
C |
2 |
(18-17) |
Layer
description |
D |
1 |
(16) |
Protection
bit |
E |
4 |
(15-12) |
Bitrate index |
F |
2 |
(11-10) |
Sampling rate
frequency index |
G |
1 |
(9) |
Padding bit |
H |
1 |
(8) |
Private bit.
This one is only informative |
I |
2 |
(7-6) |
Channel Mode |
J |
2 |
(5-4) |
Mode
extension |
K |
1 |
(3) |
Copyright |
L |
1 |
(2) |
Original |
M |
2 |
(1-0) |
Emphasis |
Mpeg Audio Frame Length
¼ÐÀYªº¸ê°T§Ṳ́w¸g¸Ô²Óª¾¹D¤F,¦Ü©óRaw
Dataªºªø«×¥i¥H¥Ñ¥H¤U¤½¦¡pºâ¥X¨Ó¡C
Read
the BitRate, SampleRate , Padding bit and protection bit(CRC) from header.
For
Layer I files us this formula:
FrameLengthInBytes
= (12 * BitRate / SampleRate + Padding) * 4 + CRC
For
Layer II & III files use this formula:
FrameLengthInBytes
= 144 * BitRate / SampleRate + Padding + CRC
Mpeg4
Mpeg4¤ºªºÀ£ÁYªk¨Ã¤£¬O«Ü²M·¡,¥i¥H°Ñ¦Ò¨äSPEC,§Ú̬O±ÄDivX
MPEG4 Video Codec(filter)¨Ó¹F¦¨§Ú̪º¥Øªº¡C
RIFF(defined by Microsoft)
¦]¬°AVIºâ¬ORIFF®æ¦¡ªºÀÉ®×,¦]¦¹¥ý²¤¶RIFF¡CRIFF(Resource
Interchange File Format)¬O¤@Ó¤G¶i¦ìªº±_ª¬µ²ºcÀÉ®×,¥¦¨Ã¤£¥Nªí¥ô¦ó¦h´CÅéÀÉ®×,¦Ó¥¦¬O§â¦h´CÅéÀÉ®×¥]¸Ë¦b¨ä©w¸qªºµ²ºc¤§¤¤,¥]¸Ë¦bRIFF¤¤ªº¦h´CÅé¸ê®Æ¥Dn¬O¥HÀɮתº°ÆÀɦW¨Ó§P§O,¦p¤U©Ò¦C:
¡P
Audio/visual
interleaved data (.AVI)
¡P
Waveform
data (.WAV)
¡P
Bitmapped
data (.RDI)
¡P
¡P
Color
palette (.PAL)
¡P
Multimedia
movie (.RMN)
¡P
Animated cursor (.ANI)
¡P A bundle of other RIFF files (.BND)
¦p¤W³£¬ORIFF®æ¦¡ªºÀÉ®×,¥u¬O¨ä¤º§tªº¦h´CÅé¸ê®Æ¤£¤@¼Ë¡C¦A¨Ón»¡©úªº¬ORIFFµ²ºc,¦bRIFF¤¤ªº°ò¥»³æ¦ì´N¬OChunk,¦p¤U©Ò¦C:
typedef struct _Chunk
{
DWORD ChunkId; /* Chunk ID marker */
DWORD ChunkSize; /* Size of the chunk data in bytes */
BYTE ChunkData[ChunkSize]; /* The chunk data */
} CHUNK;
ChunkData¤¤¤S¥i¥]§t§OªºChunck(Sub
Chunk),³o¼ËªºÃö«Y¤@ª½¤U¥h´N¦p¤W©ÒºÙªº±_ª¬µ²ºc¡C
AVI
AVIÄÝ©ó¦p¤WzªºRIFF®æ¦¡,AVI¤ºÂ\ªºÀɮ׸ê®Æ¥]¬A¤FÁnµ»P¼v¹³,¥¦ªºChunk¤À¥¬¦p¤U:
struct _RIFF /* "RIFF" */
{
struct _AVICHUNK /* "AVI " */
RIFF CHUNK
{
struct _LISTHEADERCHUNK /* "hdrl" */
{
AVI CHUNK
AVIHEADER AviHeader; /* "avih" */
struct _LISTHEADERCHUNK /* "strl" */
{
LIST-HDR CHUNK
AVISTREAMHEADER StreamHeader; /* "strh" */
AVISTREAMFORMAT StreamFormat; /* "strf" */
AVISTREAMDATA StreamData; /* "strd" */
}
}
struct _LISTMOVIECHUNK /* "movi" */
{
struct _LISTRECORDCHUNK /* "rec " */
LIST-MOVI CHUNK
{
/* Subchunk 1 */
/* Subchunk 2 */
/* Subchunk N */
}
}
struct _AVIINDEXCHUNK /* "idx1" */
{
INDEX CHUNK
/* Index data */
}
}
}
¦p¤W©Ò¦C,³o¬O¤@ÓAVIªºµ²ºcÀÉ®×,¥DnRIFF
chunk¥]¸Ë¤@ÓAVI chunk,AVI chunk¤§¤¤¤S¥]§t¤F,LIST-HDR¡BLIST-MOVI¡BINDEX¤TÓchunk,LIST-HDR
chunk¤§¤¤¥Dn¬O¬ö¿ý¼vµ¸ê®Æªº¸ê°T,LIST-MOVI chunk¬OÂ\¼vµ¸ê®Æ,INDEX chunk¬OÂ\¼vµªø«×ªº¯Á¤Þ,¥Dn¬O´£¨Ñ§ÖÂà©Î°jÂà¼vµªº¸ê°T,¸Ì±§ó²Ó³¡ªº¤º®e¥i¥H°Ñ¦Ò«á±¦C¥Xªº°Ñ¦Ò¸ê®Æ,¦]¬°½g´Tªø«×¹ê¦b¤Ó¤j¤F¡C
Summary
¨Ã¤£¬O©Ò¦³ªº®æ¦¡³£¬O¾A¦X¦bºô¸ô¤W°µ¶Ç°e,³\¦h°µ¦h´CÅé¶Ç°eªº¤½¥q³£¦³¥t¥~¦ÛqªºÀɮ׮榡,¦pReal
Player RA©Î¬OMicrosoft ASF,¦¹¦¸±ÄAVI®æ¦¡±N¼v¹³¶Ç°e¥X¥h¤]¤£¬O«Ü²M·¡¬O§_¯uªº¦X¾A,³o»Ýn§ó¥J²Óªº¬ã¨s¤~¹ï¡C
¡» ¨t²Îªì¨B¬[ºc
¦p¤W¹Ï¬O§Ú̪ì¨B¹ê§@¥Xªº¬[ºc,º¥ý¼·©ñºÝ±qDISK¨ú¥Xn¼·©ñAVI
File°µ¤Á³Î¨Ã®M¤WRTP°µMulticast¶Ç°eµ¹¼·©ñºÝ¡C¼·©ñºÝ¥]§tReceiver»PPlayer¨â³¡¤À,¦ý¨ä¹ê¬O¦b¦P¤@µ{¦¡©ó¨âÓ¤£¦PªºThread°õ¦æ¡C
¼·©ñºÝ±µ¦¬¨ì¸ê®Æ«á´N±NAVI¤ù¬q¼g¤JDISK,³Ì«áPlayer±N¼g¤JªºAVI¤ù¬qµ¹¼·©ñ¥X¨Ó¡C
³oÃä´N¥X²{¤F¤@¨ÇÆZ¦³½ìªº²{¶H,´N¬O§Ú̶ǰeºÝ»P¼·©ñºÝªº³t«×n¦p¦ó¨ó½Õ,ÁÙ¦³¤§¶¡ªºÀW¼e°ÝÃD©O?!°ò¥»¤W¶Ç°eºÝ¬O®Ú¾ÚAVI¤ù¬qªø«×¨Ó½Õ¾ã³t«×ªº¡C©Î³\¥i¯à¤S·|°Ý¬°¤°»ò¼·©ñºÝn³z¹LDISK¦s¨ú³o¹D¤âÄò,±µ¦¬¨ìªºAVI¤ù¬qªºRTP
Packet¤@¶}©l¤£´N¬O¦b°O¾ÐÅ餤,¬°¤°»ò¤£ª½±µ¼·©ñ¥X¨Ó?!¥Dnªºì¦]¬O¦]¬°Player¬O¥ÎDS¨Ó¹ê§@,¦ÓDS¦¹®É´£¨ÑªºSource Filter¥u¯à±qURL©ÎFILEŪ¨úRaw
Data,¦]¦Ó§Ú̱ÄFILEªº¤è¦¡,©Ò¥Hn³z¹LDISK¦Ó¤£¬O±qMemory¹L¥h,¦ý¤@³z¹LDISKªº¤è¦¡,§Ú̵oı¦b¼·©ñAVI¤ù¬q¤§¶¡·|¦³¨Ç³\Delay¡C
Ãö©óèè´£¨ìªº¥Dn¯Ê¥¢§Ṳ́]°Q½×ªì¤@¨Ç¸Ñ¨M¤è®×,¦ý¬O³Ì¦nªº´N¬Oª½±µ³z¹LMemoryµ¹DS³B²z,¤£¥Î³o¼Ë©äÓÅsÁY´î®Ä¯à,³o´Nªí¥Ü»¡§ÚÌ»Ýn¥h¶}µo¤@Ó¯à±q¦Ûq°O¾ÐÅéBufferŪ¨úRaw
DataªºSource Filter,¦Ü©ó³oÓ³¡¤À¥Ñ©ó®É¶¡¤£¤¹³\,¦]¦¹©|¥¼¹ê§@¡C
¡» ¨t²Î³Ì«á¬[ºc
³Ì«áªº¨t²Î¬[ºc¦p¤W¹Ï©Ò¥Ü,¼·©ñºÝ¥þ³¡¨S¦³ÅÜ,¦Ó¦b¶Ç°eºÝ§ï¬°¥ý¥ÑCapture
(CCD & MIC Device)¨ú±o¦h´CÅé,±N¨ú±oªº¦h´CÅé¥ý¼g¤JDISK,³Ì«áSender¦A±N¼g¤JDISKªº¼v¹³¶Ç°e¥X¥h,¦ÓSend»PCapture¹ê»Ú¤W¬O¦P¤@µ{¦¡,¦ýRun¦b¤£¦PªºThread¡C
°ò¥»¤W¶Ç°eºÝ¤]¬O¦³èè©Ò´£ªº¤ò¯f,¨ä¹ê¬O¤£¥²³z¹LDISKªº,³o¼Ë¤S®ö¶O±¼¤@¨Ç¨t²Î®Ä¯à,¦Ó¥B®ÄªG¤S¤£¬O«Ü¦n¡C
¡» ¨t²Î¬[ºc¹Ï--
DirectShow Filter
Audio Capture Filter
¦p¤W¹Ï±NCapture»PSender³¡¤À®i¦¨¤º³¡DS
Filter³sµ²ª¬ªp¡COptional³¡¤À¬O«ü¥i¥H¿ï¾ÜÀ£ÁY¤è¦¡©Î¤£À£ÁY,¼v¹³¤ä´©DivX MPEG4 Video Compressor¡BMicrosoft
AVI Compressor,Ánµ¤è±¦³MPEG Layer3 Compressor,¨ä¹ê³o¤è±¥i¥H®Ú¾Ú¨t²Î¾Ö¦³ªºCompressor¨Ó¿ï¾Ü¡C
¡» ¶Ç°eºÝScreen
Shot
¦p¹Ï¥ª¤U,¥Dnªº©Ò¦³¥\¯à³£¦b¨º¤U©ÔªºMenu¤§¤¤,¥]¬A¬O§_nÂ^¨ú¼v¹³©ÎÁnµ¡B¬O§_¤ä´©§Y®ÉÀ£ÁY¡C¿ï¾ÜStart
Writing´N·|¶}©l§@¶Ç°e®·®»ªº¼vµ,Stop·|¼È®É°±¤î¶Ç°e°Ê§@,ªÅ¥Õ³¡¤À¬OPreviewµøµ¡(¦p¤U¹Ïµe±)¡C
¹Ï¤@¡G¶}±ÒVideo Capture®É¡A¦Û°Ê¥X²{Capture
propertyµøµ¡
¹Ï¤G¡G¾Þ§@¿ï³æ¡A¥i¥H¿ï¾Ü¼v¹³¡BÁnµÂ^¨ú¡A¥H¤ÎÀ£ÁY®æ¦¡
¡» ±µ¦¬ºÝScreen
Shot
¹Ï¤T¡G¸`¥Ø¿ï³æµøµ¡
¹Ï¥|¡G¼·©ñCCD©MMIC§Y®ÉÂ^¨úªº¼v¹³¡BÁnµ
¡» «á°O
³oÓ±MÃD¦³¨Ç¦a¤è¬OȱoÄ~Äò¬ã¨s¡B§ïµ½ªº,¨Ò¦pRTP/RTCPªº±±¨î¨Ï¥Î¡BDS³¡¤À§ï¼gFilter¨Ó±±¨îRaw
dataªºdata flow©Î¸ÕµÛ¨Ï¥Î DS¤ºªþªºRTP Filter¡C
Á`¦Ó¨¥¤§,³o¦¸ªº±MÃDÅý§Ú̱µÄ²¨ì³\¦h¥H©¹¨S±µÄ²ªº»â°ì, ¬A¹êÅç«Çªº¤@¨Ç¾Çªø©j̤]¬O,¦]¦¹³\¦hªF¦è³£nªá¶OÆZ¦hªº®É¶¡¥h¬ã¨s©M·j´M¸ê®Æ,¨ä¤¤§¹¦¨ªº´ú¸Õµ{¦¡¤]«Ü¦h,¥]¬A¤FMulticastÀɮ׶ǿé¡BMPEG
AudioÀɮפÁ³Î¾¹¡BDirectShow¼·©ñ¼v¹³¡BÁnµªº´ú¸Õ½d¨Ò¡BRTP¶Ç°e¡B±µ¦¬´ú¸Õµ{¦¡,»â²¤¨ìMicrosoft Direct Showªº¬[ºc©M§Þ³N¡B¤]¾Ç·|COMì¥ó³]pµ¥µ¥,¦³¤F³o¨Ç·§©À»P¹ê§@ªº°ò¦,·Q¦A²`¤J¤U¥h¤]¤£·|¦p¦¹Á}²`¡C
¡» °Ñ¦Ò¸ê®Æ
l
Online MSDN (http://msdn.microsoft.com/library/)
l
Microsoft DirectShow 8.0a SDK Document (see DX
SDK)
l
JRTP Library Document (http://lumumba.luc.ac.be/jori/jrtplib/jrtplib.html)
l
RTP Official Site (http://www.cs.columbia.edu/~hgs/rtp/)
l
RFC 1889 RTP
l
§¹¥þåªRCOM Dale
Rogerson Microsoft Press
l
AVI RIFF FORMAT
(http://www.oreilly.com/centers/gff/formats/micriff/index.htm)
l
DirectX, RDX, RSX, and MMX technology : Rohan
Coelho and Maher Hawash Addison-Wesley Development Press
l
§õ^·ç,¡§IP Multicast ¸s¼½ºô¸ô²¤¶¡¨,1998.3
¡» §ë¼v¤ù©Mµ{¦¡½X¤U¸ü
=======================
--CCD Capture & Sender µ{¦¡½X (CCD_sender)
--±µ¦¬ºÝ & ¼·©ñ µ{¦¡½X (StreamPlayer)