HP-UX Multimedia Streaming Protocols (MSP) Programmer's Guide

rtsp_error_t err;
rtsp_conn_t *rtspconn = NULL;
rtsp_url_t rtspurl;
/* Parse the url string and fill up rtspurl */
err = rtsp_parse_url(mediaurl, &rtspurl);
if( err!=RTSP_SUCCESS )
{
printf(Error parsing media url %s n, mediaurl);
return rtspconn;
}
printf(Connecting to server ... );
/* Create a RTSP Connection */
err = rtsp_open(&rtspurl, RTSP_CFLAG_CS, &rtspconn);
if( err!=RTSP_SUCCESS )
{
printf(Error n);
return rtspconn;
}
printf(Success n);
return rtspconn;
}
void
display_msg_menu()
{
printf( nAvailable RTSP Messages : n
1. DESCRIBE n2. SETUP n3. PLAY n
4. PAUSE n5. TEARDOWN n6. EXIT n
Choose one [1-6]: );
}
/*
* The basic flow of operations for the process_* routines
* is as follows :
*
* Create and Initialize the request message.
* Set the header information in the request message.
* Send the request message to the server
* Free the request message
* Receive the response message from the server.
* Retrieve header information from the response message.
* Retrieve message body from the response message.
* Free the response message
*
* In all the process_* routines, the following variables
* are used.
*
* req_msg => The RTSP Request Message
* rsp_msg => The RTSP Response Message
* err => error number returned by RTSP APIs
RTSP Sample Program 93