Subject: [MMUSIC] RTSP state machine verison 0.5

From: Magnus Westerlund <[email-masked]>
Date: Fri, 05 Apr 2002 13:36:52 +0200

Hi,

Here comes the latest version of the state machine for RTSP. Changes done to this version is:
- Updated according to the resolutions reached during last telecon regarding setup and teardown while playing and recording, setting of resume point.
- Merged the aggregated and non-aggregated versions of record, play and ready state.

Question: Should we use 501 or 455 as error code when a server not implementing setup and teardown during playing and recording?

Please review and say what you think about this version.

Cheers

Magnus Westerlund 

Multimedia Technologies, Ericsson Research ERA/T/VA
----------------------------------------------------------------------
Ericsson Radio Systems AB  | Phone +46 8 4048287
Torshamsgatan 23           | Fax   +46 8 7575550
S-164 80 Stockholm, Sweden | mailto: [email-masked]

RTSP state machine ver. 0.5

Changes since 0.4
-----------------
- Added resolution of issue 1-3

- Merged the aggregated and non aggregated versions. This requires that
  the state variable nr-medias is checked. For nr-medias equal to one 
  certain behavior is used. For cases where nr-medias is two or more 
  other operations will happend. To avoid creating to many variants
  in the tables a important definition has been made regarding 
  presentation urls. In non aggregated control the presentation URL is 
  equal to the media URL. In aggregated control the presenttion URL is
  seperated from the media URLs. See note below.

It is based on the proposal that in aggregated control, PAUSE and PLAY
can't be used on individual medias. If that is allowed there will be
a number of extra transitions with requirements on the 
different medias state. It also using the assumption that queued play
is removed. 

There is discussion if teardown on media URL should end up in a middle
state between Init and Ready-na. This state would contain no media but
keep all session related state and keep its ID. The only way to remove 
such a state will be the teardown with * or a session timeout. It has
been added in this version with the state name "Ready-nm".

This state machine has removed the automatic state transtitions relative to
end of media or range. The automatic state transition that remain is 
session tiemout and when reaching a specifed pause point. 

Missing in state table
----------------------

Of course it is missing things but please help me find what!

Issues
------

4. Should we have the READY-nm state that this version shows?

5. When doing setup for recording is there a requirement to have done 
   announce before?

6. Should REDIRECT without range or reaching the readirect point result
   in imediatly closeing of the session? This is suggested by the old 
   client state machine that send the client to Init on redirect. The
   text in chapter 10.10 says that the client should issue a teardown
   of previous session. 

States          Explanation
-----------------------------------------------------------------------
Init            Initial state no session exist
Ready-nm        Ready state without any medias 
Ready           Session is ready to start playing or recording
Play            Session is playing
Record          Session is recording

State variables
---------------
Nr-media         The number of medias currently setuped in this session
RP = Resume point  The point that a play request without range resumes.

Abrivations
-----------

PP      Pause Point
RP      Resume point
Prs     Presentation
IFI	IF Implemented
RedP	Redirect Point
#md	Nr-media

Note: In the case that #md = 1 the presentation URL is equal to the 
      media URL. For  #md > 1 the presentation URL MUST be other than 
      any of the medias that are part of the session. This applies to 
      all states.

None state machine changeing events
Action          Prerequisite            Response
-----------------------------------------------------------------------
DESCRIBE        Needs REDIRECT          3xx Redirect
DESCRIBE                                200, Session description
OPTIONS         Session ID              200, Reset sess timeout timer
OPTIONS                                 200, Allow hdr
SET_PARAMETER   Valid parameter         200, change value of parameter
GET_PARAMETER   Valid parameter         200, return value of parameter  
ANNOUNCE        C->S, support rec.      
ANNOUNCE        S->C, update session    

State: Init
Action          Prerequisite    New State       Response
-----------------------------------------------------------------------
SETUP                           Ready           #md = 1, RP=0.0
SETUP           URL->Redirect   Init            3xx Redirect 

State: Ready-nm
Action          Prerequisite    New State       Response
-----------------------------------------------------------------------
SETUP                           Ready           #md = 1, RP=0.0
TEARDOWN        *               Init            No session hdr.
Timeout                         Init

State: Ready
Action          Prerequisite    New State       Response
-----------------------------------------------------------------------
SETUP           New URL         Ready           #md +=1
SETUP           Setuped URL     Ready           Change transport param.
TEARDOWN        *               Init            No session hdr
TEARDOWN	Prs URL,#md>1   Init		No session hdr
TEARDOWN        md URL,#md=1    Ready-nm        Session hdr, #md = 0
TEARDOWN        md URL,#md>1    Ready           Session hdr, #md -= 1
PLAY            Prs URL
 |              No range        Play            Play from RP
 |              Range           Play            according to range
RECORD                          Record
Timeout                         Init            

State: Play
Action        Prerequisite     New State       Response
-----------------------------------------------------------------------
PAUSE         PrsURL,No range   Ready           Set RP to present point
PAUSE         PrsURL,Range>now  Play            Set RP & PP to given point 
PAUSE         PrsURL,Range<=now Ready           Set RP to present pos.
PP reached                      Ready           RP = PP
End of media  All media         Play            No action, RP = Invalid
End of media  >=1 Media plays   Play            No action
End of range                    Play            Set RP = End of range
SETUP         New URL,IFI       Play            #md+=1, 200, RTP-Info
SETUP         New URL		PLAY		455 alt 501
SETUP         Setuped URL       Play            Change transport param.
TEARDOWN      URL=*             Init            No session hdr
TEARDOWN      Prs URL,#md>1     Init		No session hdr
TEARDOWN      md URL,#md=1,IFI  Ready-nm        Session hdr
TEARDOWN      md URL,#md>1,IFI  Play		Session hdr
TEARDOWN      md URL		PLAY		455 alt 501
S->C:REDIRECT Range hdr         Play      
S->C:REDIRECT no range hdr      Play		Stop Media Playout
RedP reached                    Play		Stop Media playout
Timeout                         Init

State: Record
Action          Prerequisite    New State       Response
-----------------------------------------------------------------------
PAUSE                           Ready         
Out-of-disk                     Ready
TEARDOWN      URL=*             Init            No session hdr
TEARDOWN      Prs URL,#md>1     Init		No session hdr
TEARDOWN      md URL,#md=1,IFI  Ready-nm        Session hdr
TEARDOWN      md URL,#md>1,IFI  Record          Session hdr
TEARDOWN      md URL		Record		455 alt 501
S->C:REDIRECT   Range hdr       Record          Set Redirect Point
S->C:REDIRECT   w/o range hdr   Record		Stop Recording
RedP reached                    Record          Stop Recording
Timeout                         Init