Exemplo n.º 1
0
        /// <summary>
        /// Helper method to call SetOutputType
        /// </summary>
        // Token: 0x06000323 RID: 803 RVA: 0x0000A834 File Offset: 0x00008A34
        private bool SetOutputType(int outputStreamIndex, DmoMediaType mediaType, DmoSetTypeFlags flags)
        {
            int num = this.mediaObject.SetOutputType(outputStreamIndex, ref mediaType, flags);

            if (num == -2147220987)
            {
                return(false);
            }
            if (num == 0)
            {
                return(true);
            }
            throw Marshal.GetExceptionForHR(num);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the input type helper method
        /// </summary>
        /// <param name="inputStreamIndex">Input stream index</param>
        /// <param name="mediaType">Media type</param>
        /// <param name="flags">Flags (can be used to test rather than set)</param>
        // Token: 0x0600031C RID: 796 RVA: 0x0000A718 File Offset: 0x00008918
        private bool SetInputType(int inputStreamIndex, DmoMediaType mediaType, DmoSetTypeFlags flags)
        {
            int num = this.mediaObject.SetInputType(inputStreamIndex, ref mediaType, flags);

            if (num == 0)
            {
                return(true);
            }
            if (num == -2147220991)
            {
                throw new ArgumentException("Invalid stream index");
            }
            return(false);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Sets the input type helper method
 /// </summary>
 /// <param name="inputStreamIndex">Input stream index</param>
 /// <param name="mediaType">Media type</param>
 /// <param name="flags">Flags (can be used to test rather than set)</param>
 /// <returns>true if successful</returns>
 private bool SetInputType(int inputStreamIndex, DmoMediaType mediaType, DmoSetTypeFlags flags)
 {
     try
     {
         mediaObject.SetInputType(inputStreamIndex, ref mediaType, flags);
     }
     catch (COMException e)
     {
         if (e.ErrorCode == (int)DmoHResults.DMO_E_TYPE_NOT_ACCEPTED)
         {
             return(false);
         }
         throw;
     }
     return(true);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Helper method to call SetOutputType
        /// </summary>
        private bool SetOutputType(int outputStreamIndex, DmoMediaType mediaType, DmoSetTypeFlags flags)
        {
            int hresult = mediaObject.SetOutputType(outputStreamIndex, ref mediaType, flags);

            if (hresult == (int)DmoHResults.DMO_E_TYPE_NOT_ACCEPTED)
            {
                return(false);
            }
            else if (hresult == HResult.S_OK)
            {
                return(true);
            }
            else
            {
                throw Marshal.GetExceptionForHR(hresult);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Sets the input type helper method
        /// </summary>
        /// <param name="inputStreamIndex">Input stream index</param>
        /// <param name="mediaType">Media type</param>
        /// <param name="flags">Flags (can be used to test rather than set)</param>
        private bool SetInputType(int inputStreamIndex, DmoMediaType mediaType, DmoSetTypeFlags flags)
        {
            int hResult = mediaObject.SetInputType(inputStreamIndex, ref mediaType, flags);

            if (hResult != HResult.S_OK)
            {
                if (hResult == (int)DmoHResults.DMO_E_INVALIDSTREAMINDEX)
                {
                    throw new ArgumentException("Invalid stream index");
                }
                if (hResult == (int)DmoHResults.DMO_E_TYPE_NOT_ACCEPTED)
                {
                    Debug.WriteLine("Media type was not accepted");
                }

                return(false);
            }
            return(true);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Helper method to call SetOutputType
 /// </summary>
 private bool SetOutputType(int outputStreamIndex, DmoMediaType mediaType, DmoSetTypeFlags flags)
 {
     int hresult = mediaObject.SetOutputType(outputStreamIndex, ref mediaType, flags);
     if (hresult == (int)DmoHResults.DMO_E_TYPE_NOT_ACCEPTED)
     {
         return false;
     }
     else if (hresult == HResult.S_OK)
     {
         return true;
     }
     else
     {
         throw Marshal.GetExceptionForHR(hresult);
     }
 }
Exemplo n.º 7
0
        /// <summary>
        /// Sets the input type helper method
        /// </summary>
        /// <param name="inputStreamIndex">Input stream index</param>
        /// <param name="mediaType">Media type</param>
        /// <param name="flags">Flags (can be used to test rather than set)</param>
        private bool SetInputType(int inputStreamIndex, DmoMediaType mediaType, DmoSetTypeFlags flags)
        {
            int hResult = mediaObject.SetInputType(inputStreamIndex, ref mediaType, flags);
            if (hResult != HResult.S_OK)
            {
                if (hResult == (int)DmoHResults.DMO_E_INVALIDSTREAMINDEX)
                {
                    throw new ArgumentException("Invalid stream index");
                }
                if (hResult == (int)DmoHResults.DMO_E_TYPE_NOT_ACCEPTED)
                {
                    Debug.WriteLine("Media type was not accepted");
                }

                return false;
            }
            return true;
        }
Exemplo n.º 8
0
 /// <summary>
 /// Sets the input type helper method
 /// </summary>
 /// <param name="inputStreamIndex">Input stream index</param>
 /// <param name="mediaType">Media type</param>
 /// <param name="flags">Flags (can be used to test rather than set)</param>
 /// <returns>true if successful</returns>
 private bool SetInputType(int inputStreamIndex, DmoMediaType mediaType, DmoSetTypeFlags flags)
 {
     try
     {
         mediaObject.SetInputType(inputStreamIndex, ref mediaType, flags);
     }
     catch (COMException e)
     {
         if (e.ErrorCode == (int)DmoHResults.DMO_E_TYPE_NOT_ACCEPTED)
         {
             return false;
         }
         throw;
     }
     return true;
 }