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

Extension headers use rtp_xtn_hdr_t, a data structure, as follows:
/* RTP Extension header */
typedef struct {
uint16_t profile;
uint16_t len;
char *hdrp;}
rtp_xtn_hdr_t;
The following lists the RTP data packet APIs:
rtp_send
You can use this API to send an RTP packet to all the members that an application
specifies, using the rtp_ioctl APIs.
The declaration of rtp_send is as follows:
# include <rtp.h>
int rtp_send(int rd, rtp_pkt_t *pkt);
where pkt is a pointer to the rtp_pkt_t structure.
rtp_recv
You can use rtp_recv to receive and parse RTP packets.
The declaration of rtp_recv is as follows:
# include <rtp.h>
int rtp_recv(int rd, rtp_pkt_t *pkt, char **buf, int *buflen);
where rd is an integer value that represents an open RTP session, pkt is a pointer
to thertp_pkt_t structure that contains the parsed RTP packet, buf is the buffer
where the packet will be physically placed, and buflen is the length of buf.
The buf buffer obtains memory, upon request. To file such a request for memory
allocation, you must send a valid pointer that points to NULL; that is, *buf should
be NULL for enabling memory allocation, but buf itself is not NULL. When the
pkt argument is NULL, the RTP packet is not parsed. When *buf is not NULL,
buflen points to the size of the buffer, buf.
Upon success, rtp_recv returns the number of bytes written into the buffer buf.
Upon failure, rtp_recv returns an error number, which is a negative value. If
the return value is RTP_EMOREDATA, then buflen points to the total number of
bytes required for holding the entire RTP DATA packet. Contents of *buf are not
valid when an error is returned. To receive RTP packets, the buffer size must be
atleast 8 bytes more than the sum of the expected size of the RTP packet and the
size of the rtp_xtn_hdr_t structure.
rtp_free_buf
You can use rtp_free_buf to free the memory allocated by rtp_recv.
The declaration of rtp_free_buf is as follows:
# include <rtp.h>
int rtp_free_buf(char *buf);
22 Using MSP APIs