コード例 #1
0
ファイル: MediaObject.cs プロジェクト: Minep/LunalipseMP_v2
        /// <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));
            }
        }
コード例 #2
0
ファイル: MediaObject.cs プロジェクト: Minep/LunalipseMP_v2
        /// <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);
            }
        }
コード例 #3
0
        /// <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();
        }
コード例 #4
0
        /// <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);
        }