HP-UX Multimedia Streaming Protocols (MSP) Programmer's Guide
printf(“ nServer RTP and RTCP ports are %d %d n”,
(int)serverxspec->sport.rtp,
(int)serverxspec->sport.rtcp);
/* Free the resources allocated to the entire linked
* list of rtsp_xport_spec_t structures
*/
rtsp_free_xport_spec(serverxspec);
/* Retrieve Session Header information from message */
err = rtsp_get_msg_hdr(rspmsg, RTSP_SESSION_HDR,
&sessionid, &sessionidlen);
if( err!=RTSP_SUCCESS )
{
rtsp_free_msg(rspmsg);
return err;
}
printf(“Session ID is %.*s n”, sessionidlen, sessionid);
free(sessionid);
/* Free the resources allocated for the response Message */
rtsp_free_msg(rspmsg);
return RTSP_SUCCESS;
}
/*
* process_play :
* Creates and sends a PLAY Request message to the server.
* Receives and process the response message for PLAY.
*/
rtsp_error_t
process_play(rtsp_conn_t *rtspconn, char *mediaurl)
{
rtsp_msg_t *reqmsg = NULL;
rtsp_msg_t *rspmsg = NULL;
rtsp_error_t err;
rtsp_rtpinfo_t *rtpinfo = NULL, *prtpinfo;
/* Create a PLAY RTSP Request Message */
err = rtsp_init_request_msg(RTSP_PLAY, mediaurl, &reqmsg);
if( err!=RTSP_SUCCESS )
return err;
/* Send the Request Message */
err = rtsp_send_msg(rtspconn, NULL, reqmsg, 0);
/* Free the resources allocated for the request message */
rtsp_free_msg(reqmsg);
RTSP Sample Program 97