HP-UX Multimedia Streaming Protocols (MSP) Programmer's Guide
int setupurllen;
/*
* The mthd variable will hold the enumerated RTSP
* Method type for the Method chosen by the user
*/
rtsp_method_t mthd;
int close=0;
if( argc!=2 )
{
printf(“Usage : %s <media url> n”, argv[0]);
exit(-1);
}
mediaurl = argv[1];
/* Connect to the server specified by the mediaurl */
rtspconn = connect2server(mediaurl);
if( rtspconn==NULL )
exit(-1);
do
{
display_msg_menu();
scanf(“%d”, &msgcode);
switch(msgcode)
{
case 1:
mthd = RTSP_DESCRIBE;
err = process_describe(rtspconn, mediaurl);
break;
case 2:
mthd = RTSP_SETUP;
printf(“Enter SETUP URL (max 255 char) : “);
fflush(stdin);
fgets(setupurl, 256, stdin);
setupurllen = strlen(setupurl);
if( setupurl[setupurllen-1]==’ n’ )
setupurl[setupurllen-1]=’ 0’;
printf(“Enter Client RTP RTCP Ports : “);
scanf(“%d %d”, &crtpport, &crtcpport);
err = process_setup(rtspconn, setupurl,
crtpport, crtcpport);
break;
case 3:
mthd = RTSP_PLAY;
err = process_play(rtspconn, mediaurl);
102 Sample Programs