private void Setup()
        {
            int         hr;
            IBaseFilter ibf;

            IFilterGraph2 ifg = new FilterGraph() as IFilterGraph2;

            m_imc = ifg as IMediaControl;
            DsROTEntry rot = new DsROTEntry(ifg);

            DsDevice[] devs = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice);
            hr = ifg.AddSourceFilterForMoniker(devs[0].Mon, null, devs[0].Name, out ibf);

            ICaptureGraphBuilder2 icgb2 = new CaptureGraphBuilder2() as ICaptureGraphBuilder2;

            hr = icgb2.SetFiltergraph(ifg);
            DsError.ThrowExceptionForHR(hr);

            hr = icgb2.RenderStream(null, null, ibf, null, null);
            DsError.ThrowExceptionForHR(hr);

            IBaseFilter pFilter;

            hr = ifg.FindFilterByName("Video Renderer", out pFilter);

            m_qc = pFilter as IQualityControl;

            rot.Dispose();
        }
        private void Setup()
        {
            int hr;

            IFilterGraph2 ifg = new FilterGraph() as IFilterGraph2;

            m_imc = ifg as IMediaControl;
            DsROTEntry  rot = new DsROTEntry(ifg);
            IBaseFilter pFilter;

            DsDevice[] devs = DsDevice.GetDevicesOfCat(FilterCategory.AudioInputDevice);

            hr = ifg.AddSourceFilterForMoniker(devs[0].Mon, null, devs[0].Name, out pFilter);
            DsError.ThrowExceptionForHR(hr);

            ICaptureGraphBuilder2 icgb2 = new CaptureGraphBuilder2() as ICaptureGraphBuilder2;

            hr = icgb2.SetFiltergraph(ifg);
            DsError.ThrowExceptionForHR(hr);

            //IPin pPin = DsFindPin.ByDirection((IBaseFilter)o, PinDirection.Output, 0);
            hr = icgb2.RenderStream(null, MediaType.Audio, pFilter, null, null);
            DsError.ThrowExceptionForHR(hr);

            IBaseFilter pAudio;

            hr = ifg.FindFilterByName("Audio Renderer", out pAudio);

            m_ibn = pAudio as IAMAudioRendererStats;
        }