/// <summary> /// Queries whether a stream is selected. /// </summary> /// <param name="sourceReader">A valid IMFSourceReader instance.</param></param></param> /// <param name="streamIndex">The stream to query.</param> /// <param name="mediaType">Receives True if the stream is selected and will generate data otherwise False if the stream is not selected and will not generate data.</param> /// <returns>If this function succeeds, it returns the S_OK member. Otherwise, it returns another HResult's member that describe the error.</returns> public static HResult GetStreamSelection(this IMFSourceReader sourceReader, SourceReaderFirstStream streamIndex, out bool selected) { if (sourceReader == null) { throw new ArgumentNullException("sourceReader"); } return(sourceReader.GetStreamSelection((int)streamIndex, out selected)); }