caps_h323.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. #ifndef __AST_H323CAPS_H
  2. #define __AST_H323CAPS_H
  3. /**This class describes the G.711 codec capability.
  4. */
  5. class AST_G711Capability : public H323AudioCapability
  6. {
  7. PCLASSINFO(AST_G711Capability, H323AudioCapability);
  8. public:
  9. AST_G711Capability(int rx_frames = 125, H323_G711Capability::Mode _mode = H323_G711Capability::muLaw, H323_G711Capability::Speed _speed = H323_G711Capability::At64k);
  10. virtual PObject *Clone() const;
  11. virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
  12. virtual unsigned GetSubType() const;
  13. virtual PString GetFormatName() const;
  14. protected:
  15. H323_G711Capability::Mode mode;
  16. H323_G711Capability::Speed speed;
  17. };
  18. /**This class describes the G.723.1 codec capability.
  19. */
  20. class AST_G7231Capability : public H323AudioCapability
  21. {
  22. PCLASSINFO(AST_G7231Capability, H323AudioCapability);
  23. public:
  24. AST_G7231Capability(int rx_frames = 7, PBoolean annexA = TRUE);
  25. Comparison Compare(const PObject & obj) const;
  26. virtual PObject * Clone() const;
  27. virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
  28. virtual unsigned GetSubType() const;
  29. virtual PString GetFormatName() const;
  30. virtual PBoolean OnSendingPDU(H245_AudioCapability & pdu, unsigned packetSize) const;
  31. virtual PBoolean OnReceivedPDU(const H245_AudioCapability & pdu, unsigned & packetSize);
  32. protected:
  33. PBoolean annexA;
  34. };
  35. /**This class describes the (fake) G729 codec capability.
  36. */
  37. class AST_G729Capability : public H323AudioCapability
  38. {
  39. PCLASSINFO(AST_G729Capability, H323AudioCapability);
  40. public:
  41. AST_G729Capability(int rx_frames = 24);
  42. /* Create a copy of the object. */
  43. virtual PObject * Clone() const;
  44. /* Create the codec instance, allocating resources as required. */
  45. virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
  46. /* Get the sub-type of the capability. This is a code dependent on the
  47. main type of the capability.
  48. This returns one of the four possible combinations of mode and speed
  49. using the enum values of the protocol ASN H245_AudioCapability class. */
  50. virtual unsigned GetSubType() const;
  51. /* Get the name of the media data format this class represents. */
  52. virtual PString GetFormatName() const;
  53. };
  54. /* This class describes the VoiceAge G729A codec capability. */
  55. class AST_G729ACapability : public H323AudioCapability
  56. {
  57. PCLASSINFO(AST_G729ACapability, H323AudioCapability);
  58. public:
  59. /* Create a new G.729A capability. */
  60. AST_G729ACapability(int rx_frames = 24);
  61. /* Create a copy of the object. */
  62. virtual PObject * Clone() const;
  63. /* Create the codec instance, allocating resources as required. */
  64. virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
  65. /* Get the sub-type of the capability. This is a code dependent on the
  66. main type of the capability.
  67. This returns one of the four possible combinations of mode and speed
  68. using the enum values of the protocol ASN H245_AudioCapability class. */
  69. virtual unsigned GetSubType() const;
  70. /* Get the name of the media data format this class represents. */
  71. virtual PString GetFormatName() const;
  72. };
  73. /* This class describes the GSM-06.10 codec capability. */
  74. class AST_GSM0610Capability : public H323AudioCapability
  75. {
  76. PCLASSINFO(AST_GSM0610Capability, H323AudioCapability);
  77. public:
  78. /* Create a new GSM capability. */
  79. AST_GSM0610Capability(int rx_frames = 24, int comfortNoise = 0, int scrambled = 0);
  80. /* Create a copy of the object. */
  81. virtual PObject * Clone() const;
  82. /* Create the codec instance, allocating resources as required. */
  83. virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
  84. /* Get the sub-type of the capability. This is a code dependent on the
  85. main type of the capability.
  86. This returns one of the four possible combinations of mode and speed
  87. using the enum values of the protocol ASN H245_AudioCapability class. */
  88. virtual unsigned GetSubType() const;
  89. /* Get the name of the media data format this class represents. */
  90. virtual PString GetFormatName() const;
  91. PBoolean OnSendingPDU(H245_AudioCapability & pdu, unsigned packetSize) const;
  92. PBoolean OnReceivedPDU(const H245_AudioCapability & pdu, unsigned & packetSize);
  93. protected:
  94. int comfortNoise;
  95. int scrambled;
  96. };
  97. #define CISCO_G726r32 "G726r32"
  98. class AST_CiscoG726Capability : public H323NonStandardAudioCapability {
  99. PCLASSINFO(AST_CiscoG726Capability, H323NonStandardAudioCapability);
  100. public:
  101. /* Create a new Cisco G.726 capability */
  102. AST_CiscoG726Capability(int rx_frames = 80);
  103. /* Create a copy of the object. */
  104. virtual PObject * Clone() const;
  105. /* Create the codec instance, allocating resources as required. */
  106. virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
  107. /* Get the name of the media data format this class represents. */
  108. virtual PString GetFormatName() const;
  109. };
  110. #define CISCO_DTMF_RELAY "UserInput/RtpDtmfRelay"
  111. class AST_CiscoDtmfCapability : public H323NonStandardDataCapability
  112. {
  113. PCLASSINFO(AST_CiscoDtmfCapability, H323NonStandardDataCapability);
  114. public:
  115. /* Create a new Cisco RTP DTMF Relay capability */
  116. AST_CiscoDtmfCapability();
  117. /* Create a copy of the object. */
  118. virtual PObject *Clone() const;
  119. /* Create the codec instance, allocating resources as required. */
  120. virtual H323Codec * CreateCodec(H323Codec::Direction direction) const;
  121. /* Get the name of the media data format this class represents. */
  122. virtual PString GetFormatName() const;
  123. virtual H323Channel *CreateChannel(H323Connection &,
  124. H323Channel::Directions,
  125. unsigned,
  126. const H245_H2250LogicalChannelParameters *) const
  127. {
  128. return NULL;
  129. }
  130. };
  131. #endif /* __AST_H323CAPS_H */