コード例 #1
0
        private void OnFilterGraphMessage()
        {
            int       p1, p2;
            EventCode code = EventCode.None;

            if (mediaEvent == null)
            {
                return;
            }

            while (mediaEvent.GetEvent(out code, out p1, out p2, 0) == 0)
            {
                try
                {
                    int hr = mediaEvent.FreeEventParams(code, p1, p2);
                    DsError.ThrowExceptionForHR(hr);

                    Logger.LogTrace("HandleGraphEvent: code={0} p1={1} p2={2}", code, p1, p2);
                    HandleGraphEvent(code, p1, p2);
                }
                catch (COMException ex)
                {
                    Logger.LogTrace("Filter graph message loop broken because: {0}",
                                    ErrorDispatcher.GetErrorMessageForException(ex, false));
                    break;
                }
                catch (Exception ex)
                {
                    Logger.LogException(ex);
                    break;
                }
            }
        }
コード例 #2
0
        public static RenderingException FromException(Exception ex)
        {
            if (ex is RenderingException)
            {
                return(ex as RenderingException);
            }
            else if (ex is COMException)
            {
                return(new RenderingException(
                           ErrorDispatcher.GetErrorMessageForException(ex, false),
                           ex.InnerException));
            }

            return(new RenderingException(ex.Message, ex.InnerException));
        }