private void ConnectStreamBufferSinkToSource()
{
if (!Directory.Exists(Settings.VideosFolder))
Directory.CreateDirectory(Settings.VideosFolder);
string currentSBEProfile = Settings.VideosFolder + "\\CurrentRecording.sbe-stub";
string currentSBEProfileFilename = FileUtils.GetAbsolutePath(currentSBEProfile as string);
IStreamBufferSink sink = this.streamBufferSink as IStreamBufferSink;
int hr = sink.LockProfile(currentSBEProfile); //currentSBEProfileFilename); //currentSBEProfile);
DsError.ThrowExceptionForHR(hr);
IStreamBufferSource source = this.streamBufferSource as IStreamBufferSource;
hr = source.SetStreamSink(sink); // This line does not seem to be compatible with SBE2Sink.
//So, I commented out the generation of exception DsError.ThrowExceptionForHR(hr);
hr = (source as IFileSourceFilter).Load(currentSBEProfile, null); //currentSBEProfileFilename, null); //currentSBEProfile, null);
DsError.ThrowExceptionForHR(hr);
}