Ejemplo n.º 1
0
        void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            // Send Keepalive message
#if false
            Rtsp.Messages.RtspRequest options_message = new Rtsp.Messages.RtspRequestOptions();
            options_message.RtspUri = new Uri(url);
            if (auth_type != null)
            {
                AddAuthorization(options_message, username, password, auth_type, realm, nonce, url);
            }
            rtsp_client.SendMessage(options_message);
#else
            Rtsp.Messages.RtspRequest getparam_message = new Rtsp.Messages.RtspRequestGetParameter();
            getparam_message.RtspUri = new Uri(url);
            getparam_message.Session = session;
            if (auth_type != null)
            {
                AddAuthorization(getparam_message, username, password, auth_type, realm, nonce, url);
            }
            rtsp_client.SendMessage(getparam_message);
#endif
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the Rtsp request.
        /// </summary>
        /// <param name="aRequestParts">A request parts.</param>
        /// <returns>the parsed request</returns>
        internal static RtspMessage GetRtspRequest(string[] aRequestParts, ILogger logger)
        {
            // <pex>
            Debug.Assert(aRequestParts != (string[])null, "aRequestParts");
            Debug.Assert(aRequestParts.Length != 0, "aRequestParts.Length == 0");
            // </pex>
            // we already know this is a Request
            RtspRequest returnValue;

            switch (ParseRequest(aRequestParts[0]))
            {
            case RequestType.OPTIONS:
                returnValue = new RtspRequestOptions(logger);
                break;

            case RequestType.DESCRIBE:
                returnValue = new RtspRequestDescribe(logger);
                break;

            case RequestType.SETUP:
                returnValue = new RtspRequestSetup(logger);
                break;

            case RequestType.PLAY:
                returnValue = new RtspRequestPlay(logger);
                break;

            case RequestType.PAUSE:
                returnValue = new RtspRequestPause(logger);
                break;

            case RequestType.TEARDOWN:
                returnValue = new RtspRequestTeardown(logger);
                break;

            case RequestType.GET_PARAMETER:
                returnValue = new RtspRequestGetParameter(logger);
                break;

            case RequestType.ANNOUNCE:
                returnValue = new RtspRequestAnnounce(logger);
                break;

            case RequestType.RECORD:
                returnValue = new RtspRequestRecord(logger);
                break;

            /*
             * case RequestType.REDIRECT:
             * break;
             *
             * case RequestType.SET_PARAMETER:
             * break;
             */
            case RequestType.UNKNOWN:
            default:
                returnValue = new RtspRequest(logger);
                break;
            }



            return(returnValue);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the Rtsp request.
        /// </summary>
        /// <param name="aRequestParts">A request parts.</param>
        /// <returns>the parsed request</returns>
        internal static RtspMessage GetRtspRequest(string[] aRequestParts)
        {
            // <pex>
            Debug.Assert(aRequestParts != (string[])null, "aRequestParts");
            Debug.Assert(aRequestParts.Length != 0, "aRequestParts.Length == 0");
            // </pex>
            // we already know this is a Request
            RtspRequest returnValue;
            switch (ParseRequest(aRequestParts[0]))
            {
                case RequestType.OPTIONS:
                    returnValue = new RtspRequestOptions();
                    break;
                case RequestType.DESCRIBE:
                    returnValue = new RtspRequestDescribe();
                    break;
                case RequestType.SETUP:
                    returnValue = new RtspRequestSetup();
                    break;
                case RequestType.PLAY:
                    returnValue = new RtspRequestPlay();
                    break;
                case RequestType.PAUSE:
                    returnValue = new RtspRequestPause();
                    break;
                case RequestType.TEARDOWN:
                    returnValue = new RtspRequestTeardown();
                    break;
                case RequestType.GET_PARAMETER:
                    returnValue = new RtspRequestGetParameter();
                    break;

                    /*
                case RequestType.ANNOUNCE:
                    break;

                case RequestType.RECORD:
                    break;
                case RequestType.REDIRECT:
                    break;

                case RequestType.SET_PARAMETER:
                    break;
                     */
                case RequestType.UNKNOWN:
                default:
                    returnValue = new RtspRequest();
                    break;
            }

            return returnValue;
        }