/// <summary> /// if SSRCManager detects a source restart, this is the event handler. /// Just bubble the event up to the parent. /// </summary> /// <param name="ea"></param> private void OnSourceRestored(StreamRestoredEventArgs ea) { if (OnStreamRestored != null) { OnStreamRestored(ea); } }
/// <summary> /// verify that a ssrc seems stable before raising OnSourceRestored /// This was to work around a pathological analog video driver issue /// which caused sources to toggle on and off. We think the issue has /// been fixed now, so the wait time has been removed. /// We'll leave it on the thread pool since the restart does take some /// time to complete. /// </summary> /// <param name="o"></param> private void queueSourceRestored(object o) { string cname = ((SourceData)o).cname; uint old_ssrc = ((SourceData)o).old_ssrc; uint new_ssrc = ((SourceData)o).new_ssrc; if ((!RunningSet.Contains(cname)) || (!RestartTimes.Contains(cname))) { return; } if (Convert.ToUInt32(RunningSet[cname]) != new_ssrc) { return; } if ((raiseSourceRestored) && (OnSourceRestored != null)) { StreamRestoredEventArgs ea = new StreamRestoredEventArgs(new_ssrc, old_ssrc, cname, payload); OnSourceRestored(ea); //raise event } }