Hey experts,
I am working on a project that involves communication between RTSP
server & client, and I just want help in the code that does the 1st
SETUP request, and creates the RTP socket on which the communication
will be done.
In general the following are the requirements of the project:
I need to implement an RTSP client application that will send specific
requests to an RTSP server in order to stream a video using the RTP
protocol. Therefore, I have to implement an RTSP server application
that will respond to requests from the RTSP client application.
Moreover, I have to build appropriate socket interfaces and define
ports over which the communication between the server and the client
will take place
1. Client sends SETUP. This command is used to set up the session and
transport parameters.
2. Client sends PLAY. This starts the playback of the video.
3. Client may send PAUSE in order to pause during playback.
4. Client sends TEARDOWN. This terminates the session and closes the connection.
I want help in only the 1st step, and I will do the rest (since I have
already done them previously for a simulated UDP socket)
What I want specifically is the following:
? If the client state is INIT (the initial state of the client),
create a UDP socket for receiving RTP data (different from the RTSP
socket), set the timeout on the socket to 5 milliseconds (this value
can be changed if necessary, requires justification), and change the
state to READY.
? Send SETUP request to the RTSP server. You will need to insert the
Transport header in which you specify the port for the RTP data socket
you just created (make sure to select an unused port number).
? Read reply from RTSP server (the reply for a successful server
response should be 200) and parse the Session header in the response
to get the session ID (the session ID can be selected arbitrarily).
Here is a sample of the data that should be transferred between the
client (C) & the server (S) in the SETUP request:
C: SETUP
C: CSeq: 1
C: Transport: RTP/UDP; client_port= 25000
S: RTSP 200 OK
S: CSeq: 1
S: Session: 123456 |