HP-UX Multimedia Streaming Protocols (MSP) Programmer's Guide
3. Use the rtsp_set_msg_hdr API to set the RTSP header information in the
message.
4. The application sends an RTSP message, identified by the rtsp_msg_t structure,
using the rtsp_send_msg API.
5. Receive the RTSP messages using rtsp_recv. To identify the message type
(request or response message), use the rtsp_is_request_msg and the
rtsp_is_response_msg APIs.
6. Retrieve the request or response line information of a message using
rtsp_get_msg_request_line and rtsp_get_msg_response_line.
7. Retrieve the header information in the RTSP message using rtsp_get_msg_hdr.
8. Free the resources allocated for the RTSP message using rtsp_free_msg.
9. Close an RTSP connection using rtsp_close.
The following lists the basic rules for using rtsp_*_t data structures in an application:
• For statically declared structures, call initialization routines. For pointer variables,
call functions that allocate memory and initialize the structures. You may have to
use a single function that performs both of these operations.
• Use the data structures.
• Deallocate resources for structure members, and deallocate resources for the
structure. You may have to use a single function that performs both of these
operations.
The following illustrates this sequence when the rtsp_msg_t, rtsp_conn_t and the
rtsp_xport_spec_t data structures are used:
• For rtsp_msg_t, call rtsp_init_request_msg, rtsp_init_response_msg,
or rtcp_recv before calling APIs that require arguments of type rtsp_msg_t
*.
In other words, you must obtain the rtsp_msg_t* data structure from
rtsp_init_request_msg, rtsp_init_response_msg, or rtsp_recv.
After calling rtsp_free_msg, you must not reference the memory location passed
to rtsp_free_msg.
The call sequence with respect to the rtsp_msg_t structure is as follows:
1. rtsp_init_request_msg (..., &msg) or rtsp_init_response_msg (...,
&msg) or
rtsp_recv(..., &msg)
2. APIs that require rtsp_msg_t* arguments.
3. rtsp_free_msg(msg);
64 Using MSP APIs