h245cmd.h
资源名称:h323.zip [点击查看]
上传用户:hnnddl
上传日期:2007-01-06
资源大小:3580k
文件大小:8k
源码类别:
IP电话/视频会议
开发平台:
WINDOWS
- /*
- * $Revision: 1.5 $
- * $Date: 1998/04/01 22:43:47 $
- */
- ////////////////////////////////////////////////////////////////
- // Copyright (c) 1996,97 Lucent Technologies //
- // All Rights Reserved //
- // //
- // THIS IS UNPUBLISHED //
- // PROPRIETARY SOURCE //
- // CODE OF Lucent Technologies //
- // AND elemedia //
- // //
- // The copyright notice above does not evidence any //
- // actual or intended publication of such source code//
- ////////////////////////////////////////////////////////////////
- //
- /////////////////////////////////////////////////////////////////
- // File : h245cmd.h //
- // //
- // Description: The classes for H.245 Commands. //
- // //
- // //
- // 05_May_1997 Created //
- // 20_Aug_1997 Added //
- // 06_Feb_1998 Added VideoTemporalSpatialTradeoff in MiscCmd //
- // 30_Mar_1998 Addition of Conference command //
- // //
- /////////////////////////////////////////////////////////////////
- #if (!defined(__H245CMD_H__))
- #define __H245CMD_H__
- #include "api/h245types.h"
- // List of H.245 Command messages we support.
- enum H245SigCommandType
- {
- CMDT_INVALID = 0,
- CMDT_NONSTD = 1,
- CMDT_FLOW_CONTROL = 5,
- CMDT_END_SESSION = 6,
- CMDT_MISCELLANEOUS = 7,
- CMDT_COMMUNICATION_MODE = 8,
- CMDT_CONF = 9
- };
- // List of sub types under CMD_MISCELLANEOUS
- enum H245SigMiscCommandType
- {
- MCMD_INVALID = 0,
- MCMD_MULTIPOINT = 3,
- MCMD_CANCEL_MULTIPOINT = 4,
- MCMD_VIDEO_FREEZE_PICTURE = 5,
- MCMD_VIDEO_FAST_UPDATE_PICTURE = 6,
- MCMD_VIDEO_TEMP_SPAT_TRADEOFF = 8
- };
- // List of end session types.
- enum H245SigEndSessionType
- {
- ESTY_INVALID = 0,
- ESTY_NONSTD = 1,
- ESTY_DISCONNECT = 2,
- ESTY_GSTN_OPTIONS
- };
- // List of conference command types.
- enum H245SigConfCommandType
- {
- CCMD_INVALID = 0,
- CCMD_BCAST_MY_LC = 1,
- CCMD_CANCEL_BCAST_MY_LC = 2,
- CCMD_MAKE_TERM_BCASTER = 3,
- CCMD_CALCEL_MAKE_TERM_BCASTER = 4,
- CCMD_SEND_THIS_SRC = 5,
- CCMD_CANCEL_SEND_THIS_SRC = 6,
- CCMD_DROP_CONF = 7
- };
- enum H245SigGSTNOption
- {
- GSTN_OPTION_INVALID = 0,
- GSTN_OPTION_TELEPHONY_MODE = 1,
- GSTN_OPTION_V8BIS = 2,
- GSTN_OPTION_V34DSVD = 3,
- GSTN_OPTION_V34DUPLEX_FAX = 4,
- GSTN_OPTION_V34H324 = 5
- };
- enum H245SigFlowControlScopeType
- {
- FCST_INVALID = 0,
- FCST_LCNUM = 1,
- FCST_RES_ID= 2,
- FCST_WHOLE_MULTIPLEX = 3
- };
- enum H245FlowControlRestrictionType
- {
- FCRT_INVALID = 0,
- FCRT_MAX_BITRATE = 1,
- FCRT_NORESTRICTION = 2
- };
- // Forward Declarations.
- class H245CommandMessage;
- class H245MiscellaneousCommand;
- class H245ConferenceCommand;
- class DLLEXPORT H245SigCommand
- {
- public:
- virtual ~H245SigCommand();
- // return the type of this message.
- // type is from H245SigCommandType.
- ProtReturnCode GetCommandType(int &type);
- // To allocate a new instance of the appropriate indication message.
- static ProtReturnCode Factory(H245SigCommand *&, int type);
- H245SigCommand& operator=(H245SigCommand&);
- public:
- // For Protocol internal use..
- virtual ProtReturnCode SetPriv(H245CommandMessage *msg) = 0;
- virtual H245CommandMessage *GetPriv() = 0;
- protected:
- // protected constructor. type is from H245SigCommandType.
- H245SigCommand(int type);
- H245CommandMessage *command;
- int type;
- };
- class DLLEXPORT H245SigFlowControlCommand :
- public H245SigCommand
- {
- public:
- H245SigFlowControlCommand();
- ~H245SigFlowControlCommand();
- // Methods to get/set FlowControl command
- // scope. scope is one of enum H245SigFlowControlScopeType
- ProtReturnCode SetScope(int scope);
- ProtReturnCode GetScope(int &scope);
- // used if scope == FCST_LCNUM
- ProtReturnCode SetLCNum(int lc_num);
- ProtReturnCode GetLCNum(int &lc_num);
- // used if scope == FCST_RES_ID
- ProtReturnCode SetResID(int id);
- ProtReturnCode GetResID(int &id);
- // Methods to get/set FlowControl command
- // restriction. restriction is one of
- // enum H245SigFlowControlRestrictionType
- ProtReturnCode SetRestriction(int restriction);
- ProtReturnCode GetRestriction(int &restriction);
- // used if restriction == FCRT_MAX_BITRATE
- ProtReturnCode GetMaxBitRate(int &rate);
- ProtReturnCode SetMaxBitRate(int rate);
- public:
- // for internal use.
- ProtReturnCode SetPriv(H245CommandMessage *msg);
- H245CommandMessage *GetPriv();
- private:
- int scope;
- int restriction;
- int max_bit_rate;
- int lc_num;
- int res_id;
- };
- class DLLEXPORT H245SigEndSessionCommand :
- public H245SigCommand
- {
- public:
- H245SigEndSessionCommand();
- ~H245SigEndSessionCommand();
- // Methods to get/set type of endsession message.
- // type is from enum H245SigEndSessionType.
- ProtReturnCode GetType(int &type);
- ProtReturnCode SetType(int type);
- // used if type == ESTY_NONSTD
- ProtReturnCode SetNonStd(H245SigNonStdParam &nsp);
- ProtReturnCode GetNonStd(H245SigNonStdParam &nsp);
- // used if type == ESTY_GSTN_OPTIONS
- // option is from enum H245SigGSTNOption
- ProtReturnCode GetGSTNOption(int &option);
- ProtReturnCode SetGSTNOption(int option);
- public:
- // for internal use.
- ProtReturnCode SetPriv(H245CommandMessage *msg);
- H245CommandMessage *GetPriv();
- private:
- int es_type;
- int gstn_option;
- H245NonStandardParameter *nsp;
- };
- class DLLEXPORT H245SigMiscCommand :
- public H245SigCommand
- {
- public:
- H245SigMiscCommand();
- ~H245SigMiscCommand();
- ProtReturnCode SetLCNum(int lc_num);
- ProtReturnCode GetLCNum(int &lc_num);
- // Method to set/get misc command type.
- // type takes values from enum H245SigMiscCommandType
- ProtReturnCode SetType(int type);
- ProtReturnCode GetType(int &type);
- // Method to set/get value of videoTemporalSpatialTradeOff value
- // This method can be used only if the type of the misc command
- // is MCMD_VIDEO_TEMP_SPAT_TRADEOFF
- ProtReturnCode SetVideoTST(int vtst);
- ProtReturnCode GetVideoTST(int &vtst);
- public:
- // for internal use.
- ProtReturnCode SetPriv(H245CommandMessage *msg);
- H245CommandMessage *GetPriv();
- private:
- H245MiscellaneousCommand *mcmd;
- int lc_num;
- int misc_command_type;
- int vtst_value;
- };
- class DLLEXPORT H245SigNonStdCommand :
- public H245SigCommand
- {
- public:
- H245SigNonStdCommand();
- ~H245SigNonStdCommand();
- ProtReturnCode SetNonStd(H245SigNonStdParam &nsp);
- ProtReturnCode GetNonStd(H245SigNonStdParam &nsp);
- public:
- // for internal use.
- ProtReturnCode SetPriv(H245CommandMessage *msg);
- H245CommandMessage *GetPriv();
- private:
- H245NonStandardParameter *nsp;
- };
- class DLLEXPORT H245SigCommModeCommand :
- public H245SigCommand
- {
- public:
- H245SigCommModeCommand();
- ~H245SigCommModeCommand();
- ProtReturnCode GetNumEntries(int &count);
- ProtReturnCode GetEntries(
- H245SigCommModeTableEntry table[], int &count);
- ProtReturnCode AddEntry(H245SigCommModeTableEntry &entry);
- public:
- // for internal use.
- ProtReturnCode SetPriv(H245CommandMessage *msg);
- H245CommandMessage *GetPriv();
- private:
- void *cm_list;
- int list_length;
- };
- class DLLEXPORT H245SigConfCommand :
- public H245SigCommand
- {
- public:
- H245SigConfCommand();
- ~H245SigConfCommand();
- // Methods to get/set type of conf command.
- // type is from enum H245SigConfCommandType.
- ProtReturnCode GetType(int &type);
- ProtReturnCode SetType(int type);
- // For H245SigConfCommandTypes CCMD_BCAST_MY_LC and
- // CCMD_CANCEL_BCAST_MY_LC
- ProtReturnCode SetLCNum(int lc_num);
- ProtReturnCode GetLCNum(int &lc_num);
- // For H245SigConfCommandTypes CCMD_MAKE_TERM_BCASTER and
- // CCMD_SEND_THIS_SRC
- ProtReturnCode GetTerminalLabel(H245SigTerminalLabel &l);
- ProtReturnCode SetTerminalLabel(H245SigTerminalLabel &l);
- public:
- // for internal use.
- ProtReturnCode SetPriv(H245CommandMessage *msg);
- H245CommandMessage *GetPriv();
- private:
- int lc_num;
- H245SigTerminalLabel label;
- int conf_cmd_type;
- H245ConferenceCommand *conf_cmd;
- };
- #endif //__H245CMD_H__