summaryrefslogtreecommitdiffstats
path: root/stream/rtp.h
blob: c244eff2f4e168761093b54f8074a1cedfd58879 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* Imported from the dvbstream project
 *
 * Modified for use with MPlayer, for details see the changelog at
 * http://svn.mplayerhq.hu/mplayer/trunk/
 * $Id$
 */

#ifndef _RTP_H
#define _RTP_H

#include "config.h"
#ifndef HAVE_WINSOCK2
#include <sys/socket.h>
#else
#include <winsock2.h>
#endif

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

struct rtpheader {	/* in network byte order */
  struct rtpbits b;
  int timestamp;	/* start: random */
  int ssrc;		/* random */
};


static int getrtp2(int fd, struct rtpheader *rh, char** data, int* lengthData);
int read_rtp_from_server(int fd, char *buffer, int length);

#endif