Class RTPSession


  • public class RTPSession
    extends Object

    RTPSession: RTP session

    • Field Detail

      • sessionId

        protected String sessionId
      • rtspTunnelingSessionId

        protected String rtspTunnelingSessionId
      • streams

        protected java.util.Map<String,​RTPStream> streams
      • streamsOrder

        protected java.util.List<RTPStream> streamsOrder
      • vhost

        protected IVHost vhost
      • userAgent

        protected String userAgent
      • cookieStr

        protected String cookieStr
      • ip

        protected String ip
      • isSessionValid

        protected boolean isSessionValid
      • lastAuthenticateMethod

        protected int lastAuthenticateMethod
      • loggedConnect

        protected boolean loggedConnect
      • isDescribe

        protected boolean isDescribe
      • isAnnounce

        protected boolean isAnnounce
      • rtpWriteListener

        protected com.wowza.wms.rtp.model.RTPWriteListener rtpWriteListener
      • timeCreated

        protected long timeCreated
      • connectionHolder

        protected com.wowza.wms.client.ConnectionHolder connectionHolder
      • isConnected

        protected boolean isConnected
      • idleHandler

        protected com.wowza.wms.rtp.model.RTPIdleHandler idleHandler
      • serverIp

        protected String serverIp
      • serverPort

        protected int serverPort
      • uri

        protected String uri
      • referrer

        protected String referrer
      • queryStr

        protected String queryStr
      • idleFrequency

        protected int idleFrequency
      • debugRTSPSession

        protected boolean debugRTSPSession
      • rtspPlayRangeStart

        protected double rtspPlayRangeStart
      • rtspPlayRangeStop

        protected double rtspPlayRangeStop
      • shutdownClient

        protected boolean shutdownClient
      • audioPacketizers

        protected java.util.Map<Integer,​com.wowza.wms.rtp.model.RTPPacketizerItem> audioPacketizers
      • videoPacketizers

        protected java.util.Map<Integer,​com.wowza.wms.rtp.model.RTPPacketizerItem> videoPacketizers
      • streamPacketizers

        protected java.util.Map<Integer,​com.wowza.wms.rtp.model.RTPPacketizerItem> streamPacketizers
      • redirectSession

        protected boolean redirectSession
      • redirectSessionCode

        protected int redirectSessionCode
      • redirectSessionMessage

        protected String redirectSessionMessage
      • redirectSessionURL

        protected String redirectSessionURL
      • lock

        protected Object lock
      • ioSession

        protected org.apache.mina.common.support.BaseIoSession ioSession
      • active

        protected boolean active
      • webRTCSession

        protected com.wowza.wms.webrtc.model.WebRTCSession webRTCSession
      • multicastInterfaceAddress

        protected String multicastInterfaceAddress
      • checkIpAddresses

        protected boolean checkIpAddresses
    • Constructor Detail

      • RTPSession

        public RTPSession​(String sessionId)
        Constructor
        Parameters:
        sessionId - session id
    • Method Detail

      • acceptSession

        public void acceptSession()
        Accept this session
      • rejectSession

        public void rejectSession()
        Reject this session
      • getSessionId

        public String getSessionId()
        Get session id
        Returns:
        session id
      • setSessionId

        public void setSessionId​(String sessionId)
        Set session id
        Parameters:
        sessionId - session id
      • addRTSPStream

        public void addRTSPStream​(RTPStream stream)
        Add RTP stream
        Parameters:
        stream - RTP stream
      • removeRTSPStream

        public RTPStream removeRTSPStream​(String streamId)
        Remove RTP stream
        Parameters:
        streamId - stream id
        Returns:
        RTP stream
      • getRTSPStream

        public RTPStream getRTSPStream​(String streamId)
        Get RTP Stream
        Parameters:
        streamId - stream id
        Returns:
        RTP Stream
      • getRTSPStream

        public RTPStream getRTSPStream()
        Get the default RTP Stream (all RTP sessions have a single RTP Stream)
        Returns:
        RTP stream
      • getVHost

        public IVHost getVHost()
        Get vhost
        Returns:
        vhost
      • setVHost

        public void setVHost​(IVHost vhost)
        Set vhost
        Parameters:
        vhost - vhost
      • getUserAgent

        public String getUserAgent()
        Get user agent
        Returns:
        user agent
      • setUserAgent

        public void setUserAgent​(String userAgent)
        Set user agent
        Parameters:
        userAgent - user agent
      • touch

        public void touch()
        Touch the stream so it doesn't timeout
      • shutdown

        public void shutdown()
        shutdown RTP session, Internal use.
      • shutdown

        public void shutdown​(com.wowza.wms.rtp.model.RTPRequestStatus status)
        shutdown RTP session, Internal use.
        Parameters:
        status -
      • allPortsConnected

        public boolean allPortsConnected()
      • isSessionValid

        public boolean isSessionValid()
        Is this session valid
        Returns:
        true if valid
      • setSessionValid

        public void setSessionValid​(boolean isSessionValid)
        Set session valid
        Parameters:
        isSessionValid - true if valid
      • getAuthenticatePublishHandler

        public IAuthenticateRTSP getAuthenticatePublishHandler()
        Get the RTP authentication handler
        Returns:
        RTP authentication handler
      • setAuthenticatePublishHandler

        public void setAuthenticatePublishHandler​(IAuthenticateRTSP authenticatePublishHandler)
        Set the RTP authentication handler
        Parameters:
        authenticatePublishHandler - RTP authentication handler
      • getAuthenticatePlayHandler

        public IAuthenticateRTSP getAuthenticatePlayHandler()
        Get the authentication play handler
        Returns:
        authentication play handler
      • setAuthenticatePlayHandler

        public void setAuthenticatePlayHandler​(IAuthenticateRTSP authenticatePlayHandler)
        Set the authentication play handler
        Parameters:
        authenticatePlayHandler - authentication play handler
      • getLastAuthenticateMethod

        public int getLastAuthenticateMethod()
        Get the last method received
        Returns:
        last method received
      • setLastAuthenticateMethod

        public void setLastAuthenticateMethod​(int lastAuthenticateMethod)
        Set last method received
        Parameters:
        lastAuthenticateMethod - last method received
      • getAppInstance

        public IApplicationInstance getAppInstance()
        Get application instance
        Returns:
        application instance
      • setAppInstance

        public void setAppInstance​(IApplicationInstance appInstance)
        Set application instance
        Parameters:
        appInstance - application instance
      • isLoggedConnect

        public boolean isLoggedConnect()
        Is connect logged
        Returns:
        true if logged
      • setLoggedConnect

        public void setLoggedConnect​(boolean loggedConnect)
        Set connect logged
        Parameters:
        loggedConnect - true if logged
      • getIp

        public String getIp()
        Get remote IP address
        Returns:
        remote IP address
      • setIp

        public void setIp​(String ip)
        Set remote IP address
        Parameters:
        ip - remote IP address
      • getProperties

        public WMSProperties getProperties()
        Get properties
        Returns:
        properties
      • isDescribe

        public boolean isDescribe()
        Has DESCRIBE command been called on this session
        Returns:
        true if called
      • setDescribe

        public void setDescribe​(boolean isDescribe)
        Set DESCRIBE command been called on this session
        Parameters:
        isDescribe - true if called
      • isAnnounce

        public boolean isAnnounce()
        Has ANNOUNCE command been called on this session
        Returns:
        true if called
      • setAnnounce

        public void setAnnounce​(boolean isAnnounce)
        Set ANNOUNCE command been called on this session
        Parameters:
        isAnnounce - true if called
      • isAnnounceOrDescribe

        public boolean isAnnounceOrDescribe()
        Has announce or described been called
        Returns:
        true if either called
      • getRTPWriteListener

        public com.wowza.wms.rtp.model.RTPWriteListener getRTPWriteListener()
        Get the RTP write listener for this session
        Returns:
        RTP write listener
      • addIOPerformance

        public void addIOPerformance​(IOPerformanceCounter totalIOPerformanceResult)
        Internal use
        Parameters:
        totalIOPerformanceResult - IO performance counter
      • addIOPerformance2

        public void addIOPerformance2​(IOPerformanceCounter totalIOPerformanceResult)
        Internal use
        Parameters:
        totalIOPerformanceResult - IO performance counter
      • getConnectionHolder

        public com.wowza.wms.client.ConnectionHolder getConnectionHolder()
        Get connection holder, Internal use.
        Returns:
        connection holder
      • isConnected

        public boolean isConnected()
        Is session connection
        Returns:
        true if connected
      • setConnected

        public void setConnected​(boolean isConnected)
        Set session is connected
        Parameters:
        isConnected - true if connected
      • getIdleHandler

        public com.wowza.wms.rtp.model.RTPIdleHandler getIdleHandler()
        Get idle handler
        Returns:
        idle handler
      • setIdleHandler

        public void setIdleHandler​(com.wowza.wms.rtp.model.RTPIdleHandler idleHandler)
        Set idle handler
        Parameters:
        idleHandler - idle handler
      • getServerIp

        public String getServerIp()
        Get the server IP address
        Returns:
        IP address
      • setServerIp

        public void setServerIp​(String serverIp)
        Set the server IP address
        Parameters:
        serverIp - IP address
      • getServerPort

        public int getServerPort()
        Get server port
        Returns:
        server port
      • setServerPort

        public void setServerPort​(int serverPort)
        Set server port
        Parameters:
        serverPort - server port
      • getUri

        public String getUri()
        Get URI
        Returns:
        URI
      • setUri

        public void setUri​(String uri)
        Set URI
        Parameters:
        uri - URI
      • getReferrer

        public String getReferrer()
        Get referrer
        Returns:
        referrer
      • setReferrer

        public void setReferrer​(String referrer)
        Set referrer
        Parameters:
        referrer - referrer
      • getQueryStr

        public String getQueryStr()
        Get query string
        Returns:
        query string
      • setQueryStr

        public void setQueryStr​(String queryStr)
        Set query string
        Parameters:
        queryStr - query string
      • updateLoggingValues

        public void updateLoggingValues()
        Update logging values, Internal use.
      • clearLoggingValues

        public void clearLoggingValues()
        Clear logging values, Internal use.
      • addActionListener

        public void addActionListener​(IRTSPActionNotify actionListener)
        Add action listener
        Parameters:
        actionListener - action listener
      • removeActionListener

        public void removeActionListener​(IRTSPActionNotify actionListener)
        Remove action listener
        Parameters:
        actionListener - action listener
      • onDescribe

        public void onDescribe​(com.wowza.wms.rtsp.RTSPRequestMessage req,
                               com.wowza.wms.rtsp.RTSPResponseMessages resp)
        Invoked on DESCRIBE command
        Parameters:
        req - RTP request
        resp - RTP response
      • onAnnounce

        public void onAnnounce​(com.wowza.wms.rtsp.RTSPRequestMessage req,
                               com.wowza.wms.rtsp.RTSPResponseMessages resp)
        Invoked on ANNOUNCE command
        Parameters:
        req - RTP request
        resp - RTP response
      • onGetParameter

        public void onGetParameter​(com.wowza.wms.rtsp.RTSPRequestMessage req,
                                   com.wowza.wms.rtsp.RTSPResponseMessages resp)
        Invoked on GET_PARAMETER command
        Parameters:
        req - RTP request
        resp - RTP response
      • onSetParameter

        public void onSetParameter​(com.wowza.wms.rtsp.RTSPRequestMessage req,
                                   com.wowza.wms.rtsp.RTSPResponseMessages resp)
        Invoked on SET_PARAMETER command
        Parameters:
        req - RTP request
        resp - RTP response
      • onOptions

        public void onOptions​(com.wowza.wms.rtsp.RTSPRequestMessage req,
                              com.wowza.wms.rtsp.RTSPResponseMessages resp)
        Invoked on OPTIONS command
        Parameters:
        req - RTP request
        resp - RTP response
      • onPause

        public void onPause​(com.wowza.wms.rtsp.RTSPRequestMessage req,
                            com.wowza.wms.rtsp.RTSPResponseMessages resp)
        Invoked on PAUSE command
        Parameters:
        req - RTP request
        resp - RTP response
      • onPlay

        public void onPlay​(com.wowza.wms.rtsp.RTSPRequestMessage req,
                           com.wowza.wms.rtsp.RTSPResponseMessages resp)
        Invoked on PLAY command
        Parameters:
        req - RTP request
        resp - RTP response
      • onRecord

        public void onRecord​(com.wowza.wms.rtsp.RTSPRequestMessage req,
                             com.wowza.wms.rtsp.RTSPResponseMessages resp)
        Invoked on RECORD command
        Parameters:
        req - RTP request
        resp - RTP response
      • onRedirect

        public void onRedirect​(com.wowza.wms.rtsp.RTSPRequestMessage req,
                               com.wowza.wms.rtsp.RTSPResponseMessages resp)
        Invoked on REDIRECT command
        Parameters:
        req - RTP request
        resp - RTP response
      • onSetup

        public void onSetup​(com.wowza.wms.rtsp.RTSPRequestMessage req,
                            com.wowza.wms.rtsp.RTSPResponseMessages resp)
        Invoked on SETUP command
        Parameters:
        req - RTP request
        resp - RTP response
      • onTeardown

        public void onTeardown​(com.wowza.wms.rtsp.RTSPRequestMessage req,
                               com.wowza.wms.rtsp.RTSPResponseMessages resp)
        Invoked on TEARDOWN command
        Parameters:
        req - RTP request
        resp - RTP response
      • getIdleFrequency

        public int getIdleFrequency()
        Get idle frequency (milliseconds)
        Returns:
        idle frequency (milliseconds)
      • setIdleFrequency

        public void setIdleFrequency​(int idleFrequency)
        Set idle frequency (milliseconds)
        Parameters:
        idleFrequency - idle frequency (milliseconds)
      • isDebugRTSPSession

        public boolean isDebugRTSPSession()
        True if debugging RTSP session
        Returns:
        true if debugging RTSP session
      • setDebugRTSPSession

        public void setDebugRTSPSession​(boolean debugRTSPSession)
        Set debugging RTSP session
        Parameters:
        debugRTSPSession - true if debugging RTSP session
      • debugRTCPMessages

        public boolean debugRTCPMessages()
        True if debugging RTCP messages being sent for the RTP session
        Returns:
        true if debugging RTCP messages being sent for the RTP session
      • setDebugRTCPMessages

        public void setDebugRTCPMessages​(boolean debugRTCPMessages)
        Set debugging RTCP messages being sent for the RTP session
        Parameters:
        debugRTCPMessages - RTCP messages being sent for the RTP session
      • getRTSPTunnelingSessionId

        public String getRTSPTunnelingSessionId()
        Get the RTSP/RTP tunneling session id
        Returns:
        RTSP/RTP tunneling session id
      • setRTSPTunnelingSessionId

        public void setRTSPTunnelingSessionId​(String rtspTunnelingSessionId)
        Set the RTSP/RTP tunneling session id
        Parameters:
        rtspTunnelingSessionId - RTSP/RTP tunneling session id
      • getRTSPPlayRangeStart

        public double getRTSPPlayRangeStart()
        Get play start range, Internal use.
        Returns:
        start range
      • setRTSPPlayRangeStart

        public void setRTSPPlayRangeStart​(double rtspPlayRangeStart)
        Set play start range, Internal use.
        Parameters:
        rtspPlayRangeStart - start range
      • getRTSPPlayRangeStop

        public double getRTSPPlayRangeStop()
        Get play stop range, Internal use.
        Returns:
        stop range
      • setRTSPPlayRangeStop

        public void setRTSPPlayRangeStop​(double rtspPlayRangeStop)
        Set play stop range, Internal use.
        Parameters:
        rtspPlayRangeStop - stop range
      • getCookieStr

        public String getCookieStr()
        Get cookie string
        Returns:
        cookie string
      • setCookieStr

        public void setCookieStr​(String cookieStr)
        Set cooking string
        Parameters:
        cookieStr - cooking string
      • getIOPerformanceCounter

        public IOPerformanceCounter getIOPerformanceCounter()
        Get IO performance counter
        Returns:
        IO performance counter
      • setIOPerformanceCounter

        public void setIOPerformanceCounter​(IOPerformanceCounter ioPerformanceCounter)
        Set IO performance counter
        Parameters:
        ioPerformanceCounter - IO performance counter
      • isShutdownClient

        public boolean isShutdownClient()
        Is RTP session shutdown
        Returns:
        true if shutdown
      • setShutdownClient

        public void setShutdownClient​(boolean shutdownClient)
        Set RTP session shutdown
        Parameters:
        shutdownClient - true if shutdown
      • getAudioPacketizerItem

        public com.wowza.wms.rtp.model.RTPPacketizerItem getAudioPacketizerItem​(RTPContext rtpContext,
                                                                                IApplicationInstance appInstance,
                                                                                int codecId)
        Get audio packetizer for a given codec id.
        Parameters:
        rtpContext - RTP context
        appInstance - application instance
        codecId - codec id
        Returns:
        packetizer info
      • getVideoPacketizerItem

        public com.wowza.wms.rtp.model.RTPPacketizerItem getVideoPacketizerItem​(RTPContext rtpContext,
                                                                                IApplicationInstance appInstance,
                                                                                int codecId)
        Get video packetizer for a given codec id.
        Parameters:
        rtpContext - RTP context
        appInstance - application instance
        codecId - codec id
        Returns:
        packetizer info
      • getStreamPacketizerItem

        public com.wowza.wms.rtp.model.RTPPacketizerItem getStreamPacketizerItem​(RTPContext rtpContext,
                                                                                 IApplicationInstance appInstance,
                                                                                 int codecId)
        Get stream packetizer for a given codec id.
        Parameters:
        rtpContext - RTP context
        appInstance - application instance
        codecId - codec id
        Returns:
        packetizer info
      • putAudioPacketizerItem

        public void putAudioPacketizerItem​(int codecId,
                                           String classPath)
        Set the audio packetizer for a given codec id
        Parameters:
        codecId - codec id
        classPath - class path
      • putVideoPacketizerItem

        public void putVideoPacketizerItem​(int codecId,
                                           String classPath)
        Set the video packetizer for a given codec id
        Parameters:
        codecId - codec id
        classPath - class path
      • putStreamPacketizerItem

        public void putStreamPacketizerItem​(int codecId,
                                            String classPath)
        Set the stream packetizer for a given codec id
        Parameters:
        codecId - codec id
        classPath - class path
      • getElapsedTime

        public ElapsedTimer getElapsedTime()
        Get the elapsed timer for this RTP session
        Returns:
        elapsed timer
      • getTimeRunning

        public String getTimeRunning()
        Get the time running for this RTP session
        Returns:
        time running as a string
      • getTimeRunningSeconds

        public double getTimeRunningSeconds()
        Get the number of second this RTP session has been running
        Returns:
        number of second this RTP session has been running
      • isRedirectSession

        public boolean isRedirectSession()
      • setRedirectSession

        public void setRedirectSession​(boolean redirectSession)
      • getRedirectSessionCode

        public int getRedirectSessionCode()
      • setRedirectSessionCode

        public void setRedirectSessionCode​(int redirectSessionCode)
      • getRedirectSessionURL

        public String getRedirectSessionURL()
      • setRedirectSessionURL

        public void setRedirectSessionURL​(String redirectSessionURL)
      • redirectSession

        public void redirectSession​(String redirectSessionURL)
      • redirectSession

        public void redirectSession​(String redirectSessionURL,
                                    int redirectSessionCode)
      • getRedirectSessionMessage

        public String getRedirectSessionMessage()
      • setRedirectSessionMessage

        public void setRedirectSessionMessage​(String redirectSessionMessage)
      • getIoSession

        public org.apache.mina.common.support.BaseIoSession getIoSession()
      • setIoSession

        public void setIoSession​(org.apache.mina.common.support.BaseIoSession ioSession)
      • doIdle

        public void doIdle()
      • isActive

        public boolean isActive()
      • getWebRTCSession

        public com.wowza.wms.webrtc.model.WebRTCSession getWebRTCSession()
      • setWebRTCSession

        public void setWebRTCSession​(com.wowza.wms.webrtc.model.WebRTCSession webRTCSession)
      • isWebRTC

        public boolean isWebRTC()
      • getMulticastInterfaceAddress

        public String getMulticastInterfaceAddress()
      • setMulticastInterfaceAddress

        public void setMulticastInterfaceAddress​(String multicastInterfaceAddress)
      • isCheckIpAddresses

        public boolean isCheckIpAddresses()
        Returns:
        the checkIpAddresses
      • setCheckIpAddresses

        public void setCheckIpAddresses​(boolean checkIpAddresses)
        Set whether the ip address on incoming RTP/RTCP messages should be checked against the initial source ip address received on the port, or for RTSP sessions, the source ip address retrieved diring the RTSP negotiation. Default false.
        Parameters:
        checkIpAddresses - the checkIpAddresses to set