blob: 8490d62e82e3c08d6357de637688d5cc844bab29 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11/*
12 * RTP data struct and related functions.
13 */
14
15#ifndef RTP_H
16#define RTP_H
17
18#include "typedefs.h"
19
20#include "codec_db.h"
21
22typedef struct
23{
24 WebRtc_UWord16 seqNumber;
25 WebRtc_UWord32 timeStamp;
26 WebRtc_UWord32 ssrc;
27 int payloadType;
28 const WebRtc_Word16 *payload;
29 WebRtc_Word16 payloadLen;
30 WebRtc_Word16 starts_byte1;
31 WebRtc_Word16 rcuPlCntr;
32} RTPPacket_t;
33
34/****************************************************************************
35 * WebRtcNetEQ_RTPPayloadInfo(...)
36 *
37 * Converts a datagram into an RTP header struct.
38 *
39 * Input:
40 * - Datagram : UDP datagram from the network
41 * - DatagramLen : Length in bytes of the datagram
42 *
43 * Output:
44 * - RTPheader : Structure with the datagram info
45 *
46 * Return value : 0 - Ok
47 * -1 - Error
48 */
49
50int WebRtcNetEQ_RTPPayloadInfo(WebRtc_Word16* pw16_Datagram, int i_DatagramLen,
51 RTPPacket_t* RTPheader);
52
53/****************************************************************************
54 * WebRtcNetEQ_RedundancySplit(...)
55 *
56 * Splits a Redundancy RTP struct into two RTP structs. User has to check
57 * that it's really the redundancy payload. No such check is done inside this
58 * function.
59 *
60 * Input:
61 * - RTPheader : First header holds the whole RTP packet (with the redundancy payload)
62 * - MaximumPayloads:
63 * The maximum number of RTP payloads that should be
64 * extracted (1+maximum_no_of_Redundancies).
65 *
66 * Output:
67 * - RTPheader : First header holds the main RTP data, while 2..N
68 * holds the redundancy data.
69 * - No_Of
70 *
71 * Return value : 0 - Ok
72 * -1 - Error
73 */
74
75int WebRtcNetEQ_RedundancySplit(RTPPacket_t* RTPheader[], int i_MaximumPayloads,
76 int *i_No_Of_Payloads);
77
78#endif