summaryrefslogtreecommitdiff
path: root/toxav/rtp.h
diff options
context:
space:
mode:
authormannol <eniz_vukovic@hotmail.com>2015-04-13 01:45:53 +0200
committermannol <eniz_vukovic@hotmail.com>2015-04-13 01:45:53 +0200
commit2465f486acd90ed8395c8a83a13af09ecd024c98 (patch)
tree4abe53d39eb07a45e5ed4d8894b7ae038e2bb705 /toxav/rtp.h
parentb2d88a4544a81a217db18b60d91a44d85821db3d (diff)
Started custom RTCP
Diffstat (limited to 'toxav/rtp.h')
-rw-r--r--toxav/rtp.h49
1 files changed, 25 insertions, 24 deletions
diff --git a/toxav/rtp.h b/toxav/rtp.h
index 6b796d5a..fa5af9fe 100644
--- a/toxav/rtp.h
+++ b/toxav/rtp.h
@@ -23,8 +23,6 @@
23#define RTP_H 23#define RTP_H
24 24
25#define RTP_VERSION 2 25#define RTP_VERSION 2
26#include <inttypes.h>
27// #include <pthread.h>
28 26
29#include "../toxcore/Messenger.h" 27#include "../toxcore/Messenger.h"
30 28
@@ -51,8 +49,8 @@ typedef enum {
51 rtp_TypeVideo 49 rtp_TypeVideo
52} RTPPayloadType; 50} RTPPayloadType;
53 51
54/** 52/**
55 * Standard rtp header 53 * Standard rtp header.
56 */ 54 */
57typedef struct { 55typedef struct {
58 uint8_t flags; /* Version(2),Padding(1), Ext(1), Cc(4) */ 56 uint8_t flags; /* Version(2),Padding(1), Ext(1), Cc(4) */
@@ -62,17 +60,14 @@ typedef struct {
62 uint32_t ssrc; /* SSRC */ 60 uint32_t ssrc; /* SSRC */
63 uint32_t csrc[16]; /* CSRC's table */ 61 uint32_t csrc[16]; /* CSRC's table */
64 uint32_t length; /* Length of the header in payload string. */ 62 uint32_t length; /* Length of the header in payload string. */
65
66} RTPHeader; 63} RTPHeader;
67 64/**
68/**
69 * Standard rtp extension header. 65 * Standard rtp extension header.
70 */ 66 */
71typedef struct { 67typedef struct {
72 uint16_t type; /* Extension profile */ 68 uint16_t type; /* Extension profile */
73 uint16_t length; /* Number of extensions */ 69 uint16_t length; /* Number of extensions */
74 uint32_t *table; /* Extension's table */ 70 uint32_t *table; /* Extension's table */
75
76} RTPExtHeader; 71} RTPExtHeader;
77 72
78/** 73/**
@@ -90,31 +85,32 @@ typedef struct {
90 * RTP control session. 85 * RTP control session.
91 */ 86 */
92typedef struct { 87typedef struct {
93 uint8_t version; 88 uint8_t version;
94 uint8_t padding; 89 uint8_t padding;
95 uint8_t extension; 90 uint8_t extension;
96 uint8_t cc; 91 uint8_t cc;
97 uint8_t marker; 92 uint8_t marker;
98 uint8_t payload_type; 93 uint8_t payload_type;
99 uint16_t sequnum; /* Set when sending */ 94 uint16_t sequnum; /* Sending sequence number */
100 uint16_t rsequnum; /* Check when recving msg */ 95 uint16_t rsequnum; /* Receiving sequence number */
101 uint32_t timestamp; 96 uint32_t rtimestamp;
102 uint32_t ssrc; 97 uint32_t ssrc;
103 uint32_t *csrc; 98 uint32_t *csrc;
104 99
105 /* If some additional data must be sent via message 100 /* If some additional data must be sent via message
106 * apply it here. Only by allocating this member you will be 101 * apply it here. Only by allocating this member you will be
107 * automatically placing it within a message. 102 * automatically placing it within a message.
108 */ 103 */
109 RTPExtHeader *ext_header; 104 RTPExtHeader *ext_header;
110 105
111 /* Msg prefix for core to know when recving */ 106 /* Msg prefix for core to know when recving */
112 uint8_t prefix; 107 uint8_t prefix;
113 108
114 int dest; 109 int dest;
115 110
116 struct CSession_s *cs; 111 struct RTCPSession_s *rtcp;
117 Messenger *m; 112 struct CSession_s *cs;
113 Messenger *m;
118 114
119} RTPSession; 115} RTPSession;
120 116
@@ -129,6 +125,11 @@ RTPSession *rtp_new ( int payload_type, Messenger *messenger, int friend_num );
129void rtp_kill ( RTPSession* session ); 125void rtp_kill ( RTPSession* session );
130 126
131/** 127/**
128 * Do periodical rtp work.
129 */
130void rtp_do(RTPSession *session);
131
132/**
132 * By default rtp is not in receiving state 133 * By default rtp is not in receiving state
133 */ 134 */
134int rtp_start_receiving (RTPSession *session); 135int rtp_start_receiving (RTPSession *session);