Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

222 lines
3.5 KiB

  1. /*
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. */
  4. #ifndef __SDP_MEDIA__
  5. #define __SDP_MEDIA__
  6. #include "sdpcommo.h"
  7. #include "sdpcstrl.h"
  8. #include "sdpbstrl.h"
  9. #include "sdpconn.h"
  10. #include "sdpbw.h"
  11. #include "sdpenc.h"
  12. #include "sdpatt.h"
  13. #include "sdpval.h"
  14. #include "sdpsobst.h"
  15. class _DllDecl SDP_FORMAT_CODE_LIST :
  16. public SDP_OPT_BSTRING_LIST,
  17. public SDP_OPT_BSTRING_SAFEARRAY
  18. {
  19. public:
  20. inline SDP_FORMAT_CODE_LIST();
  21. };
  22. inline
  23. SDP_FORMAT_CODE_LIST::SDP_FORMAT_CODE_LIST(
  24. )
  25. : SDP_OPT_BSTRING_SAFEARRAY(*((SDP_OPT_BSTRING_LIST *)this))
  26. {
  27. }
  28. class _DllDecl SDP_MEDIA : public SDP_VALUE
  29. {
  30. public:
  31. SDP_MEDIA();
  32. inline SDP_OPTIONAL_BSTRING &GetName();
  33. inline SDP_REQD_BSTRING_LINE &GetTitle();
  34. inline SDP_USHORT &GetStartPort();
  35. inline SDP_USHORT &GetNumPorts();
  36. inline SDP_OPTIONAL_BSTRING &GetProtocol();
  37. inline SDP_FORMAT_CODE_LIST &GetFormatCodeList();
  38. inline SDP_CONNECTION &GetConnection();
  39. inline SDP_BANDWIDTH &GetBandwidth();
  40. inline SDP_ENCRYPTION_KEY &GetEncryptionKey();
  41. inline SDP_ATTRIBUTE_LIST &GetAttributeList();
  42. HRESULT SetPortInfo(
  43. IN USHORT StartPort,
  44. IN USHORT NumPorts
  45. );
  46. protected:
  47. SDP_OPTIONAL_BSTRING m_Name;
  48. SDP_USHORT m_StartPort;
  49. SDP_USHORT m_NumPorts;
  50. SDP_OPTIONAL_BSTRING m_TransportProtocol;
  51. SDP_FORMAT_CODE_LIST m_FormatCodeList;
  52. SDP_REQD_BSTRING_LINE m_Title;
  53. SDP_CONNECTION m_Connection;
  54. SDP_BANDWIDTH m_Bandwidth;
  55. SDP_ENCRYPTION_KEY m_EncryptionKey;
  56. SDP_ATTRIBUTE_LIST m_AttributeList;
  57. virtual void InternalReset();
  58. virtual BOOL CalcIsModified() const;
  59. virtual DWORD CalcCharacterStringSize();
  60. virtual BOOL CopyValue(
  61. OUT ostrstream &OutputStream
  62. );
  63. virtual BOOL InternalParseLine(
  64. IN OUT CHAR *&Line
  65. );
  66. virtual BOOL GetField(
  67. OUT SDP_FIELD *&Field,
  68. OUT BOOL &AddToArray
  69. );
  70. };
  71. inline SDP_OPTIONAL_BSTRING &
  72. SDP_MEDIA::GetName(
  73. )
  74. {
  75. return m_Name;
  76. }
  77. inline SDP_REQD_BSTRING_LINE &
  78. SDP_MEDIA::GetTitle(
  79. )
  80. {
  81. return m_Title;
  82. }
  83. inline SDP_USHORT &
  84. SDP_MEDIA::GetStartPort(
  85. )
  86. {
  87. return m_StartPort;
  88. }
  89. inline SDP_USHORT &
  90. SDP_MEDIA::GetNumPorts(
  91. )
  92. {
  93. return m_NumPorts;
  94. }
  95. inline SDP_OPTIONAL_BSTRING &
  96. SDP_MEDIA::GetProtocol(
  97. )
  98. {
  99. return m_TransportProtocol;
  100. }
  101. inline SDP_FORMAT_CODE_LIST &
  102. SDP_MEDIA::GetFormatCodeList(
  103. )
  104. {
  105. return m_FormatCodeList;
  106. }
  107. inline SDP_CONNECTION &
  108. SDP_MEDIA::GetConnection(
  109. )
  110. {
  111. return m_Connection;
  112. }
  113. inline SDP_BANDWIDTH &
  114. SDP_MEDIA::GetBandwidth(
  115. )
  116. {
  117. return m_Bandwidth;
  118. }
  119. inline SDP_ENCRYPTION_KEY &
  120. SDP_MEDIA::GetEncryptionKey(
  121. )
  122. {
  123. return m_EncryptionKey;
  124. }
  125. inline SDP_ATTRIBUTE_LIST &
  126. SDP_MEDIA::GetAttributeList(
  127. )
  128. {
  129. return m_AttributeList;
  130. }
  131. class _DllDecl SDP_MEDIA_LIST : public SDP_VALUE_LIST
  132. {
  133. public:
  134. inline SDP_MEDIA_LIST();
  135. inline void SetCharacterSet(
  136. IN SDP_CHARACTER_SET CharacterSet
  137. );
  138. protected:
  139. SDP_CHARACTER_SET m_CharacterSet;
  140. virtual SDP_VALUE *CreateElement();
  141. };
  142. inline
  143. SDP_MEDIA_LIST::SDP_MEDIA_LIST(
  144. )
  145. : m_CharacterSet(CS_ASCII)
  146. {
  147. }
  148. inline void
  149. SDP_MEDIA_LIST::SetCharacterSet(
  150. IN SDP_CHARACTER_SET CharacterSet
  151. )
  152. {
  153. m_CharacterSet = CharacterSet;
  154. }
  155. #endif // __SDP_MEDIA__