summaryrefslogtreecommitdiffstats
path: root/tinyRTP/include/tinyrtp
diff options
context:
space:
mode:
Diffstat (limited to 'tinyRTP/include/tinyrtp')
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_header.h25
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_packet.h30
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_rblock.h27
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report.h6
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_bye.h15
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_fb.h163
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_rr.h19
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sdes.h13
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sr.h35
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_xr.h6
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_chunck.h15
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_item.h36
-rwxr-xr-xtinyRTP/include/tinyrtp/rtcp/trtp_rtcp_session.h8
-rwxr-xr-xtinyRTP/include/tinyrtp/rtp/trtp_rtp_header.h63
-rwxr-xr-xtinyRTP/include/tinyrtp/rtp/trtp_rtp_packet.h35
-rwxr-xr-xtinyRTP/include/tinyrtp/rtp/trtp_rtp_session.h6
-rwxr-xr-xtinyRTP/include/tinyrtp/trtp.h6
-rwxr-xr-xtinyRTP/include/tinyrtp/trtp_manager.h256
-rwxr-xr-xtinyRTP/include/tinyrtp/trtp_srtp.h78
19 files changed, 412 insertions, 430 deletions
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_header.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_header.h
index 9cf6a1a..354c082 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_header.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_header.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -33,16 +33,15 @@
TRTP_BEGIN_DECLS
-typedef struct trtp_rtcp_header_s
-{
- TSK_DECLARE_OBJECT;
-
- unsigned version:2;
- unsigned padding:1;
- unsigned rc:5;
- trtp_rtcp_packet_type_t type; /**< Packet Type on 8bits */
- uint16_t length_in_words_minus1; /**< The length of this RTCP packet in 32-bit words minus one */
- uint32_t length_in_bytes;
+typedef struct trtp_rtcp_header_s {
+ TSK_DECLARE_OBJECT;
+
+ unsigned version:2;
+ unsigned padding:1;
+ unsigned rc:5;
+ trtp_rtcp_packet_type_t type; /**< Packet Type on 8bits */
+ uint16_t length_in_words_minus1; /**< The length of this RTCP packet in 32-bit words minus one */
+ uint32_t length_in_bytes;
}
trtp_rtcp_header_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_packet.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_packet.h
index 9045be7..00867f5 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_packet.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_packet.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -35,23 +35,21 @@ TRTP_BEGIN_DECLS
// RFC 3550 12.1 RTCP Packet Types
// RFC 4585
// RFC 5104 (FIXME: not supported yet!)
-typedef enum trtp_rtcp_packet_type_e
-{
- trtp_rtcp_packet_type_sr = 200,
- trtp_rtcp_packet_type_rr = 201,
- trtp_rtcp_packet_type_sdes = 202,
- trtp_rtcp_packet_type_bye = 203,
- trtp_rtcp_packet_type_app = 204,
- trtp_rtcp_packet_type_rtpfb = 205,
- trtp_rtcp_packet_type_psfb = 206
+typedef enum trtp_rtcp_packet_type_e {
+ trtp_rtcp_packet_type_sr = 200,
+ trtp_rtcp_packet_type_rr = 201,
+ trtp_rtcp_packet_type_sdes = 202,
+ trtp_rtcp_packet_type_bye = 203,
+ trtp_rtcp_packet_type_app = 204,
+ trtp_rtcp_packet_type_rtpfb = 205,
+ trtp_rtcp_packet_type_psfb = 206
}
trtp_rtcp_packet_type_t;
-typedef struct trtp_rtcp_packet_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct trtp_rtcp_packet_s {
+ TSK_DECLARE_OBJECT;
- struct trtp_rtcp_header_s *header;
+ struct trtp_rtcp_header_s *header;
}
trtp_rtcp_packet_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_rblock.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_rblock.h
index 5ea54e6..cc5285d 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_rblock.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_rblock.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -33,17 +33,16 @@ TRTP_BEGIN_DECLS
#define TRTP_RTCP_RBLOCK(self) ((trtp_rtcp_rblock_t*)(self))
// RFC 3550 6.4.1 SR: Sender Report RTCP Packet => Report block part
-typedef struct trtp_rtcp_rblock_s
-{
- TSK_DECLARE_OBJECT;
-
- uint32_t ssrc; /* data source being reported */
- unsigned int fraction:8; /* fraction lost since last SR/RR */
- int cumulative_no_lost:24; /* cumul. no. pkts lost (signed!) */
- uint32_t last_seq; /* extended last seq. no. received */
- uint32_t jitter; /* interarrival jitter */
- uint32_t lsr; /* last SR packet from this source */
- uint32_t dlsr; /* delay since last SR packet */
+typedef struct trtp_rtcp_rblock_s {
+ TSK_DECLARE_OBJECT;
+
+ uint32_t ssrc; /* data source being reported */
+ unsigned int fraction:8; /* fraction lost since last SR/RR */
+ int cumulative_no_lost:24; /* cumul. no. pkts lost (signed!) */
+ uint32_t last_seq; /* extended last seq. no. received */
+ uint32_t jitter; /* interarrival jitter */
+ uint32_t lsr; /* last SR packet from this source */
+ uint32_t dlsr; /* delay since last SR packet */
}
trtp_rtcp_rblock_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report.h
index c30351f..34031a5 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_bye.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_bye.h
index 796e9fc..dac4e6c 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_bye.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_bye.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -26,12 +26,11 @@
#include "tinyrtp/rtcp/trtp_rtcp_packet.h"
-typedef struct trtp_rtcp_report_bye_s
-{
- TRTP_DECLARE_RTCP_PACKET;
+typedef struct trtp_rtcp_report_bye_s {
+ TRTP_DECLARE_RTCP_PACKET;
- uint32_t *ssrc_list;
- trtp_rtcp_packets_L_t* packets;
+ uint32_t *ssrc_list;
+ trtp_rtcp_packets_L_t* packets;
}
trtp_rtcp_report_bye_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_fb.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_fb.h
index 1ad30b4..a1bf9fe 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_fb.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_fb.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -30,42 +30,39 @@
#define TRTP_DECLARE_RTCP_FB_PACKET trtp_rtcp_report_fb_t __packet_fb__
// RFC 4585 6.1. Common Packet Format for Feedback Messages
-typedef struct trtp_rtcp_report_fb_s
-{
- TRTP_DECLARE_RTCP_PACKET;
+typedef struct trtp_rtcp_report_fb_s {
+ TRTP_DECLARE_RTCP_PACKET;
- uint32_t ssrc_sender; /* SSRC of packet sender */
- uint32_t ssrc_media; /* SSRC of media source */
+ uint32_t ssrc_sender; /* SSRC of packet sender */
+ uint32_t ssrc_media; /* SSRC of media source */
}
trtp_rtcp_report_fb_t;
-typedef enum trtp_rtcp_rtpfb_fci_type_e
-{
- trtp_rtcp_rtpfb_fci_type_nack = 1, // RFC 4585
- trtp_rtcp_rtpfb_fci_type_tmmbn = 4, // RFC 5104
+typedef enum trtp_rtcp_rtpfb_fci_type_e {
+ trtp_rtcp_rtpfb_fci_type_nack = 1, // RFC 4585
+ trtp_rtcp_rtpfb_fci_type_tmmbn = 4, // RFC 5104
}
trtp_rtcp_rtpfb_fci_type_t;
// Transport layer FB message
-typedef struct trtp_rtcp_report_rtpfb_s
-{
- TRTP_DECLARE_RTCP_FB_PACKET;
-
- trtp_rtcp_rtpfb_fci_type_t fci_type;
- union{
- struct{
- tsk_size_t count; // not part of the specification
- uint16_t* pid; // 16 bits
- uint16_t* blp; // 16 bits
- }nack;
- struct{
- tsk_size_t count; // not part of the specification
- uint32_t* ssrc; // 32 bits
- uint8_t* MxTBR_Exp; // 6 bits
- uint32_t* MxTBR_Mantissa; // 17 bits
- uint16_t* MeasuredOverhead; // 9 bits
- }tmmbn;
- };
+typedef struct trtp_rtcp_report_rtpfb_s {
+ TRTP_DECLARE_RTCP_FB_PACKET;
+
+ trtp_rtcp_rtpfb_fci_type_t fci_type;
+ union {
+ struct {
+ tsk_size_t count; // not part of the specification
+ uint16_t* pid; // 16 bits
+ uint16_t* blp; // 16 bits
+ } nack;
+ struct {
+ tsk_size_t count; // not part of the specification
+ uint32_t* ssrc; // 32 bits
+ uint8_t* MxTBR_Exp; // 6 bits
+ uint32_t* MxTBR_Mantissa; // 17 bits
+ uint16_t* MeasuredOverhead; // 9 bits
+ } tmmbn;
+ };
}
trtp_rtcp_report_rtpfb_t;
@@ -78,64 +75,67 @@ int trtp_rtcp_report_rtpfb_serialize_to(const trtp_rtcp_report_rtpfb_t* self, vo
tsk_size_t trtp_rtcp_report_rtpfb_get_size(const trtp_rtcp_report_rtpfb_t* self);
-typedef enum trtp_rtcp_psfb_fci_type_e
-{
- trtp_rtcp_psfb_fci_type_pli = 1, /* rfc 4585: Picture Loss Indication (PLI) */
- trtp_rtcp_psfb_fci_type_sli = 2, /* rfc 4585: Slice Loss Indication (SLI) */
- trtp_rtcp_psfb_fci_type_rpsi = 3, /* rfc 4585: Reference Picture Selection Indication (RPSI) */
- trtp_rtcp_psfb_fci_type_fir = 4, /* rfc 5104: Full Intra Request (FIR) Command*/
- trtp_rtcp_psfb_fci_type_afb = 15, /* rfc 4585: Application layer FB (AFB) message */
+typedef enum trtp_rtcp_psfb_fci_type_e {
+ trtp_rtcp_psfb_fci_type_pli = 1, /* rfc 4585: Picture Loss Indication (PLI) */
+ trtp_rtcp_psfb_fci_type_sli = 2, /* rfc 4585: Slice Loss Indication (SLI) */
+ trtp_rtcp_psfb_fci_type_rpsi = 3, /* rfc 4585: Reference Picture Selection Indication (RPSI) */
+ trtp_rtcp_psfb_fci_type_fir = 4, /* rfc 5104: Full Intra Request (FIR) Command*/
+ trtp_rtcp_psfb_fci_type_afb = 15, /* rfc 4585: Application layer FB (AFB) message */
}
trtp_rtcp_psfb_fci_type_t;
/* rfc 4585: Application layer FB (AFB) message */
-typedef enum trtp_rtcp_psfb_afb_type_e
-{
- trtp_rtcp_psfb_afb_type_none,
- trtp_rtcp_psfb_afb_type_remb // draft-alvestrand-rmcat-remb-02
+typedef enum trtp_rtcp_psfb_afb_type_e {
+ trtp_rtcp_psfb_afb_type_none,
+ trtp_rtcp_psfb_afb_type_remb, // draft-alvestrand-rmcat-remb-02
+ trtp_rtcp_psfb_afb_type_jcng, // doubango congestion control estimation
}
trtp_rtcp_psfb_afb_type_t;
// Payload-specific FB message
-typedef struct trtp_rtcp_report_psfb_s
-{
- TRTP_DECLARE_RTCP_FB_PACKET;
-
- trtp_rtcp_psfb_fci_type_t fci_type;
- union{
- // struct{ //rfc 4585: 6.3.1.2
- // } pli;
- struct{ // rfc 4585: 6.3.2.2
- uint16_t* first;
- uint16_t* number;
- uint8_t* pic_id;
- } sli;
- struct{ // rfc 4585: 6.3.3.2
- unsigned pb:8;
- unsigned pt:7;
- uint8_t* bytes;
- } rpsi;
- struct{// rfc 5104: 4.3.1.1
- tsk_size_t count;
- uint32_t* ssrc; // 32 bits
- uint8_t* seq_num; // 8 bits
- }fir;
- struct{ // rfc 4585: 6.4
- trtp_rtcp_psfb_afb_type_t type;
- union{
- struct{ // draft-alvestrand-rmcat-remb-02: 2.2
- // MxTBR = mantissa * 2^exp = (mantissa << exp) bps
- uint8_t num_ssrc;
- uint8_t exp; // 6bits
- uint32_t mantissa; // 18bits
- uint32_t* ssrc_feedbacks; // 'num_ssrc'nth SSRC entries
- }remb;
- struct{
- uint8_t* bytes; // store bytes to allow reconstruction
- }none; // unknown type
- };
- }afb;
- };
+typedef struct trtp_rtcp_report_psfb_s {
+ TRTP_DECLARE_RTCP_FB_PACKET;
+
+ trtp_rtcp_psfb_fci_type_t fci_type;
+ union {
+ // struct{ //rfc 4585: 6.3.1.2
+ // } pli;
+ struct { // rfc 4585: 6.3.2.2
+ uint16_t* first;
+ uint16_t* number;
+ uint8_t* pic_id;
+ } sli;
+ struct { // rfc 4585: 6.3.3.2
+ unsigned pb:8;
+ unsigned pt:7;
+ uint8_t* bytes;
+ } rpsi;
+ struct { // rfc 5104: 4.3.1.1
+ tsk_size_t count;
+ uint32_t* ssrc; // 32 bits
+ uint8_t* seq_num; // 8 bits
+ } fir;
+ struct { // rfc 4585: 6.4
+ trtp_rtcp_psfb_afb_type_t type;
+ union {
+ struct { // draft-alvestrand-rmcat-remb-02: 2.2
+ // MxTBR = mantissa * 2^exp = (mantissa << exp) bps
+ uint8_t num_ssrc;
+ uint8_t exp; // 6bits
+ uint32_t mantissa; // 18bits
+ uint32_t* ssrc_feedbacks; // 'num_ssrc'nth SSRC entries
+ } remb;
+ struct { // jitter buffer congestion estimation: doubango
+ uint8_t num_ssrc;
+ uint8_t q; // 8bits
+ uint32_t* ssrc_feedbacks; // 'num_ssrc'nth SSRC entries
+ } jcng;
+ struct {
+ uint8_t* bytes; // store bytes to allow reconstruction
+ } none; // unknown type
+ };
+ } afb;
+ };
}
trtp_rtcp_report_psfb_t;
@@ -145,6 +145,7 @@ trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_2(trtp_rtcp_psfb_fci_type_
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_pli(uint32_t ssrc_sender, uint32_t ssrc_media_src);
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_fir(uint8_t seq_num, uint32_t ssrc_sender, uint32_t ssrc_media_src);
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_afb_remb(uint32_t ssrc_sender, const uint32_t* ssrc_media_src_list, uint32_t ssrc_media_src_list_count, uint32_t bitrate/*in bps*/);
+trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_create_afb_jcng(uint32_t ssrc_sender, const uint32_t* ssrc_media_src_list, uint32_t ssrc_media_src_list_count, float jcng_q/*in quality metric*/);
trtp_rtcp_report_psfb_t* trtp_rtcp_report_psfb_deserialize(const void* data, tsk_size_t size);
int trtp_rtcp_report_psfb_serialize_to(const trtp_rtcp_report_psfb_t* self, void* data, tsk_size_t size);
tsk_size_t trtp_rtcp_report_psfb_get_size(const trtp_rtcp_report_psfb_t* self);
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_rr.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_rr.h
index 2f25779..6a417d3 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_rr.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_rr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -32,13 +32,12 @@ TRTP_BEGIN_DECLS
#define TRTP_RTCP_REPORT_RR(self) ((trtp_rtcp_report_rr_t*)(self))
// RFC 3550 6.4.2 RR: Receiver Report RTCP Packet
-typedef struct trtp_rtcp_report_rr_s
-{
- TRTP_DECLARE_RTCP_PACKET;
-
- uint32_t ssrc;
- trtp_rtcp_rblocks_L_t* blocks;
- trtp_rtcp_packets_L_t* packets;
+typedef struct trtp_rtcp_report_rr_s {
+ TRTP_DECLARE_RTCP_PACKET;
+
+ uint32_t ssrc;
+ trtp_rtcp_rblocks_L_t* blocks;
+ trtp_rtcp_packets_L_t* packets;
}
trtp_rtcp_report_rr_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sdes.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sdes.h
index 04efb5c..b8df1e5 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sdes.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sdes.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -32,10 +32,9 @@ TRTP_BEGIN_DECLS
#define TRTP_RTCP_REPORT_SDES(self) ((trtp_rtcp_report_sdes_t*)(self))
/* RFC 3550 6.5 SDES: Source Description RTCP Packet */
-typedef struct trtp_rtcp_report_sdes_s
-{
- TRTP_DECLARE_RTCP_PACKET;
- trtp_rtcp_sdes_chuncks_L_t* chuncks;
+typedef struct trtp_rtcp_report_sdes_s {
+ TRTP_DECLARE_RTCP_PACKET;
+ trtp_rtcp_sdes_chuncks_L_t* chuncks;
}
trtp_rtcp_report_sdes_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sr.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sr.h
index 09d442f..73de26e 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sr.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_sr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -32,21 +32,20 @@ TRTP_BEGIN_DECLS
#define TRTP_RTCP_REPORT_SR(self) ((trtp_rtcp_report_sr_t*)(self))
// RFC 3550 6.4.1 SR: Sender Report RTCP Packet
-typedef struct trtp_rtcp_report_sr_s
-{
- TRTP_DECLARE_RTCP_PACKET;
-
- uint32_t ssrc;
- struct{
- uint32_t ntp_msw; /**< NTP timestamp, most significant word */
- uint32_t ntp_lsw; /**< NTP timestamp, least significant word */
- uint32_t rtp_timestamp;/**< RTP timestamp */
- uint32_t sender_pcount; /**< sender's packet count */
- uint32_t sender_ocount; /**< sender's octet count */
- } sender_info;
-
- trtp_rtcp_rblocks_L_t* blocks;
- trtp_rtcp_packets_L_t* packets;
+typedef struct trtp_rtcp_report_sr_s {
+ TRTP_DECLARE_RTCP_PACKET;
+
+ uint32_t ssrc;
+ struct {
+ uint32_t ntp_msw; /**< NTP timestamp, most significant word */
+ uint32_t ntp_lsw; /**< NTP timestamp, least significant word */
+ uint32_t rtp_timestamp;/**< RTP timestamp */
+ uint32_t sender_pcount; /**< sender's packet count */
+ uint32_t sender_ocount; /**< sender's octet count */
+ } sender_info;
+
+ trtp_rtcp_rblocks_L_t* blocks;
+ trtp_rtcp_packets_L_t* packets;
}
trtp_rtcp_report_sr_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_xr.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_xr.h
index b08e096..dda4dcc 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_xr.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_report_xr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_chunck.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_chunck.h
index ec3a8d8..bf47f53 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_chunck.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_chunck.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -33,12 +33,11 @@
TRTP_BEGIN_DECLS
-typedef struct trtp_rtcp_sdes_chunck_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct trtp_rtcp_sdes_chunck_s {
+ TSK_DECLARE_OBJECT;
- uint32_t ssrc;
- trtp_rtcp_sdes_items_L_t* items;
+ uint32_t ssrc;
+ trtp_rtcp_sdes_items_L_t* items;
}
trtp_rtcp_sdes_chunck_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_item.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_item.h
index 8356a74..f485e24 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_item.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_sdes_item.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -34,26 +34,24 @@
TRTP_BEGIN_DECLS
// RFC 3550 12.2 SDES Types
-typedef enum trtp_rtcp_sdes_item_type_e
-{
- trtp_rtcp_sdes_item_type_end = 0, /**< end of SDES list */
- trtp_rtcp_sdes_item_type_cname = 1, /**< canonical name*/
- trtp_rtcp_sdes_item_type_name = 2, /**< user name */
- trtp_rtcp_sdes_item_type_email = 3, /**< user's electronic mail address*/
- trtp_rtcp_sdes_item_type_phone = 4, /**< user's phone number */
- trtp_rtcp_sdes_item_type_loc = 5, /**< geographic user location*/
- trtp_rtcp_sdes_item_type_tool = 6, /**< name of application or tool*/
- trtp_rtcp_sdes_item_type_note = 7, /**< notice about the source*/
- trtp_rtcp_sdes_item_type_priv = 8, /**< private extensions*/
+typedef enum trtp_rtcp_sdes_item_type_e {
+ trtp_rtcp_sdes_item_type_end = 0, /**< end of SDES list */
+ trtp_rtcp_sdes_item_type_cname = 1, /**< canonical name*/
+ trtp_rtcp_sdes_item_type_name = 2, /**< user name */
+ trtp_rtcp_sdes_item_type_email = 3, /**< user's electronic mail address*/
+ trtp_rtcp_sdes_item_type_phone = 4, /**< user's phone number */
+ trtp_rtcp_sdes_item_type_loc = 5, /**< geographic user location*/
+ trtp_rtcp_sdes_item_type_tool = 6, /**< name of application or tool*/
+ trtp_rtcp_sdes_item_type_note = 7, /**< notice about the source*/
+ trtp_rtcp_sdes_item_type_priv = 8, /**< private extensions*/
}
trtp_rtcp_sdes_item_type_t;
-typedef struct trtp_rtcp_sdes_item_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct trtp_rtcp_sdes_item_s {
+ TSK_DECLARE_OBJECT;
- trtp_rtcp_sdes_item_type_t type;
- tsk_buffer_t *data;
+ trtp_rtcp_sdes_item_type_t type;
+ tsk_buffer_t *data;
}
trtp_rtcp_sdes_item_t;
diff --git a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_session.h b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_session.h
index 34ddbbc..4ea08e0 100755
--- a/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_session.h
+++ b/tinyRTP/include/tinyrtp/rtcp/trtp_rtcp_session.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -51,7 +51,7 @@ int trtp_rtcp_session_set_callback(struct trtp_rtcp_session_s* self, trtp_rtcp_c
#if HAVE_SRTP
int trtp_rtcp_session_set_srtp_sess(struct trtp_rtcp_session_s* self, const srtp_t* session);
#endif
-int trtp_rtcp_session_set_app_bandwidth_max(struct trtp_rtcp_session_s* self, int32_t bw_upload_kbps, int32_t bw_download_kbps);
+int trtp_rtcp_session_set_app_bw_and_jcng(struct trtp_rtcp_session_s* self, int32_t bw_upload_kbps, int32_t bw_download_kbps, float jcng_q);
int trtp_rtcp_session_start(struct trtp_rtcp_session_s* self, tnet_fd_t local_fd, const struct sockaddr* remote_addr);
int trtp_rtcp_session_stop(struct trtp_rtcp_session_s* self);
int trtp_rtcp_session_process_rtp_out(struct trtp_rtcp_session_s* self, const struct trtp_rtp_packet_s* packet_rtp, tsk_size_t size);
diff --git a/tinyRTP/include/tinyrtp/rtp/trtp_rtp_header.h b/tinyRTP/include/tinyrtp/rtp/trtp_rtp_header.h
index 15d177c..8b8a3b3 100755
--- a/tinyRTP/include/tinyrtp/rtp/trtp_rtp_header.h
+++ b/tinyRTP/include/tinyrtp/rtp/trtp_rtp_header.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -37,36 +37,35 @@ TRTP_BEGIN_DECLS
#define TRTP_RTP_HEADER_MIN_SIZE 12
#define TRTP_RTP_HEADER(self) ((trtp_rtp_header_t*)(self))
-typedef struct trtp_rtp_header_s
-{
- TSK_DECLARE_OBJECT;
- /* RFC 3550 section 5.1 - RTP Fixed Header Fields
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |V=2|P|X| CC |M| PT | sequence number |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | timestamp |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | synchronization source (SSRC) identifier |
- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- | contributing source (CSRC) identifiers |
- | .... |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
- unsigned version:2;
- unsigned padding:1;
- unsigned extension:1;
- unsigned csrc_count:4;
- unsigned marker:1;
- unsigned payload_type:7;
- uint16_t seq_num;
- uint32_t timestamp;
- uint32_t ssrc;
- uint32_t csrc[15];
+typedef struct trtp_rtp_header_s {
+ TSK_DECLARE_OBJECT;
+ /* RFC 3550 section 5.1 - RTP Fixed Header Fields
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |V=2|P|X| CC |M| PT | sequence number |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | timestamp |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | synchronization source (SSRC) identifier |
+ +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
+ | contributing source (CSRC) identifiers |
+ | .... |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+ unsigned version:2;
+ unsigned padding:1;
+ unsigned extension:1;
+ unsigned csrc_count:4;
+ unsigned marker:1;
+ unsigned payload_type:7;
+ uint16_t seq_num;
+ uint32_t timestamp;
+ uint32_t ssrc;
+ uint32_t csrc[15];
- // for internal use
- enum tmedia_codec_id_e codec_id;
+ // for internal use
+ enum tmedia_codec_id_e codec_id;
}
trtp_rtp_header_t;
diff --git a/tinyRTP/include/tinyrtp/rtp/trtp_rtp_packet.h b/tinyRTP/include/tinyrtp/rtp/trtp_rtp_packet.h
index c7f8cf3..b9d81b3 100755
--- a/tinyRTP/include/tinyrtp/rtp/trtp_rtp_packet.h
+++ b/tinyRTP/include/tinyrtp/rtp/trtp_rtp_packet.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -37,23 +37,22 @@
TRTP_BEGIN_DECLS
-typedef struct trtp_rtp_packet_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct trtp_rtp_packet_s {
+ TSK_DECLARE_OBJECT;
+
+ trtp_rtp_header_t* header;
- trtp_rtp_header_t* header;
+ struct {
+ void* data;
+ const void* data_const; // never free()d. an alternative to "data"
+ tsk_size_t size;
+ } payload;
- struct{
- void* data;
- const void* data_const; // never free()d. an alternative to "data"
- tsk_size_t size;
- } payload;
-
- /* extension header as per RFC 3550 section 5.3.1 */
- struct{
- void* data;
- tsk_size_t size; /* contains the first two 16-bit fields */
- } extension;
+ /* extension header as per RFC 3550 section 5.3.1 */
+ struct {
+ void* data;
+ tsk_size_t size; /* contains the first two 16-bit fields */
+ } extension;
}
trtp_rtp_packet_t;
typedef tsk_list_t trtp_rtp_packets_L_t;
diff --git a/tinyRTP/include/tinyrtp/rtp/trtp_rtp_session.h b/tinyRTP/include/tinyrtp/rtp/trtp_rtp_session.h
index 475502a..f5d8770 100755
--- a/tinyRTP/include/tinyrtp/rtp/trtp_rtp_session.h
+++ b/tinyRTP/include/tinyrtp/rtp/trtp_rtp_session.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
diff --git a/tinyRTP/include/tinyrtp/trtp.h b/tinyRTP/include/tinyrtp/trtp.h
index 3359a70..ea72491 100755
--- a/tinyRTP/include/tinyrtp/trtp.h
+++ b/tinyRTP/include/tinyrtp/trtp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
diff --git a/tinyRTP/include/tinyrtp/trtp_manager.h b/tinyRTP/include/tinyrtp/trtp_manager.h
index 1594f9c..e409c7b 100755
--- a/tinyRTP/include/tinyrtp/trtp_manager.h
+++ b/tinyRTP/include/tinyrtp/trtp_manager.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2012 Mamadou Diop
* Copyright (C) 2012-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -40,140 +40,140 @@ struct trtp_rtp_packet_s;
struct tnet_proxyinfo_s;
/** RTP/RTCP manager */
-typedef struct trtp_manager_s
-{
- TSK_DECLARE_OBJECT;
-
- char* local_ip;
- tsk_bool_t use_ipv6;
- tsk_bool_t is_started;
- tsk_bool_t use_rtcp;
- tsk_bool_t use_rtcpmux;
- tsk_bool_t is_socket_disabled;
- tsk_bool_t is_ice_neg_ok;
- tsk_bool_t is_ice_turn_active;
- tsk_bool_t is_force_symetric_rtp;
- tsk_bool_t is_symetric_rtp_checked;
- tsk_bool_t is_symetric_rtcp_checked;
- int32_t app_bw_max_upload; // application specific (kbps)
- int32_t app_bw_max_download; // application specific (kbps)
-
- tnet_transport_t* transport;
-
- struct tnet_ice_ctx_s* ice_ctx;
-
- tsk_timer_manager_handle_t* timer_mgr_global;
-
- struct{
- tmedia_rtcweb_type_t local;
- tmedia_rtcweb_type_t remote;
- } rtcweb_type;
-
+typedef struct trtp_manager_s {
+ TSK_DECLARE_OBJECT;
+
+ char* local_ip;
+ tsk_bool_t use_ipv6;
+ tsk_bool_t is_started;
+ tsk_bool_t use_rtcp;
+ tsk_bool_t use_rtcpmux;
+ tsk_bool_t is_socket_disabled;
+ tsk_bool_t is_ice_neg_ok;
+ tsk_bool_t is_ice_turn_active;
+ tsk_bool_t is_force_symetric_rtp;
+ tsk_bool_t is_symetric_rtp_checked;
+ tsk_bool_t is_symetric_rtcp_checked;
+ int32_t app_bw_max_upload; // application specific (kbps)
+ int32_t app_bw_max_download; // application specific (kbps)
+ float app_jitter_cng; // application specific jitter buffer congestion estimation (quality in ]0, 1], 1f meaning no congestion)
+
+ tnet_transport_t* transport;
+
+ struct tnet_ice_ctx_s* ice_ctx;
+
+ tsk_timer_manager_handle_t* timer_mgr_global;
+
+ struct {
+ tmedia_rtcweb_type_t local;
+ tmedia_rtcweb_type_t remote;
+ } rtcweb_type;
+
struct {
tsk_bool_t auto_detect;
struct tnet_proxyinfo_s* info;
}
proxy;
- struct{
- uint16_t start;
- uint16_t stop;
- } port_range;
+ struct {
+ uint16_t start;
+ uint16_t stop;
+ } port_range;
- struct{
- uint16_t seq_num;
- uint32_t timestamp;
- uint8_t payload_type;
+ struct {
+ uint16_t seq_num;
+ uint32_t timestamp;
+ uint8_t payload_type;
int32_t dscp;
- char* remote_ip;
- tnet_port_t remote_port;
- struct sockaddr_storage remote_addr;
-
- char* public_ip;
- tnet_port_t public_port;
-
- struct{
- uint32_t local;
- uint32_t remote;
- } ssrc;
-
- struct{
- const void* usrdata;
- trtp_rtp_cb_f fun;
- } cb;
-
- struct{
- void* ptr;
- tsk_size_t size;
+ char* remote_ip;
+ tnet_port_t remote_port;
+ struct sockaddr_storage remote_addr;
+
+ char* public_ip;
+ tnet_port_t public_port;
+
+ struct {
+ uint32_t local;
+ uint32_t remote;
+ } ssrc;
+
+ struct {
+ const void* usrdata;
+ trtp_rtp_cb_f fun;
+ } cb;
+
+ struct {
+ void* ptr;
+ tsk_size_t size;
tsk_size_t index;
- } serial_buffer;
- } rtp;
-
- struct{
- char* cname;
- char* remote_ip;
- tnet_port_t remote_port;
- struct sockaddr_storage remote_addr;
- tnet_socket_t* local_socket;
-
- char* public_ip;
- tnet_port_t public_port;
-
- struct{
- const void* usrdata;
- trtp_rtcp_cb_f fun;
- } cb;
-
- struct trtp_rtcp_session_s* session;
- } rtcp;
-
- TSK_DECLARE_SAFEOBJ;
-
-#if HAVE_SRTP
- enum tmedia_srtp_type_e srtp_type;
- enum tmedia_srtp_mode_e srtp_mode;
- trtp_srtp_state_t srtp_state;
- trtp_srtp_ctx_xt srtp_contexts[2/*LINE_IDX*/][2/*CRYPTO_TYPE*/];
- const struct trtp_srtp_ctx_xs* srtp_ctx_neg_local;
- const struct trtp_srtp_ctx_xs* srtp_ctx_neg_remote;
-
- struct{
- char* file_ca;
- char* file_pbk;
- char* file_pvk;
- tsk_bool_t cert_verif;
-
- trtp_srtp_state_t state;
- // enable() could be postponed if net transport not ready yet (e.g. when ICE is ON)
- tsk_bool_t enable_postponed;
-
- tsk_bool_t srtp_connected;
- tsk_bool_t srtcp_connected;
- tsk_bool_t srtp_handshake_succeed;
- tsk_bool_t srtcp_handshake_succeed;
-
- trtp_srtp_crypto_type_t crypto_selected;
-
- struct{
- uint64_t timeout;
- tsk_timer_id_t id;
- } timer_hanshaking;
-
- struct{
- const void* usrdata;
- trtp_srtp_dtls_cb_f fun;
- } cb;
-
- struct{
- tnet_fingerprint_t fp;
- tnet_dtls_hash_type_t fp_hash;
- } remote;
- struct{
- tnet_dtls_setup_t setup;
- tsk_bool_t connection_new;
- }local;
- } dtls;
+ } serial_buffer;
+ } rtp;
+
+ struct {
+ char* cname;
+ char* remote_ip;
+ tnet_port_t remote_port;
+ struct sockaddr_storage remote_addr;
+ tnet_socket_t* local_socket;
+
+ char* public_ip;
+ tnet_port_t public_port;
+
+ struct {
+ const void* usrdata;
+ trtp_rtcp_cb_f fun;
+ } cb;
+
+ struct trtp_rtcp_session_s* session;
+ } rtcp;
+
+ TSK_DECLARE_SAFEOBJ;
+
+#if HAVE_SRTP
+ enum tmedia_srtp_type_e srtp_type;
+ enum tmedia_srtp_mode_e srtp_mode;
+ trtp_srtp_state_t srtp_state;
+ trtp_srtp_ctx_xt srtp_contexts[2/*LINE_IDX*/][2/*CRYPTO_TYPE*/];
+ const struct trtp_srtp_ctx_xs* srtp_ctx_neg_local;
+ const struct trtp_srtp_ctx_xs* srtp_ctx_neg_remote;
+
+ struct {
+ char* file_ca;
+ char* file_pbk;
+ char* file_pvk;
+ tsk_bool_t cert_verif;
+
+ trtp_srtp_state_t state;
+ // enable() could be postponed if net transport not ready yet (e.g. when ICE is ON)
+ tsk_bool_t enable_postponed;
+
+ tsk_bool_t srtp_connected;
+ tsk_bool_t srtcp_connected;
+ tsk_bool_t srtp_handshake_succeed;
+ tsk_bool_t srtcp_handshake_succeed;
+
+ trtp_srtp_crypto_type_t crypto_selected;
+
+ struct {
+ uint64_t timeout;
+ tsk_timer_id_t id;
+ } timer_hanshaking;
+
+ struct {
+ const void* usrdata;
+ trtp_srtp_dtls_cb_f fun;
+ } cb;
+
+ struct {
+ tnet_fingerprint_t fp;
+ tnet_dtls_hash_type_t fp_hash;
+ } remote;
+ struct {
+ tnet_dtls_setup_t setup;
+ tsk_bool_t connection_new;
+ } local;
+ } dtls;
#endif
}
trtp_manager_t;
@@ -214,7 +214,7 @@ TINYRTP_API tsk_size_t trtp_manager_send_rtp(trtp_manager_t* self, const void* d
TINYRTP_API tsk_size_t trtp_manager_send_rtp_packet(trtp_manager_t* self, const struct trtp_rtp_packet_s* packet, tsk_bool_t bypass_encrypt);
TINYRTP_API int trtp_manager_get_bytes_count(trtp_manager_t* self, uint64_t* bytes_in, uint64_t* bytes_out);
TINYRTP_API tsk_size_t trtp_manager_send_rtp_raw(trtp_manager_t* self, const void* data, tsk_size_t size);
-TINYRTP_API int trtp_manager_set_app_bandwidth_max(trtp_manager_t* self, int32_t bw_upload_kbps, int32_t bw_download_kbps);
+TINYRTP_API int trtp_manager_set_app_bw_and_jcng(trtp_manager_t* self, int32_t bw_upload_kbps, int32_t bw_download_kbps, float jcng_q);
TINYRTP_API int trtp_manager_signal_pkt_loss(trtp_manager_t* self, uint32_t ssrc_media, const uint16_t* seq_nums, tsk_size_t count);
TINYRTP_API int trtp_manager_signal_frame_corrupted(trtp_manager_t* self, uint32_t ssrc_media);
TINYRTP_API int trtp_manager_signal_jb_error(trtp_manager_t* self, uint32_t ssrc_media);
diff --git a/tinyRTP/include/tinyrtp/trtp_srtp.h b/tinyRTP/include/tinyrtp/trtp_srtp.h
index 9992bbb..2b3ac13 100755
--- a/tinyRTP/include/tinyrtp/trtp_srtp.h
+++ b/tinyRTP/include/tinyrtp/trtp_srtp.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2012 Mamadou Diop
* Copyright (C) 2012-2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
@@ -26,48 +26,45 @@
#include "tinyrtp_config.h"
#if HAVE_SRTP
-# include "tsk_common.h"
+# include "tsk_common.h"
# include <srtp/srtp.h>
struct trtp_manager_s;
-typedef enum trtp_srtp_dtls_event_type_e
-{
- trtp_srtp_dtls_event_type_handshake_failed,
- trtp_srtp_dtls_event_type_handshake_succeed,
- trtp_srtp_dtls_event_type_fatal_error,
- trtp_srtp_dtls_event_type_started
+typedef enum trtp_srtp_dtls_event_type_e {
+ trtp_srtp_dtls_event_type_handshake_failed,
+ trtp_srtp_dtls_event_type_handshake_succeed,
+ trtp_srtp_dtls_event_type_fatal_error,
+ trtp_srtp_dtls_event_type_started
}
trtp_srtp_dtls_event_type_t;
-typedef enum trtp_srtp_crypto_type_e
-{
- NONE = -1,
- HMAC_SHA1_80,
- HMAC_SHA1_32,
+typedef enum trtp_srtp_crypto_type_e {
+ NONE = -1,
+ HMAC_SHA1_80,
+ HMAC_SHA1_32,
- SRTP_CRYPTO_TYPES_MAX
+ SRTP_CRYPTO_TYPES_MAX
}
trtp_srtp_crypto_type_t;
-typedef enum trtp_srtp_state_e
-{
- trtp_srtp_state_none,
- /* at this state we're able to generated DTLS "fingerprints" and SDES "crypro" attributes
+typedef enum trtp_srtp_state_e {
+ trtp_srtp_state_none,
+ /* at this state we're able to generated DTLS "fingerprints" and SDES "crypro" attributes
but neither encrypt() nor decrypt() is possible.
it's possible to move backward and disable SRTP (e.g. because of negotiation error)
it's required to move to this state in order to be able to negotiate SRTP when mode is "optional" or "mandatory"
*/
- trtp_srtp_state_enabled,
- /* at this state both required parameters (e.g. "crypto" attributes) have been successfuly proceeded
+ trtp_srtp_state_enabled,
+ /* at this state both required parameters (e.g. "crypto" attributes) have been successfuly proceeded
it's not possible to move backward and disable SRTP
if type="SDES": start()ing the engine means we'll be imediately able to encrypt()/decrypt() data
if type="DTLS": start()ing the engine doesn't mean we will be able to encrypt()/decrypt() data unless handshaking process successfuly completed
*/
- trtp_srtp_state_activated,
- /* at this state we're able to encrypt()/decrypt() SRTP data
+ trtp_srtp_state_activated,
+ /* at this state we're able to encrypt()/decrypt() SRTP data
*/
- trtp_srtp_state_started
+ trtp_srtp_state_started
}
trtp_srtp_state_t;
@@ -79,31 +76,28 @@ typedef int (*trtp_srtp_dtls_cb_f)(const void* usrdata, enum trtp_srtp_dtls_eve
#define TRTP_SRTP_LINE_IDX_LOCAL 0
#define TRTP_SRTP_LINE_IDX_REMOTE 1
-static const char* trtp_srtp_crypto_type_strings[2] =
-{
- TRTP_SRTP_AES_CM_128_HMAC_SHA1_80, TRTP_SRTP_AES_CM_128_HMAC_SHA1_32
+static const char* trtp_srtp_crypto_type_strings[2] = {
+ TRTP_SRTP_AES_CM_128_HMAC_SHA1_80, TRTP_SRTP_AES_CM_128_HMAC_SHA1_32
};
-typedef struct trtp_srtp_ctx_internal_xs
-{
- int32_t tag;
- trtp_srtp_crypto_type_t crypto_type;
- char key_str[SRTP_MAX_KEY_LEN];
- char key_bin[SRTP_MASTER_KEY_LEN];
+typedef struct trtp_srtp_ctx_internal_xs {
+ int32_t tag;
+ trtp_srtp_crypto_type_t crypto_type;
+ char key_str[SRTP_MAX_KEY_LEN];
+ char key_bin[SRTP_MASTER_KEY_LEN];
tsk_bool_t have_valid_key;
- srtp_t session;
- srtp_policy_t policy;
- tsk_bool_t initialized;
+ srtp_t session;
+ srtp_policy_t policy;
+ tsk_bool_t initialized;
}
trtp_srtp_ctx_internal_xt;
-typedef struct trtp_srtp_ctx_xs
-{
- // (rtp == rtcp) for SDES but different for DTLS
- struct trtp_srtp_ctx_internal_xs rtp;
- struct trtp_srtp_ctx_internal_xs rtcp;
+typedef struct trtp_srtp_ctx_xs {
+ // (rtp == rtcp) for SDES but different for DTLS
+ struct trtp_srtp_ctx_internal_xs rtp;
+ struct trtp_srtp_ctx_internal_xs rtcp;
}
trtp_srtp_ctx_xt;
OpenPOWER on IntegriCloud