This repository has been archived by the owner on Jul 30, 2022. It is now read-only.
mirrored from https://chromium.googlesource.com/webm/udpsample
-
Notifications
You must be signed in to change notification settings - Fork 16
/
rtp.h
74 lines (62 loc) · 1.65 KB
/
rtp.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#define LARGESTFRAMESIZE 1000000
#define PACKET_SIZE 1370
typedef enum {
VPX_VP8,
VPX_VP9
} CODEC;
enum {
DATAPACKET = 0,
XORPACKET = 1,
};
enum {
NORMAL = 0,
KEY = 1,
GOLD = 2,
ALTREF = 3
};
enum {
LOG_PACKET = 1,
SKIP = 2,
REBUILD = 4,
DISCARD = 8,
FRAME = 16,
ERRORS = 32,
};
//#define LOG_MASK ( ERRORS |REBUILD|DISCARD|LOG_PACKET|SKIP|FRAME)
#define LOG_MASK (ERRORS)
#define R2(X) ( (((X) & 0xff) << 8) | ((X) >> 8) )
#define R4(X) ( ((X & 0xff) << 24) | ((X & 0xff00) << 8) | \
((X & 0xff0000) >> 8) | (X >> 24) )
typedef struct {
int version :2;
int pad :1;
int extension :1;
int csrccount :4;
int marker :1;
int payloadtype :7;
unsigned short seq;
unsigned int timestamp;
unsigned int ssrc;
unsigned int csrc; // repeated up to 15 times
unsigned int type :1;
unsigned int redundant_count :3;
unsigned int new_frame :1;
unsigned int end_frame :1;
unsigned int frame_type :2;
unsigned char data[PACKET_SIZE];
// this value doesn't actually get written or read
unsigned int size;
} PACKET;
#define PACKET_HEADER_SIZE offsetof(PACKET,data)
unsigned int get_time(void);
void vpxlog_dbg_no_head(int level, const tc8 *format, ...);
void vpxlog_dbg(int level, const tc8 *format, ...);