27 #ifndef OPAL_OPAL_MEDIATYPE_H
28 #define OPAL_OPAL_MEDIATYPE_H
32 #include <ptlib/pfactory.h>
33 #include <ptlib/bitwise_enum.h>
58 virtual void PrintOn(ostream & strm)
const;
76 : std::string(str) { }
79 : std::string(str) { }
82 : std::string((const char *)str) { }
88 #if OPAL_T38_CAPABILITY
103 (OfferInactive, Receive, Transmit, DontOffer),
104 ReceiveTransmit = Receive|Transmit,
105 TransmitReceive = Receive|Transmit);
109 class AutoStartMap :
public std::map<OpalMediaType, OpalMediaType::AutoStartMode>
114 bool Add(
const PString & stringOption);
115 bool Add(
const PCaselessString & mediaTypeName,
const PCaselessString & modeName);
129 return strm << mediaType.c_str();
132 ostream &
operator<<(ostream & strm, OpalMediaType::AutoStartMode mode);
140 class SDPMediaDescription;
152 const char * mediaType,
153 const char * mediaSession,
154 unsigned defaultSessionId = 0,
155 OpalMediaType::AutoStartMode autoStart = OpalMediaType::DontOffer
172 void SetAutoStart(OpalMediaType::AutoStartMode v,
bool on);
183 virtual PString GetSDPMediaType()
const;
184 virtual PString GetSDPTransportType()
const;
187 virtual bool MatchesSDP(
188 const PCaselessString & sdpMediaType,
189 const PCaselessString & sdpTransport,
190 const PStringArray & sdpLines,
195 virtual SDPMediaDescription * CreateSDPMediaDescription(
216 #define OPAL_INSTANTIATE_MEDIATYPE2(cls, name) \
217 PFACTORY_CREATE(OpalMediaTypesFactory, cls, name, true)
219 #define OPAL_INSTANTIATE_MEDIATYPE(cls) \
220 OPAL_INSTANTIATE_MEDIATYPE2(cls, cls::Name())
222 #define OPAL_MEDIATYPE(clsBase) \
223 OPAL_INSTANTIATE_MEDIATYPE2(clsBase##Definition, clsBase##Definition::Name()); \
224 const OpalMediaType & clsBase##Type() { static OpalMediaType t(clsBase##Definition::Name()); return t; }
227 template <const
char * Type,
unsigned SessionId = 0>
231 static const char *
Name() {
return Type; }
238 #define OPAL_INSTANTIATE_SIMPLE_MEDIATYPE(cls, name, ...) \
239 namespace OpalMediaTypeSpace { extern const char cls[] = name; }; \
240 typedef SimpleMediaType<OpalMediaTypeSpace::cls, ##__VA_ARGS__> cls; \
241 OPAL_INSTANTIATE_MEDIATYPE(cls) \
253 const char * mediaType,
254 unsigned defaultSessionId = 0,
255 OpalMediaType::AutoStartMode autoStart = OpalMediaType::DontOffer
259 virtual bool MatchesSDP(
const PCaselessString &,
const PCaselessString &,
const PStringArray &, PINDEX);
267 static const char *
Name();
282 static const char *
Name();
297 static const char *
Name();
304 #if OPAL_T38_CAPABILITY
309 static const char * Name();
310 static const PCaselessString & UDPTL();
312 OpalFaxMediaDefinition();
315 virtual PString GetSDPMediaType()
const;
316 virtual PString GetSDPTransportType()
const;
318 SDPMediaDescription * CreateSDPMediaDescription(
324 #endif // OPAL_T38_CAPABILITY
330 #endif // OPAL_OPAL_MEDIATYPE_H
ostream & operator<<(ostream &strm, OpalSilenceDetector::Mode mode)
Definition: connection.h:415
Definition: transports.h:151