📄 payload.h
字号:
/*********************************************************************** Copyright (c) 2002 RADVISION Ltd.************************************************************************NOTICE:This document contains information that is confidential and proprietaryto RADVISION Ltd.. No part of this document may be reproduced in anyform whatsoever without written prior approval by RADVISION Ltd..RADVISION Ltd. reserve the right to revise this publication and makechanges without obligation to notify any person of such revisions orchanges.***********************************************************************/#ifndef __PAYLOAD_H#define __PAYLOAD_H#include "rverror.h"#include "rtp.h"#ifdef __cplusplusextern "C" {#endiftypedef enum{ PCMU = 0, G7231 = 4, PCMA = 8, G722 = 9, G728 = 15, G729 = 18, H261 = 31, H263 = 34} payload_e;/* == G.711 U-Law == */RVAPIRvInt32 RVCALLCONV rtpPCMUPack( IN void * buf, IN RvInt32 len, IN rtpParam * p, IN void * param);RVAPIRvInt32 RVCALLCONV rtpPCMUUnpack( OUT void * buf, IN RvInt32 len, OUT rtpParam * p, OUT void * param);RVAPIRvInt32 RVCALLCONV rtpPCMUGetHeaderLength(void);/* == G.711 A-Law == */RVAPIRvInt32 RVCALLCONV rtpPCMAPack( IN void * buf, IN RvInt32 len, IN rtpParam * p, IN void * param);RVAPIRvInt32 RVCALLCONV rtpPCMAUnpack( OUT void * buf, IN RvInt32 len, OUT rtpParam * p, OUT void * param);RVAPIRvInt32 RVCALLCONV rtpPCMAGetHeaderLength(void);/* == G.722 == */RVAPIRvInt32 RVCALLCONV rtpG722Pack( IN void * buf, IN RvInt32 len, IN rtpParam * p, IN void * param);RVAPIRvInt32 RVCALLCONV rtpG722Unpack( OUT void * buf, IN RvInt32 len, OUT rtpParam * p, OUT void * param);RVAPIRvInt32 RVCALLCONV rtpG722GetHeaderLength(void);/* == G.728 == */RVAPIRvInt32 RVCALLCONV rtpG728Pack( IN void * buf, IN RvInt32 len, IN rtpParam * p, IN void * param);RVAPIRvInt32 RVCALLCONV rtpG728Unpack( OUT void * buf, IN RvInt32 len, OUT rtpParam * p, OUT void * param);RVAPIRvInt32 RVCALLCONV rtpG728GetHeaderLength(void);/* == G.729 == */RVAPIRvInt32 RVCALLCONV rtpG729Pack( IN void * buf, IN RvInt32 len, IN rtpParam * p, IN void * param);RVAPIRvInt32 RVCALLCONV rtpG729Unpack( OUT void * buf, IN RvInt32 len, OUT rtpParam * p, OUT void * param);RVAPIRvInt32 RVCALLCONV rtpG729GetHeaderLength(void);/* == G.723.1 == */RVAPIRvInt32 RVCALLCONV rtpG7231Pack( IN void * buf, IN RvInt32 len, IN rtpParam * p, IN void * param);RVAPIRvInt32 RVCALLCONV rtpG7231Unpack( OUT void * buf, IN RvInt32 len, OUT rtpParam * p, OUT void * param);RVAPIRvInt32 RVCALLCONV rtpG7231GetHeaderLength(void);/* == H.261 == */typedef struct{ int sBit; int eBit; int i; int v; int gobN; int mbaP; int quant; int hMvd; int vMvd;} H261param;RVAPIRvInt32 RVCALLCONV rtpH261Pack( IN void * buf, IN RvInt32 len, IN rtpParam * p, IN void * param);RVAPIRvInt32 RVCALLCONV rtpH261Unpack( OUT void*buf, IN RvInt32 len, OUT rtpParam*p, OUT void * param);RVAPIRvInt32 RVCALLCONV rtpH261GetHeaderLength(void);/* == H.263 == */typedef struct{ int f; int p; int sBit; int eBit; int src; int i; int a; int s; int dbq; int trb; int tr; int gobN; int mbaP; int quant; int hMv1; int vMv1; int hMv2; int vMv2;} H263param;RVAPIRvInt32 RVCALLCONV rtpH263Pack( IN void * buf, IN RvInt32 len, IN rtpParam * p, IN void * param);RVAPIRvInt32 RVCALLCONV rtpH263Unpack( OUT void * buf, IN RvInt32 len, OUT rtpParam * p, OUT void * param);RVAPIRvInt32 RVCALLCONV rtpH263GetHeaderLength(void);/* == H.263a == */typedef struct{ int f; int p; int sBit; int eBit; int src; int i; int u; int a; int s; int dbq; int trb; int tr; int gobN; int mbaP; int quant; int hMv1; int vMv1; int hMv2; int vMv2;} H263aparam;RVAPIRvInt32 RVCALLCONV rtpH263aPack( IN void * buf, IN RvInt32 len, IN rtpParam * p, IN void * param);RVAPIRvInt32 RVCALLCONV rtpH263aUnpack( OUT void * buf, IN RvInt32 len, OUT rtpParam * p, OUT void * param);RVAPIRvInt32 RVCALLCONV rtpH263aGetHeaderLength(void);/* ================================================== *//* ==== DTMF inBand (via RTP payload) - RFC 2833 ==== *//* ================================================== */ /* There are two types/options of transmitting DTMF in RTP payload: 1) identify the frequency component of the voice-band signals, and than transmit them 'as is' to their destination. 2) identify the tones and translate them into an event-name. the event-name is a logical description of DTMF tones, fax-related tones etc. the receiver, on this case, produces the signals appropriate to the event name that was received. each of these options has a different method for transmiting the information inside an RTP payload. since they are not both mandatory, an endpoint may indicate support for receiving these tones/events by including the following flags in the terminal capability set (TCS): (*) 'receiveRTPAudioTelephoneEventCapability' - for event-name method. (*) 'receiveRTPAudioToneCapability' - for tones-frequency method. at this phase, as noted in the MRD (and as recommended in RFC2833) the mandatory telephone events are the following DTMF's: 0,1,2,3,4,5,6,7,8,9,#,*,A,B,C,D. the events will be identified by an enumeration. *//* DTMF event name. according to RFC2833 - the order is very important! do not change the order! */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -