3686
|
1 #ifndef _RTP_H
|
|
2 #define _RTP_H
|
|
3
|
|
4 #include <sys/socket.h>
|
|
5
|
|
6 struct rtpbits {
|
|
7 unsigned int v:2; /* version: 2 */
|
|
8 unsigned int p:1; /* is there padding appended: 0 */
|
|
9 unsigned int x:1; /* number of extension headers: 0 */
|
|
10 unsigned int cc:4; /* number of CSRC identifiers: 0 */
|
|
11 unsigned int m:1; /* marker: 0 */
|
|
12 unsigned int pt:7; /* payload type: 33 for MPEG2 TS - RFC 1890 */
|
|
13 unsigned int sequence:16; /* sequence number: random */
|
|
14 };
|
|
15
|
|
16 struct rtpheader { /* in network byte order */
|
|
17 struct rtpbits b;
|
|
18 int timestamp; /* start: random */
|
|
19 int ssrc; /* random */
|
|
20 };
|
|
21
|
|
22
|
|
23 void initrtp(struct rtpheader *foo); /* fill in the MPEG-2 TS deefaults */
|
|
24 int sendrtp(int fd, struct sockaddr_in *sSockAddr, struct rtpheader *foo, char *data, int len);
|
|
25 int getrtp2(int fd, struct rtpheader *rh, char** data, int* lengthData);
|
|
26 int sendrtp2(int fd, struct sockaddr_in *sSockAddr, struct rtpheader *foo, char *data, int len);
|
|
27 int getrtp(int fd, struct rtpheader *rh, char** data, int* lengthData);
|
|
28 int makesocket(char *szAddr,unsigned short port,int TTL,struct sockaddr_in *sSockAddr);
|
|
29 int makeclientsocket(char *szAddr,unsigned short port,int TTL,struct sockaddr_in *sSockAddr);
|
|
30
|
|
31 #endif
|