/// <summary> /// Tests whether the given <see cref="WaveFormat"/> is supported as OutputFormat. /// </summary> /// <param name="outputStreamIndex">Zero-based index of an output stream on the DMO.</param> /// <param name="waveFormat">WaveFormat</param> /// <returns>True = supported, False = not supported</returns> public bool SupportsOutputFormat(int outputStreamIndex, WaveFormat waveFormat) { //experimental if (waveFormat is WaveFormatExtensible) { waveFormat = (waveFormat as WaveFormatExtensible).ToWaveFormat(); } using (MediaType mediaType = MediaType.FromWaveFormat(waveFormat)) { return(SupportsOutputFormat(outputStreamIndex, mediaType)); } }
/// <summary> /// Sets the <see cref="MediaType"/> on an output stream, or tests whether a <see cref="MediaType"/> is acceptable. /// </summary> /// <param name="outputStreamIndex">Zero-based index of an output stream on the DMO.</param> /// <param name="waveFormat">The format to set as the new <see cref="MediaType"/> for the specified output stream.</param> public void SetOutputType(int outputStreamIndex, WaveFormat waveFormat) { //experimental if (waveFormat is WaveFormatExtensible) { waveFormat = (waveFormat as WaveFormatExtensible).ToWaveFormat(); } using (MediaType mediaType = MediaType.FromWaveFormat(waveFormat)) { SetOutputType(outputStreamIndex, mediaType, SetTypeFlags.None); } }
/// <summary> /// The SetInputType method sets the media type on an input stream. /// </summary> /// <param name="inputStreamIndex">Zero-based index of an input stream on the DMO.</param> /// <param name="waveFormat">The waveformat which gets converted to the new mediatype.</param> public void SetInputType(int inputStreamIndex, WaveFormat waveFormat) { //experimental if (waveFormat is WaveFormatExtensible) { waveFormat = (waveFormat as WaveFormatExtensible).ToWaveFormat(); } MediaType mediaType = MediaType.FromWaveFormat(waveFormat); SetInputType(inputStreamIndex, mediaType, SetTypeFlags.None); mediaType.Free(); }
/// <summary> /// Tests whether the given WaveFormat is supported as OutputFormat. /// </summary> /// <param name="outputStreamIndex">Zero-based index of an output stream on the DMO.</param> /// <param name="waveFormat">WaveFormat</param> /// <returns>True = supported, False = not supported</returns> public bool SupportsOutputFormat(int outputStreamIndex, WaveFormat waveFormat) { //experimental if (waveFormat is WaveFormatExtensible) { waveFormat = (waveFormat as WaveFormatExtensible).ToWaveFormat(); } MediaType mediaType = MediaType.FromWaveFormat(waveFormat); bool result = SupportsOutputFormat(outputStreamIndex, mediaType); mediaType.Free(); return(result); }