⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 payload.h

📁 基于h323协议的软phone
💻 H
📖 第 1 页 / 共 2 页
字号:
/***********************************************************************
        Copyright (c) 2002 RADVISION Ltd.
************************************************************************
NOTICE:
This document contains information that is confidential and proprietary
to RADVISION Ltd.. No part of this document may be reproduced in any
form whatsoever without written prior approval by RADVISION Ltd..

RADVISION Ltd. reserve the right to revise this publication and make
changes without obligation to notify any person of such revisions or
changes.
***********************************************************************/

#ifndef __PAYLOAD_H
#define __PAYLOAD_H

#ifdef __cplusplus
extern "C" {
#endif


typedef enum
{
    PCMU  =  0,
    G7231 =  4,
    PCMA  =  8,
    G722  =  9,
    G728  = 15,
    G729  = 18,
    H261  = 31,
    H263  = 34

} payload_e;



/* == G.711 U-Law == */

RVAPI
RvInt32 RVCALLCONV rtpPCMUPack(
        IN  void *      buf,
        IN  RvInt32     len,
        IN  rtpParam *  p,
        IN  void     *  param);

RVAPI
RvInt32 RVCALLCONV rtpPCMUUnpack(
        OUT  void *      buf,
        IN   RvInt32     len,
        OUT  rtpParam *  p,
        OUT  void *      param);

RVAPI
RvInt32 RVCALLCONV rtpPCMUGetHeaderLength(void);


/* == G.711 A-Law == */

RVAPI
RvInt32 RVCALLCONV rtpPCMAPack(
        IN  void *      buf,
        IN  RvInt32     len,
        IN  rtpParam *  p,
        IN  void     *  param);

RVAPI
RvInt32 RVCALLCONV rtpPCMAUnpack(
        OUT  void *      buf,
        IN   RvInt32     len,
        OUT  rtpParam *  p,
        OUT  void *      param);

RVAPI
RvInt32 RVCALLCONV rtpPCMAGetHeaderLength(void);


/* == G.722 == */

RVAPI
RvInt32 RVCALLCONV rtpG722Pack(
        IN  void *      buf,
        IN  RvInt32     len,
        IN  rtpParam *  p,
        IN  void     *  param);


RVAPI
RvInt32 RVCALLCONV rtpG722Unpack(
        OUT  void *      buf,
        IN   RvInt32     len,
        OUT  rtpParam *  p,
        OUT  void *      param);

RVAPI
RvInt32 RVCALLCONV rtpG722GetHeaderLength(void);

/* == G.728 == */

RVAPI
RvInt32 RVCALLCONV rtpG728Pack(
        IN  void *      buf,
        IN  RvInt32     len,
        IN  rtpParam *  p,
        IN  void     *  param);


RVAPI
RvInt32 RVCALLCONV rtpG728Unpack(
        OUT  void *      buf,
        IN   RvInt32     len,
        OUT  rtpParam *  p,
        OUT  void *      param);

RVAPI
RvInt32 RVCALLCONV rtpG728GetHeaderLength(void);

/* == G.729 == */

RVAPI
RvInt32 RVCALLCONV rtpG729Pack(
        IN  void *      buf,
        IN  RvInt32     len,
        IN  rtpParam *  p,
        IN  void     *  param);


RVAPI
RvInt32 RVCALLCONV rtpG729Unpack(
        OUT  void *      buf,
        IN   RvInt32     len,
        OUT  rtpParam *  p,
        OUT  void *      param);

RVAPI
RvInt32 RVCALLCONV rtpG729GetHeaderLength(void);


/* == G.723.1 == */
RVAPI
RvInt32 RVCALLCONV rtpG7231Pack(
        IN  void *      buf,
        IN  RvInt32     len,
        IN  rtpParam *  p,
        IN  void     *  param);

RVAPI
RvInt32 RVCALLCONV rtpG7231Unpack(
        OUT  void *      buf,
        IN   RvInt32     len,
        OUT  rtpParam *  p,
        OUT  void *      param);

RVAPI
RvInt32 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;

RVAPI
RvInt32 RVCALLCONV rtpH261Pack(
        IN  void *      buf,
        IN  RvInt32     len,
        IN  rtpParam *  p,
        IN  void     *  param);

RVAPI
RvInt32 RVCALLCONV rtpH261Unpack(
        OUT  void*buf,
        IN   RvInt32     len,
        OUT  rtpParam*p,
        OUT  void *      param);

RVAPI
RvInt32 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;

RVAPI
RvInt32 RVCALLCONV rtpH263Pack(
        IN  void *      buf,
        IN  RvInt32     len,
        IN  rtpParam *  p,
        IN  void     *  param);

RVAPI
RvInt32 RVCALLCONV rtpH263Unpack(
        OUT  void *      buf,
        IN   RvInt32     len,
        OUT  rtpParam *  p,
        OUT  void *      param);


RVAPI
RvInt32 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;

RVAPI
RvInt32 RVCALLCONV rtpH263aPack(
        IN  void *      buf,
        IN  RvInt32     len,
        IN  rtpParam *  p,
        IN  void     *  param);

RVAPI
RvInt32 RVCALLCONV rtpH263aUnpack(
        OUT  void *      buf,
        IN   RvInt32     len,
        OUT  rtpParam *  p,
        OUT  void *      param);


RVAPI
RvInt32 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:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -