aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-14 13:37:07 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-14 13:37:07 +0000
commitf3a2d1775a50b17e39cb135d2858bb14b604d846 (patch)
tree286bbaf1d6f9c03c1aa7e5b135c437d0697a2330 /include
parent7dd656be4810ec86df58a1362085159e09401563 (diff)
Adding spport for T.140 RED - Simple RTP redundancy to prevent packet loss in text stream
Work sponsored by Omnitor AB, Stockholm, Sweden (http://www.omnitor.se) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@116237 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/frame.h8
-rw-r--r--include/asterisk/rtp.h21
2 files changed, 27 insertions, 2 deletions
diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h
index 719048b02..0cd748c03 100644
--- a/include/asterisk/frame.h
+++ b/include/asterisk/frame.h
@@ -274,8 +274,12 @@ extern struct ast_frame ast_null_frame;
/*! MPEG4 Video */
#define AST_FORMAT_MP4_VIDEO (1 << 22)
#define AST_FORMAT_VIDEO_MASK (((1 << 25)-1) & ~(AST_FORMAT_AUDIO_MASK))
-/*! T.140 Text format - ITU T.140, RFC 4351*/
-#define AST_FORMAT_T140 (1 << 25)
+/*! T.140 Text format - ITU T.140, RFC 4103 */
+#define AST_FORMAT_T140 (1 << 26)
+/*! T.140 RED Text format RFC 4103 */
+#define AST_FORMAT_T140RED (1 << 27)
+/*! Maximum text mask */
+#define AST_FORMAT_MAX_TEXT (1 << 28))
#define AST_FORMAT_TEXT_MASK (((1 << 30)-1) & ~(AST_FORMAT_AUDIO_MASK) & ~(AST_FORMAT_VIDEO_MASK))
enum ast_control_frame_type {
diff --git a/include/asterisk/rtp.h b/include/asterisk/rtp.h
index 5a857f016..bb8358feb 100644
--- a/include/asterisk/rtp.h
+++ b/include/asterisk/rtp.h
@@ -51,6 +51,9 @@ extern "C" {
/*! Maxmum number of payload defintions for a RTP session */
#define MAX_RTP_PT 256
+/*! T.140 Redundancy Maxium number of generations */
+#define RED_MAX_GENERATION 5
+
#define FLAG_3389_WARNING (1 << 0)
enum ast_rtp_options {
@@ -67,6 +70,8 @@ enum ast_rtp_get_result {
};
struct ast_rtp;
+/*! T.140 Redundancy structure*/
+struct rtp_red;
/*! \brief This is the structure that binds a channel (SIP/Jingle/H.323) to the RTP subsystem
*/
@@ -288,6 +293,22 @@ int ast_rtp_get_rtptimeout(struct ast_rtp *rtp);
/* \brief Put RTP timeout timers on hold during another transaction, like T.38 */
void ast_rtp_set_rtptimers_onhold(struct ast_rtp *rtp);
+/*! \brief Initalize t.140 redudancy
+ * \param ti time between each t140red frame is sent
+ * \param red_pt payloadtype for RTP packet
+ * \param pt payloadtype numbers for each generation including primary data
+ * \param num_gen number of redundant generations, primary data excluded
+ */
+int rtp_red_init(struct ast_rtp *rtp, int ti, int *pt, int num_gen);
+
+void red_init(struct rtp_red *red, const struct ast_frame *f);
+
+
+/*! \brief Buffer t.140 data */
+void red_buffer_t140(struct ast_rtp *rtp, struct ast_frame *f);
+
+
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif