private void GetControlInterface()
{
this.tuner = null;
this.crossbar = null;
object o;
int hr = this.captureGraphBuilder.FindInterface(null, null, this.videoCaptureFilter, typeof(IAMTVTuner).GUID, out o);
if (hr >= 0)
{
this.tuner = o as IAMTVTuner;
o = null;
hr = this.captureGraphBuilder.FindInterface(null, null, this.videoCaptureFilter, typeof(IAMCrossbar).GUID, out o);
if (hr >= 0)
{
this.crossbar = o as IBaseFilter;
o = null;
}
// Use the crossbar class to help us sort out all the possible video inputs
// The class needs to be given the capture filters ANALOGVIDEO input pin
IPin pinVideo = DsFindPin.ByCategory(this.videoCaptureFilter, PinCategory.AnalogVideoIn, 0);
if (pinVideo != null)
{
try
{
this.crossbarHelper = new CrossbarHelper(pinVideo);
}
catch{}
Marshal.ReleaseComObject(pinVideo);
}
hr = this.captureGraphBuilder.FindInterface(null, null, this.videoCaptureFilter, typeof(IAMTVAudio).GUID, out o);
if (hr >= 0)
{
this.amTVAudio = o as IAMTVAudio;
o = null;
}
}
}