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

err = rtsp_get_msg_hdr(rspmsg, RTSP_CONTENT_LENGTH_HDR,
&sdpbuflen, NULL);
if( err!=RTSP_SUCCESS )
{
rtsp_free_msg(rspmsg);
return err;
}
/* Allocate a buffer to hold the message body
* (i.e) SDP Description */
sdpbuf = malloc(sdpbuflen*sizeof(uint8_t));
if( !sdpbuf )
{
rtsp_free_msg(rspmsg);
return err;
}
/* Get the body of the Response Message */
err = rtsp_get_msg_body(rspmsg, (uint8_t *)sdpbuf,
&sdpbuflen);
if( err!=RTSP_SUCCESS )
{
free(sdpbuf);
rtsp_free_msg(rspmsg);
return err;
}
printf(SDP Description for %s is : n
%.*s n, mediaurl, (int)sdpbuflen, sdpbuf);
free(sdpbuf);
/* Free the resources allocated for the RTSP Message */
rtsp_free_msg(rspmsg);
return RTSP_SUCCESS;
}
/*
* process_setup :
* Creates and sends a SETUP Request message to the
* server. Receives and processes the response message.
*/
rtsp_error_t
process_setup(rtsp_conn_t *rtspconn, char *setupurl,
int crtpport, int crtcpport)
{
rtsp_msg_t *reqmsg = NULL;
rtsp_msg_t *rspmsg = NULL;
rtsp_error_t err;
rtsp_xport_spec_t xspec, *serverxspec=NULL;
RTSP Sample Program 95