diff options
author | mannol <eniz_vukovic@hotmail.com> | 2015-02-17 23:34:40 +0100 |
---|---|---|
committer | mannol <eniz_vukovic@hotmail.com> | 2015-02-17 23:34:40 +0100 |
commit | 483a6ffa328e8699d156633ab3e0016171e11dd8 (patch) | |
tree | 78f7f6e555ad589a9242b93803023f30e2aa4ee3 /toxav/rtp.h | |
parent | 7329f3b3d461a8f7738fa4b13a2dffc8d6a5b5f5 (diff) |
Added 2 new headers into msi for buffer control
Diffstat (limited to 'toxav/rtp.h')
-rw-r--r-- | toxav/rtp.h | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/toxav/rtp.h b/toxav/rtp.h index b1888f6c..e3b38a8e 100644 --- a/toxav/rtp.h +++ b/toxav/rtp.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /** rtp.h | 1 | /** rtp.h |
2 | * | 2 | * |
3 | * Copyright (C) 2013 Tox project All Rights Reserved. | 3 | * Copyright (C) 2013-2015 Tox project All Rights Reserved. |
4 | * | 4 | * |
5 | * This file is part of Tox. | 5 | * This file is part of Tox. |
6 | * | 6 | * |
@@ -31,13 +31,18 @@ | |||
31 | #define MAX_SEQU_NUM 65535 | 31 | #define MAX_SEQU_NUM 65535 |
32 | #define MAX_RTP_SIZE 65535 | 32 | #define MAX_RTP_SIZE 65535 |
33 | 33 | ||
34 | /** | ||
35 | * Payload type identifier. Also used as rtp callback prefix. | ||
36 | */ | ||
34 | typedef enum { | 37 | typedef enum { |
35 | rtp_ErrorSending = -40 | 38 | rtp_TypeAudio = 192, |
36 | } RTPError; | 39 | rtp_TypeVideo |
40 | } RTPPayloadType; | ||
41 | |||
37 | /** | 42 | /** |
38 | * Standard rtp header | 43 | * Standard rtp header |
39 | */ | 44 | */ |
40 | typedef struct _RTPHeader { | 45 | typedef struct { |
41 | uint8_t flags; /* Version(2),Padding(1), Ext(1), Cc(4) */ | 46 | uint8_t flags; /* Version(2),Padding(1), Ext(1), Cc(4) */ |
42 | uint8_t marker_payloadt; /* Marker(1), PlayLoad Type(7) */ | 47 | uint8_t marker_payloadt; /* Marker(1), PlayLoad Type(7) */ |
43 | uint16_t sequnum; /* Sequence Number */ | 48 | uint16_t sequnum; /* Sequence Number */ |
@@ -51,7 +56,7 @@ typedef struct _RTPHeader { | |||
51 | /** | 56 | /** |
52 | * Standard rtp extension header. | 57 | * Standard rtp extension header. |
53 | */ | 58 | */ |
54 | typedef struct _RTPExtHeader { | 59 | typedef struct { |
55 | uint16_t type; /* Extension profile */ | 60 | uint16_t type; /* Extension profile */ |
56 | uint16_t length; /* Number of extensions */ | 61 | uint16_t length; /* Number of extensions */ |
57 | uint32_t *table; /* Extension's table */ | 62 | uint32_t *table; /* Extension's table */ |
@@ -61,45 +66,43 @@ typedef struct _RTPExtHeader { | |||
61 | /** | 66 | /** |
62 | * Standard rtp message. | 67 | * Standard rtp message. |
63 | */ | 68 | */ |
64 | typedef struct _RTPMessage { | 69 | typedef struct { |
65 | RTPHeader *header; | 70 | RTPHeader *header; |
66 | RTPExtHeader *ext_header; | 71 | RTPExtHeader *ext_header; |
67 | 72 | ||
68 | uint8_t data[MAX_RTP_SIZE]; | 73 | uint8_t data[MAX_RTP_SIZE]; |
69 | uint32_t length; | 74 | uint32_t length; |
70 | |||
71 | struct _RTPMessage *next; | ||
72 | } RTPMessage; | 75 | } RTPMessage; |
73 | 76 | ||
74 | /** | 77 | /** |
75 | * RTP control session. | 78 | * RTP control session. |
76 | */ | 79 | */ |
77 | typedef struct _RTPSession { | 80 | typedef struct { |
78 | uint8_t version; | 81 | uint8_t version; |
79 | uint8_t padding; | 82 | uint8_t padding; |
80 | uint8_t extension; | 83 | uint8_t extension; |
81 | uint8_t cc; | 84 | uint8_t cc; |
82 | uint8_t marker; | 85 | uint8_t marker; |
83 | uint8_t payload_type; | 86 | uint8_t payload_type; |
84 | uint16_t sequnum; /* Set when sending */ | 87 | uint16_t sequnum; /* Set when sending */ |
85 | uint16_t rsequnum; /* Check when recving msg */ | 88 | uint16_t rsequnum; /* Check when recving msg */ |
86 | uint32_t timestamp; | 89 | uint32_t timestamp; |
87 | uint32_t ssrc; | 90 | uint32_t ssrc; |
88 | uint32_t *csrc; | 91 | uint32_t *csrc; |
89 | 92 | ||
90 | /* If some additional data must be sent via message | 93 | /* If some additional data must be sent via message |
91 | * apply it here. Only by allocating this member you will be | 94 | * apply it here. Only by allocating this member you will be |
92 | * automatically placing it within a message. | 95 | * automatically placing it within a message. |
93 | */ | 96 | */ |
94 | RTPExtHeader *ext_header; | 97 | RTPExtHeader *ext_header; |
95 | 98 | ||
96 | /* Msg prefix for core to know when recving */ | 99 | /* Msg prefix for core to know when recving */ |
97 | uint8_t prefix; | 100 | uint8_t prefix; |
98 | 101 | ||
99 | int dest; | 102 | int dest; |
100 | 103 | ||
101 | struct _CSSession *cs; | 104 | struct CSSession_s *cs; |
102 | Messenger* m; | 105 | Messenger *m; |
103 | 106 | ||
104 | } RTPSession; | 107 | } RTPSession; |
105 | 108 | ||
@@ -119,7 +122,7 @@ void rtp_kill ( RTPSession* session ); | |||
119 | int rtp_register_for_receiving (RTPSession *session); | 122 | int rtp_register_for_receiving (RTPSession *session); |
120 | 123 | ||
121 | /** | 124 | /** |
122 | * Sends msg to _RTPSession::dest | 125 | * Sends msg to RTPSession::dest |
123 | */ | 126 | */ |
124 | int rtp_send_msg ( RTPSession* session, const uint8_t* data, uint16_t length ); | 127 | int rtp_send_msg ( RTPSession* session, const uint8_t* data, uint16_t length ); |
125 | 128 | ||