C++ RTSP implementation question

LearnerMan
LearnerMan used Ask the Experts™
on
I'm trying to implement a C++ RTSP client.

I have implemented the RTSP side of things.  I can connect to my RTSP server and send DESCRIBE, SETUP and PLAY commands and get the OK acks from the server.

When I do this, now do I have to open up a seperate UDP port (on the specified numbers) and simply read the data being sent back?

I know this is quite a high level description of a detailed subject but I just need a few pointers?

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2012
Commented:
Pretty much 'yes' - during SETUP, you and the server negotiate the ports used, and given that neither SETUP or PLAY reort any errors, you can start receivong - see also http://tools.ietf.org/html/rfc2326#page-33

BTW, you might find http://www.live555.com/openRTSP/#source-code helpful.

Author

Commented:
Thanks for the reply.  I will read the links you sent me. Two more questions:

1.  So Once I have sent the SETUP and PLAY with no errors (which I have done) I can simply open up a UDP socket and receive data????


2. If I want to then send PAUSE, TEARDOWN etc, all I do is send these via TCP to port 554 and use the session number that was originally assigned to the stream.

Thanks again.
jkr
Top Expert 2012

Commented:
Well, the docs don't mention any further action to be taken before you can receive the stream. And both PAUSE and TEARDOWN should be handled just as SETUP and PLAY are...
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

I might be a bit off target here because of the lack of in depth understanding of RTSP mechanics, but if it were SIP then you should be able to receive data as soon as you send the INVITE or recieved it. Some SIP extensions make early-media an explicit indication but older legacy systems may just start streaming. In any case, its necessary to create sockets before even sending out the INVITE. I have seen systems where if you dont, the ICMP port reject events cause the peer to think of a dead flow and mess up.
I'm not sure whether that applies as it to RTSP, but somehow I think that it should.
jkr
Top Expert 2012

Commented:
Well, all points have been addressed, so I'd object a deletion.
jkr
Top Expert 2012

Commented:
I'll just suggest http://www.experts-exchange.com/Programming/Languages/CPP/Q_26303815.html?cid=1573#a33130079 since it contains the link to the complete RFC.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial