/// <summary> /// Return true if the ssrc is in the conference RtpSession's SSRCToStreamHashtable and the /// RtpStream reference there is not null. /// </summary> /// <param name="ssrc"></param> /// <returns></returns> public bool KnownToConferenceListener(uint ssrc) { if (confSession != null) { SSRCToStreamHashtable ht = (SSRCToStreamHashtable)confSession.Streams.Clone(); if (ht.ContainsKey(ssrc)) { if (ht[ssrc] != null) { return(true); } } } return(false); }
/// <summary> /// Called right before the user wants to begin encoding. Verify /// all sources are present: RtpStreams are known to the RtpSession, /// none are null, and all are currently delivering frames. /// </summary> /// <param name="audioCnames"></param> /// <param name="videoCname"></param> /// <returns></returns> public String VerifyEncodingStreams() { if (confSession == null) { return("Conferencing RtpSession does not exist."); } Hashtable aht = assrcs.GetRunningSetSSRCs(); Hashtable vht = vssrcs.GetRunningSetSSRCs(); SSRCToStreamHashtable sht = (SSRCToStreamHashtable)confSession.Streams.Clone(); ArrayList streams = new ArrayList(); foreach (uint ssrc in aht.Values) { if (!sht.ContainsKey(ssrc)) { return("Selected audio ssrc is unknown to the RtpSession."); } else if (sht[ssrc] == null) { return("Selected audio stream does not exist."); } streams.Add(sht[ssrc]); } foreach (uint ssrc in vht.Values) { if (!sht.ContainsKey(ssrc)) { return("Selected video ssrc is unknown to the RtpSession."); } else if (sht[ssrc] == null) { return("Selected video stream does not exist."); } streams.Add(sht[ssrc]); } return(CheckForPausedStreams(streams)); }