// Token: 0x0600034F RID: 847 RVA: 0x00013C68 File Offset: 0x00011E68 protected void addFromGraph(ICaptureGraphBuilder2 graphBuilder, IBaseFilter videoDeviceFilter, IBaseFilter audioDeviceFilter, IBaseFilter videoCompressorFilter, IBaseFilter audioCompressorFilter, SourceCollection videoSources, SourceCollection audioSources) { object obj = null; Trace.Assert(graphBuilder != null); this.addIfSupported(videoDeviceFilter, "Video Capture Device"); Guid guid = PinCategory.Capture; Guid guid2 = MediaType.Interleaved; Guid guid3 = typeof(IAMStreamConfig).GUID; int num = graphBuilder.FindInterface(ref guid, ref guid2, videoDeviceFilter, ref guid3, out obj); if (num != 0) { guid2 = MediaType.Video; num = graphBuilder.FindInterface(ref guid, ref guid2, videoDeviceFilter, ref guid3, out obj); if (num != 0) { obj = null; } } this.addIfSupported(RuntimeHelpers.GetObjectValue(obj), "Video Capture Pin"); guid = PinCategory.Preview; guid2 = MediaType.Interleaved; guid3 = typeof(IAMStreamConfig).GUID; num = graphBuilder.FindInterface(ref guid, ref guid2, videoDeviceFilter, ref guid3, out obj); if (num != 0) { guid2 = MediaType.Video; num = graphBuilder.FindInterface(ref guid, ref guid2, videoDeviceFilter, ref guid3, out obj); if (num != 0) { obj = null; } } this.addIfSupported(RuntimeHelpers.GetObjectValue(obj), "Video Preview Pin"); ArrayList arrayList = new ArrayList(); int num2 = 1; int num3 = 0; checked { int num4 = videoSources.Count - 1; for (int i = num3; i <= num4; i++) { CrossbarSource crossbarSource = videoSources[i] as CrossbarSource; if (crossbarSource != null && arrayList.IndexOf(crossbarSource.Crossbar) < 0) { arrayList.Add(crossbarSource.Crossbar); if (this.addIfSupported(crossbarSource.Crossbar, "Video Crossbar " + ((num2 == 1) ? "" : num2.ToString()))) { num2++; } } } arrayList.Clear(); this.addIfSupported(videoCompressorFilter, "Video Compressor"); guid = PinCategory.Capture; guid2 = MediaType.Interleaved; guid3 = typeof(IAMTVTuner).GUID; num = graphBuilder.FindInterface(ref guid, ref guid2, videoDeviceFilter, ref guid3, out obj); if (num != 0) { guid2 = MediaType.Video; num = graphBuilder.FindInterface(ref guid, ref guid2, videoDeviceFilter, ref guid3, out obj); if (num != 0) { obj = null; } } this.addIfSupported(RuntimeHelpers.GetObjectValue(obj), "TV Tuner"); IAMVfwCompressDialogs iamvfwCompressDialogs = videoCompressorFilter as IAMVfwCompressDialogs; if (iamvfwCompressDialogs != null) { VfwCompressorPropertyPage value = new VfwCompressorPropertyPage("Video Compressor", iamvfwCompressDialogs); this.InnerList.Add(value); } this.addIfSupported(audioDeviceFilter, "Audio Capture Device"); guid = PinCategory.Capture; guid2 = MediaType.Audio; guid3 = typeof(IAMStreamConfig).GUID; num = graphBuilder.FindInterface(ref guid, ref guid2, audioDeviceFilter, ref guid3, out obj); if (num != 0) { obj = null; } this.addIfSupported(RuntimeHelpers.GetObjectValue(obj), "Audio Capture Pin"); guid = PinCategory.Preview; guid2 = MediaType.Audio; guid3 = typeof(IAMStreamConfig).GUID; num = graphBuilder.FindInterface(ref guid, ref guid2, audioDeviceFilter, ref guid3, out obj); if (num != 0) { obj = null; } this.addIfSupported(RuntimeHelpers.GetObjectValue(obj), "Audio Preview Pin"); num2 = 1; int num5 = 0; int num6 = audioSources.Count - 1; for (int j = num5; j <= num6; j++) { CrossbarSource crossbarSource2 = audioSources[j] as CrossbarSource; if (crossbarSource2 != null && arrayList.IndexOf(crossbarSource2.Crossbar) < 0) { arrayList.Add(crossbarSource2.Crossbar); if (this.addIfSupported(crossbarSource2.Crossbar, "Audio Crossbar " + ((num2 == 1) ? "" : num2.ToString()))) { num2++; } } } arrayList.Clear(); this.addIfSupported(audioCompressorFilter, "Audio Compressor"); } }
// Token: 0x0600036E RID: 878 RVA: 0x00014454 File Offset: 0x00012654 protected ArrayList findCrossbarSources(ICaptureGraphBuilder2 graphBuilder, IAMCrossbar crossbar, bool isVideoDevice) { ArrayList arrayList = new ArrayList(); int num2; int num3; int num = crossbar.get_PinCounts(out num2, out num3); int num4 = 0; checked { int num5 = num2 - 1; for (int i = num4; i <= num5; i++) { int num6 = 0; int num7 = num3 - 1; for (int j = num6; j <= num7; j++) { num = crossbar.CanRoute(i, j); if (num == 0) { int num8; PhysicalConnectorType physicalConnectorType; num = crossbar.get_CrossbarPinInfo(true, j, out num8, out physicalConnectorType); CrossbarSource value = new CrossbarSource(crossbar, i, j, physicalConnectorType); if (physicalConnectorType < PhysicalConnectorType.Audio_Tuner) { if (isVideoDevice) { arrayList.Add(value); } else if (!isVideoDevice) { arrayList.Add(value); } } } } } int k = 0; while (k < arrayList.Count) { bool flag = false; CrossbarSource crossbarSource = (CrossbarSource)arrayList[k]; int num9 = 0; int num10 = arrayList.Count - 1; for (int l = num9; l <= num10; l++) { CrossbarSource crossbarSource2 = (CrossbarSource)arrayList[l]; if (crossbarSource.OutputPin == crossbarSource2.OutputPin && k != l) { flag = true; break; } } if (flag) { k++; } else { arrayList.RemoveAt(k); } } return(arrayList); } }