private static async Task <List <Event> > RunForSymMessages( IPrefixMatcher matcher, IEnumerableAsync <Sym.Message[]> messages ) { Sym.IMeetingsStateInspector symMeetingsStateInsector = new Sym.MeetingsStateInspector(matcher); Sym.IMediaStateInspector symMediaStateInsector = new Sym.MediaStateInspector(matcher); Sym.ITimelineEvents symTimelineEvents = new Sym.TimelineEvents(matcher); var symLog = Sym.Helpers.MatchPrefixes(messages, matcher).Multiplex(); var symMeetingStateEvents = symMeetingsStateInsector.GetEvents(symLog); var symMediaStateEvents = symMediaStateInsector.GetEvents(symLog); var symMeetingEvents = (new InspectedObjectsLifetimeEventsSource(e => e.ObjectType == Sym.MeetingsStateInspector.MeetingTypeInfo || e.ObjectType == Sym.MeetingsStateInspector.MeetingSessionTypeInfo || e.ObjectType == Sym.MeetingsStateInspector.MeetingRemoteParticipantTypeInfo )).GetEvents(symMeetingStateEvents); var symMediaEvents = (new InspectedObjectsLifetimeEventsSource(e => e.ObjectType == Sym.MediaStateInspector.LocalScreenTypeInfo || e.ObjectType == Sym.MediaStateInspector.LocalAudioTypeInfo || e.ObjectType == Sym.MediaStateInspector.LocalVideoTypeInfo )).GetEvents(symMediaStateEvents); var events = EnumerableAsync.Merge( symMeetingEvents, symMediaEvents, symTimelineEvents.GetEvents(symLog) ).ToFlatList(); await Task.WhenAll(events, symLog.Open()); return(events.Result); }
private IEnumerableAsync <Event[]> RunForSymMessages( IPrefixMatcher matcher, IEnumerableAsync <Sym.Message[]> messages, ICodepathTracker templatesTracker, out IMultiplexingEnumerable <MessagePrefixesPair <Sym.Message>[]> symLog ) { Sym.IMeetingsStateInspector symMeetingsStateInspector = new Sym.MeetingsStateInspector(matcher); Sym.IMediaStateInspector symMediaStateInsector = new Sym.MediaStateInspector(matcher, symMeetingsStateInspector); Sym.ITimelineEvents symTimelineEvents = new Sym.TimelineEvents(matcher); Sym.Diag.ITimelineEvents diagTimelineEvents = new Sym.Diag.TimelineEvents(matcher); symLog = messages.MatchTextPrefixes(matcher).Multiplex(); var symMeetingStateEvents = symMeetingsStateInspector.GetEvents(symLog); var symMediaStateEvents = symMediaStateInsector.GetEvents(symLog); var symMeetingEvents = postprocessing.Timeline.CreateInspectedObjectsLifetimeEventsSource(e => e.ObjectType == Sym.MeetingsStateInspector.MeetingTypeInfo || e.ObjectType == Sym.MeetingsStateInspector.MeetingSessionTypeInfo || e.ObjectType == Sym.MeetingsStateInspector.MeetingRemoteParticipantTypeInfo || e.ObjectType == Sym.MeetingsStateInspector.ProbeSessionTypeInfo || e.ObjectType == Sym.MeetingsStateInspector.InvitationTypeInfo ).GetEvents(symMeetingStateEvents); var symMediaEvents = postprocessing.Timeline.CreateInspectedObjectsLifetimeEventsSource(e => e.ObjectType == Sym.MediaStateInspector.LocalScreenTypeInfo || e.ObjectType == Sym.MediaStateInspector.LocalAudioTypeInfo || e.ObjectType == Sym.MediaStateInspector.LocalVideoTypeInfo || e.ObjectType == Sym.MediaStateInspector.TestSessionTypeInfo ).GetEvents(symMediaStateEvents); var events = templatesTracker.TrackTemplates(EnumerableAsync.Merge( symMeetingEvents, symMediaEvents, symTimelineEvents.GetEvents(symLog), diagTimelineEvents.GetEvents(symLog) )); return(events); }