private void AddStreamBufferSinkFilter()
{
try
{
this.streamBufferSink = (IBaseFilter)new SBE2Sink();
}
catch { }
if (this.streamBufferSink == null) // In case SBE2Sink is not supported, fallback to the former filter.
this.streamBufferSink = (IBaseFilter)new StreamBufferSink();
int hr = this.graphBuilder.AddFilter(this.streamBufferSink, "Stream Buffer Sink");
DsError.ThrowExceptionForHR(hr);
IStreamBufferInitialize streamBufferInitialize = this.streamBufferSink as IStreamBufferInitialize;
hr = streamBufferInitialize.SetHKEY(streamBufferConfigHKey);
DsError.ThrowExceptionForHR(hr);
}