Beispiel #1
0
        public bool LogActivity(int Timeout, int FromStep, int ToStep, IAsyncResult Result)
        {
            InStep = false;
            DateTime Till = DateTime.Now.AddSeconds(Timeout / 1000);
            OMSDIO   ini  = new OMSDIO(omsdFileName);

            while ((ini.GetCurrentStep() < FromStep) && (DateTime.Now < Till))
            {
                System.Threading.Thread.Sleep(100);
            }
            ;

            EventConsumer.FireBeginStep(StepNames[FromStep]);
            InStep = true;

            int LogStep = FromStep;
            int MessID  = ini.GetMessageOfs(LogStep);

            while ((!Result.IsCompleted) && (DateTime.Now < Till))
            {
                RollActivityPart(ref ini, ref MessID, ref LogStep, ToStep);
            }
            if (Result.IsCompleted && (ToStep <= ini.GetCurrentStep()))
            {
                while (LogStep <= ToStep)
                {
                    if (!RollActivityPart(ref ini, ref MessID, ref LogStep, ToStep))
                    {
                        break;
                    }
                }
            }
            return(LogStep >= ToStep);
        }
        private bool GetErrorDescription(out string Error)
        {
            Error = "Internal error";
            OMSDIO ini      = new OMSDIO(FileName);
            int    FailStep = ini.GetCurrentStep();

            if (FailStep != 0)
            {
                int FailBits = ini.GetFailBits();
                for (FailStep = 0; ((FailBits & (1 << FailStep)) == 0) && (FailStep < 12); FailStep++)
                {
                }
                ;
                if (FailStep >= 12)
                {
                    return(false);
                }
            }
            switch (FailStep)
            {
            case 0:
                Error = "RTSP filter not found, please check your installation";
                break;

            case 1:
                Error = "RTSP filter internal error, initialization failed";
                break;

            case 2:
                Error = "OPTIONS command error, please check your connection";
                break;

            case 3:
                Error = "OPTIONS validation error";    //, OPTIONS = [" + ini.GetMessage(ini.GetMessageOfs(4) - 2) + "]";
                break;

            case 4:
                Error = "DESCRIBE command error, please check your connection";
                break;

            case 5:
                Error = "No known media sources found";
                break;

            case 6:
                Error = "SETUP command error";
                break;

            case 7:
                Error = "PLAY command error";
                break;

            case 8:
                Error = "No media frames within timeout, please check your connection";
                break;

            case 9:
                Error = "RTSP filter internal error - race conditions";
                break;

            case 10:
                Error = "TEARDOWN command error";
                break;

            case 11:
                Error = "RTSP filter internal error - finalization failed";
                break;
                //default :
                //Error = "ddd";
                //break;
            }
            return(true);
        }
        private bool GetErrorDescription(out string Error)
        {
            Error = "Internal error";
            OMSDIO ini      = new OMSDIO(FileName);
            int    FailStep = ini.GetCurrentStep();

            if (FailStep != 0)
            {
                int FailBits = ini.GetFailBits();
                for (FailStep = 0; ((FailBits & (1 << FailStep)) == 0) && (FailStep < step_End); FailStep++)
                {
                }
                ;
                if (FailStep >= step_End)
                {
                    return(false);
                }
            }
            switch (FailStep)
            {
            case step_Constructed:
                Error = "RTSP filter not found, please check your installation";
                break;

            case step_InitEnvironment:
                Error = "RTSP filter internal error, initialization failed";
                break;

            case step_OPTIONS:
                Error = "OPTIONS command error, please check your connection";
                break;

            case step_CheckOptions:
                Error = "OPTIONS validation error";    //, OPTIONS = [" + ini.GetMessage(ini.GetMessageOfs(4) - 2) + "]";
                break;

            case step_DESCRIBE:
                Error = "DESCRIBE command error, please check your connection";
                break;

            case step_OpenStream:
                Error = "No known media sources found";
                break;

            case step_SETUP:
                Error = "SETUP command error";
                break;

            case step_PLAY:
                Error = "PLAY command error";
                break;

            case step_WaitStream:
                Error = "No media frames within timeout, please check your connection";
                break;

            case step_PAUSE:
                Error = "PAUSE command error";
                break;

            case step_StopThread:
                Error = "RTSP filter internal error - race conditions";
                break;

            case step_TEARDOWN:
                Error = "TEARDOWN command error";
                break;

            case step_HaltEnvironment:
                Error = "RTSP filter internal error - finalization failed";
                break;
                //default :
                //Error = "ddd";
                //break;
            }
            return(true);
        }