oocapability.h

来自「一个非常美妙的proxy。功能强大。基于sip的协议。如果还要的话」· C头文件 代码 · 共 710 行 · 第 1/2 页

H
710
字号
/* * Copyright (C) 2004-2005 by Objective Systems, Inc. * * This software is furnished under an open source license and may be  * used and copied only in accordance with the terms of this license.  * The text of the license may generally be found in the root  * directory of this installation in the COPYING file.  It  * can also be viewed online at the following URL: * *   http://www.obj-sys.com/open/license.html * * Any redistributions of this file including modified versions must  * maintain this copyright notice. * *****************************************************************************//** * @file ooCapability.h  * This file contains Capability management functions.  */#ifndef OO_CAPABILITY_H_#define OO_CAPABILITY_H_#include "ootypes.h"#include "ooasn1.h"#define OO_GSMFRAMESIZE 33 /* standard frame size for gsm is 33 bytes */#define OORX      (1<<0)#define OOTX      (1<<1)#define OORXANDTX (1<<2)#define OORXTX    (1<<3) /* For symmetric capabilities *//* Various types of caps. Note that not all    supported */typedef enum OOCapabilities{   OO_CAP_AUDIO_BASE      = 0,   OO_G711ALAW64K         = 2,   OO_G711ALAW56K         = 3,   OO_G711ULAW64K         = 4,   OO_G711ULAW56K         = 5,   OO_G7231               = 9,   OO_G729                = 11,   OO_G729A               = 12,   OO_GSMFULLRATE         = 18,   OO_GSMHALFRATE         = 19,   OO_GSMENHANCEDFULLRATE = 20,   OO_CAP_VIDEO_BASE      = 27,   OO_NONSTDVIDEO         = 28,   OO_H261VIDEO           = 29,   OO_H262VIDEO           = 30,   OO_H263VIDEO           = 31,   OO_IS11172VIDEO        = 32,  /* mpeg */   OO_GENERICVIDEO        = 33,   OO_EXTELEMVIDEO        = 34} OOCapabilities;/*DTMF capabilities*/#define OO_CAP_DTMF_RFC2833              (1<<0)#define OO_CAP_DTMF_Q931                 (1<<1)#define OO_CAP_DTMF_H245_alphanumeric    (1<<2)#define OO_CAP_DTMF_H245_signal          (1<<3)/** * This structure defines the preference order for capabilities. *  */typedef struct OOCapPrefs {  int order[20];  int index;}OOCapPrefs;typedef struct OOCapParams {   int txframes;  /*!< Number of frames per packet for transmission */   int rxframes;  /*!< Number of frames per packet for reception */   OOBOOL silenceSuppression; } OOCapParams;typedef struct OOGSMCapParams {   unsigned txframes;    unsigned rxframes;   OOBOOL scrambled;   OOBOOL comfortNoise;} OOGSMCapParams;typedef enum OOPictureFormat{   OO_PICFORMAT_SQCIF,   OO_PICFORMAT_QCIF,   OO_PICFORMAT_CIF,   OO_PICFORMAT_CIF4,   OO_PICFORMAT_CIF16}OOPictureFormat;typedef struct OOH263CapParams {   enum OOPictureFormat picFormat; /* !< One of sqcif, qcif, cif, cif4, cif16*/   unsigned MPI; /* !< Minimum Picture Interval */  unsigned maxBitRate; /* !< Maximum bit rate for transmission/reception in units of 100 bits/sec */} OOH263CapParams;struct OOH323CallData;struct OOLogicalChannel;#ifdef __cplusplusextern "C" {#endif/**  * This callback is used for starting media receive channel. This callback * function is triggered when receive media channel has to be started. * @param call     Call for which receive media channel has to be started. * @param pChannel Channel details. This structure has important information *                 such as rtp ip:port and capability describing media type *                 to be received. * @return         OO_OK, on success. OO_FAILED, on failure */typedef int (*cb_StartReceiveChannel)     (struct OOH323CallData *call, struct OOLogicalChannel *pChannel);/**  * This callback is used for starting media transmit channel. This callback * function is triggered when transmit media channel has to be started. * @param call     Call for which transmit media channel has to be started. * @param pChannel Channel details. This structure has important information *                 such as rtp ip:port and capability describing media type *                 to be transmitted. * @return         OO_OK, on success. OO_FAILED, on failure */typedef int (*cb_StartTransmitChannel)     (struct OOH323CallData *call, struct OOLogicalChannel *pChannel);/**  * This callback is used for stopping media receive channel. This callback * function is triggered when receive media channel has to be stopped. * @param call     Call for which receive media channel has to be stopped. * @param pChannel Channel details. This structure has important information *                 such as rtp ip:port and capability describing media type *                 being received. * @return         OO_OK, on success. OO_FAILED, on failure */typedef int (*cb_StopReceiveChannel)     (struct OOH323CallData *call, struct OOLogicalChannel *pChannel);/**  * This callback is used for stopping media transmit channel. This callback * function is triggered when transmit media channel has to be stopped. * @param call     Call for which transmit media channel has to be stopped. * @param pChannel Channel details. This structure has important information *                 such as rtp ip:port and capability describing media type *                 being transmitted. * @return         OO_OK, on success. OO_FAILED, on failure */typedef int (*cb_StopTransmitChannel)     (struct OOH323CallData *call, struct OOLogicalChannel *pChannel);typedef enum OOCapType {   OO_CAP_TYPE_AUDIO,   OO_CAP_TYPE_VIDEO,   OO_CAP_TYPE_DATA} OOCapType;/** * Structure to store information related to end point * capability */typedef struct ooH323EpCapability {   int dir;    int cap;   OOCapType capType;   void *params;   cb_StartReceiveChannel startReceiveChannel;   cb_StartTransmitChannel startTransmitChannel;   cb_StopReceiveChannel stopReceiveChannel;   cb_StopTransmitChannel stopTransmitChannel;   struct ooH323EpCapability *next;} ooH323EpCapability;#ifndef EXTERN#if defined (MAKE_DLL)#define EXTERN __declspec(dllexport)#else#define EXTERN#endif /* MAKE_DLL */#endif /* EXTERN *//**  * @defgroup capmgmt  Capability Management * @{ *//** * This function is used to add rfc2833 based dtmf detection capability * @param call                   Call if enabling for call, else null for  *                               endpoint. * @param dynamicRTPPayloadType  dynamicRTPPayloadType to be used. * @return                       OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooCapabilityEnableDTMFRFC2833   (struct OOH323CallData *call, int dynamicRTPPayloadType);/** * This function is used to remove rfc2833 dtmf detection capability. * @param call             Handle to call, if disabling for the call, else NULL *                         for end-point. * @return                 OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooCapabilityDisableDTMFRFC2833(struct OOH323CallData *call);/** * This function is used to enable support for H.245 based alphanumeric dtmf  * capability. * @param call             Handle to call, if enabling for the call, else NULL *                         for end-point. * @return                 OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooCapabilityEnableDTMFH245Alphanumeric(struct OOH323CallData *call);/** * This function is used to disable support for H.245 based alphanumeric dtmf  * capability. * @param call             Handle to call, if disabling for the call, else NULL *                         for end-point. * @return                 OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooCapabilityDisableDTMFH245Alphanumeric                                             (struct OOH323CallData *call);/** * This function is used to enable support for H.245 based signal dtmf  * capability. * @param call             Handle to call, if enabling for the call, else NULL *                         for end-point. * @return                 OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooCapabilityEnableDTMFH245Signal(struct OOH323CallData *call);/** * This function is used to disable support for H.245 based signal dtmf  * capability. * @param call             Handle to call, if disabling for the call, else NULL *                         for end-point. * @return                 OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooCapabilityDisableDTMFH245Signal(struct OOH323CallData *call);/** * This function is used to enable support for dtmf using Q.931 Keypad IE. * @param call             Handle to call, if enabling for the call, else NULL *                         for end-point. * @return                 OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooCapabilityEnableDTMFQ931Keypad(struct OOH323CallData *call);/** * This function is used to disable support for dtmf using Q.931 Keypad IE. * @param call             Handle to call, if disabling for the call, else NULL *                         for end-point. * @return                 OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooCapabilityDisableDTMFQ931Keypad(struct OOH323CallData *call);/** * This function is used to add simple capabilities which have only rxframes * and txframes parameters to the endpoint or call.(ex. G711, G729) * @param call                 Handle to a call. If this is not Null, then  *                             capability is added to call's remote enpoint  *                             capability list, else it is added to local H323  *                             endpoint list. * @param cap                  Type of G711 capability to be added. * @param txframes             Number of frames per packet for transmission.  * @param rxframes             Number of frames per packet for reception. * @param silenceSuppression   Indicates support for silence suppression. *                             Used only in case of g7231, otherwise ignored. * @param dir                  Direction of capability.OORX, OOTX, OORXANDTX * @param startReceiveChannel  Callback function to start receive channel. * @param startTransmitChannel Callback function to start transmit channel. * @param stopReceiveChannel   Callback function to stop receive channel. * @param stopTransmitChannel  Callback function to stop transmit channel. * @param remote               TRUE, if adding call's remote capability. * * @return                     OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooCapabilityAddSimpleCapability   (struct OOH323CallData *call, int cap, int txframes, int rxframes,     OOBOOL silenceSuppression, int dir,     cb_StartReceiveChannel startReceiveChannel,    cb_StartTransmitChannel startTransmitChannel,    cb_StopReceiveChannel stopReceiveChannel,    cb_StopTransmitChannel stopTransmitChannel,    OOBOOL remote);/** * This is an internal helper function which is used to add a GSM capability * to local endpoints capability list or to remote endpoints capability list or * to a call's capability list. * @param call                 Handle to a call. If this is not Null, then  *                             capability is added to call's remote enpoint  *                             capability list, else it is added to local H323  *                             endpoint list. * @param cap                  Type of GSM capability to be added. * @param framesPerPkt         Number of GSM frames per packet.  * @param comfortNoise         Comfort noise spec for the capability.  * @param scrambled            Scrambled enabled/disabled for the capability. * @param dir                  Direction of capability.OORX, OOTX, OORXANDTX * @param startReceiveChannel  Callback function to start receive channel. * @param startTransmitChannel Callback function to start transmit channel. * @param stopReceiveChannel   Callback function to stop receive channel. * @param stopTransmitChannel  Callback function to stop transmit channel. * @param remote               TRUE, if adding call's remote capabilities. * * @return                     OO_OK, on success. OO_FAILED, on failure.  */int ooCapabilityAddGSMCapability(struct OOH323CallData *call, int cap,                                 unsigned framesPerPkt, OOBOOL comfortNoise,                                OOBOOL scrambled, int dir,                                 cb_StartReceiveChannel startReceiveChannel,                                cb_StartTransmitChannel startTransmitChannel,                                cb_StopReceiveChannel stopReceiveChannel,                                cb_StopTransmitChannel stopTransmitChannel,                                 OOBOOL remote);/** * This function is used to add H263 video capability to local endpoints  * capability list or to remote endpoints capability list or to a call's  * capability list. * @param call                 Handle to a call. If this is not Null, then  *                             capability is added to call's remote enpoint  *                             capability list, else it is added to local H323  *                             endpoint list. * @param sqcifMPI             Minimum picture interval for encoding/decoding  *                             of SQCIF pictures. * @param qcifMPI              Minimum picture interval for encoding/decoding  *                             of QCIF pictures. * @param cifMPI               Minimum picture interval for encoding/decoding  *                             of CIF pictures. * @param cif4MPI              Minimum picture interval for encoding/decoding  *                             of CIF4 pictures. * @param cif16MPI             Minimum picture interval for encoding/decoding  *                             of CIF16 pictures. * @param maxBitRate           Maximum bit rate in units of 100 bits/s at *                             which a transmitter can transmit video or a  *                             receiver can receive video. * @param dir                  Direction of capability.OORX, OOTX, OORXANDTX * @param startReceiveChannel  Callback function to start receive channel. * @param startTransmitChannel Callback function to start transmit channel. * @param stopReceiveChannel   Callback function to stop receive channel. * @param stopTransmitChannel  Callback function to stop transmit channel. * @param remote               TRUE, if adding call's remote capabilities. * * @return                     OO_OK, on success. OO_FAILED, on failure. 

⌨️ 快捷键说明

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