private async void Library_Click(object sender, RoutedEventArgs e) { var lMenuItem = sender as MenuItem; if (lMenuItem == null || lMenuItem.Tag == null) { return; } var ltag = lMenuItem.Tag.ToString(); int lIndex = 0; if (int.TryParse(ltag, out lIndex)) { CaptureManagerVideoRendererMultiSinkFactory.getInstance().LibraryIndex = lIndex; mCaptureManagerLib.IsChecked = false; mCaptureManagerVideoRendererLib.IsChecked = false; lMenuItem.IsChecked = true; await init(); } }
private async Task init() { var lCaptureManagerEVRMultiSinkFactory = await CaptureManagerVideoRendererMultiSinkFactory.getInstance().getICaptureManagerEVRMultiSinkFactory(); uint lMaxVideoRenderStreamCount = await lCaptureManagerEVRMultiSinkFactory.getMaxVideoRenderStreamCountAsync(); if (lMaxVideoRenderStreamCount == 0) { return; } List <object> lOutputNodesList = await lCaptureManagerEVRMultiSinkFactory.createOutputNodesAsync( IntPtr.Zero, mPlayerControl.Surface.texture, lMaxVideoRenderStreamCount); if (lOutputNodesList.Count == 0) { return; } List <IMFTopologyNode> lEVRList = new List <IMFTopologyNode>(); foreach (var item in lOutputNodesList) { var lRenderTopologyNode = (IMFTopologyNode)item; if (lRenderTopologyNode != null) { lEVRList.Add(lRenderTopologyNode); } } var lIEVRStreamControl = await lCaptureManagerEVRMultiSinkFactory.getIEVRStreamControlAsync(); mPlayerControl.setRenderList( lEVRList, lIEVRStreamControl, lMaxVideoRenderStreamCount); }