Statistics
| Branch: | Tag: | Revision:

dvbd / src / rtp.h @ c6bfc590

History | View | Annotate | Download (1.36 KB)

1
#ifndef _RTP_H
2
#define _RTP_H
3

    
4
#include <sys/socket.h>
5

    
6
#ifdef __cplusplus
7
extern "C" {
8
#endif /* __cplusplus */
9

    
10
enum {RTP_PS,RTP_TS,RTP_NONE,MAP_TS};
11

    
12
struct rtpbits {
13
  unsigned int v:2;           /* version: 2 */
14
  unsigned int p:1;           /* is there padding appended: 0 */
15
  unsigned int x:1;           /* number of extension headers: 0 */
16
  unsigned int cc:4;          /* number of CSRC identifiers: 0 */
17
  unsigned int m:1;           /* marker: 0 */
18
  unsigned int pt:7;          /* payload type: 33 for MPEG2 TS - RFC 1890 */
19
  unsigned int sequence:16;   /* sequence number: random */
20
};
21

    
22
struct rtpheader {        /* in network byte order */
23
  struct rtpbits b;
24
  int timestamp;        /* start: random */
25
  int ssrc;                /* random */
26
};
27

    
28

    
29
void initrtp(struct rtpheader *foo,int pt); /* fill in the MPEG-2 TS deefaults */
30
int sendrtp(int fd, struct sockaddr_in *sSockAddr, struct rtpheader *foo, char *data, int len);
31
int getrtp2(int fd, struct rtpheader *rh, char** data, int* lengthData);
32
int sendrtp2(int fd, struct sockaddr_in *sSockAddr, struct rtpheader *foo, char *data, int len);
33
int getrtp(int fd, struct rtpheader *rh, char** data, int* lengthData);
34
int makesocket(char *szAddr,unsigned short port,int TTL,struct sockaddr_in *sSockAddr);
35
int makeclientsocket(char *szAddr,unsigned short port,int TTL,struct sockaddr_in *sSockAddr);
36

    
37
#ifdef __cplusplus
38
}
39
#endif /* __cplusplus */
40

    
41
#endif