RTMFP
FlashでP2P
Cirrus
http://labs.adobe.com/technologies/cirrus/
P2P接続確立を補助してくれるサービス(Adobeがホストしている)。以前はStratusと呼ばれていた。
Flash Media Server(Enterprise版)でも同じことができるがFMSは超高価。
Cirrusは無料。ただしCirrusだとサーバーサイドでのmedia relay、shared objects、scriptingが使えない。
Cirrus 2とFlash Player 10.1でRTMFP Groupという多人数間での通信ができるようになった。
使い方
Cirrusのサイトでユーザー登録して、Developer keyを取得する。
サンプルアプリケーション をダウンロード
FlashBuilder 4が必要
サンプルアプリケーションを見ると、ユーザー管理のアプリケーションは自前で作る必要がある。
まだ仕組みがよくわかっていない。
現時点で分かっていること
Cirrusに接続するとIDが発行される
発行されたIDをもとにPeerに接続できる(IPなどは不要)
サンプルアプリケーションを読む
reg.cgi (サーバ)
関係しそうなクラス
NetStreamクラスのP2P関係
NetStream(connection:NetConnection, peerID:String = "connectToFMS")
peerIDを指定する
ピアに直接パブリッシュする場合
NetStream.DIRECT_CONNECTIONS
ピアから直接再生するには識別子を指定
NetConnection.nearID
NetStream.farID
P2Pマルチキャストグループをする場合
groupspecストリング
groupspecs は、「G:01010b...」のように、「G:」で始まり、16 進数の桁が続く文字列
peerStreams:Array 接続したPeerインスタンス
onPeerConnect(subscriber:NetStream):Boolean
接続時のコールバック関数を指定
プロパティ
audioSampleAccess : Boolean
videoSampleAccess : Boolean
multicastAvailabilitySendToAll : Boolean
multicastAvailabilityUpdatePeriod : Number
multicastFetchPeriod : Number
multicastRelayMarginDuration : Number
multicastWindowDuration : Number
コンパイラの設定でFlash Playerのバージョンを10.1以上にする。そうしないと使えない。
NetGroupクラス
音質関連
Microphone
codec
encodeQuality:Speexエンコード音質
enhancedOptions:下記
framesPerPacket:1パケットあたりのSpeex音声フレーム数。帯域幅 対 遅延。
noiseSuppressionLevel:Speexエンコーダーののノイズ抑制
rate
setSilenceLevel()
silenceLevel:デフォルトは10
setUseEchoSuppression()
useEchoSuppression
getEnhancedMicrophone()
MicrophoneEnhancedOptions
echoPath
isVoiceDetected
mode
nonLinearProcessing
NetStream
audioReliable:信頼性 対 遅延。
info: NetStreamInfo [RO]
NetStreamInfo
audioBufferByteLength
audioBufferLength
audioByteCount
audioBytesPerSecond
audioLossRate
画質関連
Camera
setKeyFrameInterval()
keyFrameInterval
setMode()
width
height
fps
setQuality()
bandwidth
quality
NetStream
currentFPS
info: NetStreamInfo [RO]
videoReliable
receiveVideoFPS()
NetStreamInfo
droppedFrames
videoBufferByteLength
videoBufferLength
videoByteCount
videoBytesperSecond
videoLossRate
その他品質
NetStream
backBufferLength [ReadOnly]
backBufferTime
bufferLength [ReadOnly]
bufferTime
bufferTimeMax
info: NetStreamInfo
上記の音質、画質
liveDelay
multicastAvailabilitySendToAll
multicastAvailabilityUpdatePeriod
multicastFetchPeriod
multicastInfo:NetStreamMulticastInfo
下記
multicastRelayMarginDuration
multicastWindowDuration
NetStreamMulticastInfo
bytesPushedFromPeers
bytesPushedToPeers
bytesReceivedFromIPMulticast
bytesReceivedFromServer
bytesRequestedByPeers
bytesRequestedFromPeers
fragmentsPushedToPeers
fragmentsReceivedFromIPMulticast
fragmentsReceivedFromServer
fragmentsRequestedByPeers
fragmentsRequestedFromPeers
receiveControlBytesPerSecond
receiveDataBytesPerSecond
receiveDataBytesPerSecondFromIPMulticast
receiveDataBytesPerSecondFromServer
sendControlBytesPerSecond
sendControlBytesPerSecondToServer
sendControlBytesPerSecond
NetGroup
info: NetGroupInfo
下記
NetGroupInfo
objectReplicationReceiveBytesPerSecond
objectReplicationSendBytesPerSecond
postingReceiveControlBytesPerSecond
postingReceiveDataBytesPerSecond
postingSendControlBytesPerSecond
postingSendDataBytesPerSecond
routingReceiveBytesPerSecond
routingSendBytesPerSecond