private void LogIfFailed(HResult hr) { if (Failed(hr)) { Debug.WriteLine("HResult Error: " + hr.ToString() + " " + hr.GetDescription()); } }
public HResult Shutdown() { Debug.WriteLine("StreamSink:Shutdown"); lock (this) { HResult hr = CheckShutdown(); if (Failed(hr)) { return(hr); } if (EventQueue != null) { hr = EventQueue.Shutdown(); if (hr.Failed()) { Debug.WriteLine("Could not shutdown EventQueue: " + hr.ToString() + " " + hr.GetDescription()); Debug.WriteLine("EventQueue Shutdown: " + hr.ToString() + " " + hr.GetDescription()); } } SafeRelease(MediaType); MediaType = null; SafeRelease(BaseSink); BaseSink = null; SafeRelease(EventQueue); EventQueue = null; State = StreamState.Finalized; } return(S_OK); }