Esempio n. 1
0
        /// <summary>
        /// Applies an audio or video effect to playback.
        /// </summary>
        /// <param name="mediaPlayer">A valid IMFPMediaPlayer instance.</param>
        /// <param name="activate">An activation object that creates an MFT.</param>
        /// <param name="optional">
        /// <list type="bullet">
        ///     <item>
        ///     <term>True</term>
        ///     <description>The effect is optional. If the MFPlay player object cannot add the effect, it ignores the effect and continues playback.</description>
        ///     </item>
        ///     <item>
        ///     <term>False</term>
        ///     <description>The effect is required. If the MFPlay player object cannot add the effect, a playback error occurs.</description>
        ///     </item>
        /// </list>
        /// </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 InsertEffect(this IMFPMediaPlayer mediaPlayer, IMFActivate activate, bool optional)
        {
            if (mediaPlayer == null)
            {
                throw new ArgumentNullException("mediaPlayer");
            }

            return(mediaPlayer.InsertEffect(activate, optional));
        }
Esempio n. 2
0
        /// <summary>
        /// Applies an audio or video effect to playback.
        /// </summary>
        /// <param name="mediaPlayer">A valid IMFPMediaPlayer instance.</param>
        /// <param name="transform">A Media Foundation transform (MFT) that implements the effect.</param>
        /// <param name="optional">
        /// <list type="bullet">
        ///     <item>
        ///     <term>True</term>
        ///     <description>The effect is optional. If the MFPlay player object cannot add the effect, it ignores the effect and continues playback.</description>
        ///     </item>
        ///     <item>
        ///     <term>False</term>
        ///     <description>The effect is required. If the MFPlay player object cannot add the effect, a playback error occurs.</description>
        ///     </item>
        /// </list>
        /// </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 InsertEffect(this IMFPMediaPlayer mediaPlayer, IMFTransform transform, bool optional)
        {
            if (mediaPlayer == null)
            {
                throw new ArgumentNullException("mediaPlayer");
            }

            return(mediaPlayer.InsertEffect(transform, optional));
        }