我一直在检测音频和视频设备并构建捕获图,但在最后一个过滤器中我无法同时渲染它们。
DsDevice dev = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice)[0];
hr = m_FilterGraph.AddSourceFilterForMoniker(dev.Mon, null, dev.Name, out capFilter);
Marshal.ThrowExceptionForHR( hr );
DsDevice audioDv = DsDevice.GetDevicesOfCat(FilterCategory.AudioInputDevice)[0];
hr = m_FilterGraph.AddSourceFilterForMoniker(audioDv.Mon, null, audioDv.Name, out audioFilter);
Marshal.ThrowExceptionForHR(hr);
asfWriter = ConfigAsf(capGraph, szOutputFileName);
hr = capGraph.RenderStream(null, MediaType.Audio, audioFilter, null, asfWriter);
Marshal.ThrowExceptionForHR(hr);
hr = capGraph.RenderStream(null, MediaType.Video, capFilter, null, asfWriter);
Marshal.ThrowExceptionForHR( hr );
这是我尝试的一段代码,我应该选择其他 MediaType 吗?