32 #ifndef OPAL_OPAL_MEDIAFMT_H
33 #define OPAL_OPAL_MEDIAFMT_H
43 #include <ptlib/bitwise_enum.h>
46 #include <ptlib/videoio.h>
91 void SetH225(H225_BandWidth & bw)
const;
136 const char * wildcard
137 ) { PConstString w(wildcard);
return operator+=(w); }
143 const PString & wildcard
192 const unsigned clockRate = 0,
193 const char * rtpEncodingName = NULL,
194 const char * protocol = NULL,
195 const_iterator start = const_iterator()
215 const PString & wildcard,
216 const_iterator start = const_iterator()
223 )
const {
return FindFormat(rtpPayloadType) != end(); }
231 const PString & wildcard
232 )
const {
return FindFormat(wildcard) != end(); }
238 bool mustBeTransportable =
true
261 const PStringArray & order
283 const PStringArray & mask
292 virtual PINDEX Append(PObject *) {
return P_MAX_INDEX; }
293 virtual PINDEX Insert(
const PObject &, PObject *) {
return P_MAX_INDEX; }
332 virtual Comparison
Compare(
const PObject & obj)
const;
367 void SetFMTP(
const char * name,
const char * dflt)
372 #define OPAL_SET_MEDIA_OPTION_FMTP(opt, name, dflt) (opt)->SetFMTP(name, dflt)
374 #define OPAL_SET_MEDIA_OPTION_FMTP(opt, name, dflt)
382 const char * dflt = NULL
408 #define OPAL_SET_MEDIA_OPTION_H245(opt, ...) (opt)->SetH245Generic(OpalMediaOption::H245GenericInfo(__VA_ARGS__))
410 #define OPAL_SET_MEDIA_OPTION_H245(opt, ...)
429 template <
typename T>
466 if (otherOption == NULL)
476 if (otherOption == NULL)
478 if (m_value < otherOption->
m_value)
480 if (m_value > otherOption->
m_value)
488 if (otherOption != NULL)
507 template <
typename T>
518 T minimum = std::numeric_limits<T>::min(),
519 T maximum = std::numeric_limits<T>::max()
521 :
BaseClass(name, readOnly, merge, value)
541 strm.setstate(ios::badbit);
580 operator double()
const {
return m_value; }
581 void operator&=(
double other) {
if (m_value > other) m_value = other; }
600 const char *
const * enumerations,
606 virtual PObject *
Clone()
const;
607 virtual void PrintOn(ostream & strm)
const;
608 virtual void ReadFrom(istream & strm);
639 const PString & value
642 virtual PObject *
Clone()
const;
643 virtual void PrintOn(ostream & strm)
const;
644 virtual void ReadFrom(istream & strm);
651 void SetValue(
const PString & value);
671 const PBYTEArray & value
681 virtual PObject *
Clone()
const;
682 virtual void PrintOn(ostream & strm)
const;
683 virtual void ReadFrom(istream & strm);
689 void SetValue(
const PBYTEArray & value);
690 void SetValue(
const BYTE * data, PINDEX length);
710 const char * fullName,
713 const char * encodingName,
724 virtual PObject *
Clone()
const;
725 virtual void PrintOn(ostream & strm)
const;
731 virtual bool GetOptionValue(
const PString & name, PString & value)
const;
732 virtual bool SetOptionValue(
const PString & name,
const PString & value);
737 virtual double GetOptionReal(
const PString & name,
double dflt)
const;
738 virtual bool SetOptionReal(
const PString & name,
double value);
739 virtual PINDEX
GetOptionEnum(
const PString & name, PINDEX dflt)
const;
740 virtual bool SetOptionEnum(
const PString & name, PINDEX value);
741 virtual PString
GetOptionString(
const PString & name,
const PString & dflt)
const;
742 virtual bool SetOptionString(
const PString & name,
const PString & value);
743 virtual bool GetOptionOctets(
const PString & name, PBYTEArray & octets)
const;
744 virtual bool SetOptionOctets(
const PString & name,
const PBYTEArray & octets);
745 virtual bool SetOptionOctets(
const PString & name,
const BYTE * data, PINDEX length);
759 PTRACE_PARAM(
const char * operation,)
824 const char * fullName,
827 const char * encodingName,
828 PBoolean needsJitter,
848 const char * rtpEncodingName = NULL,
849 const char * protocol = NULL
866 const char * wildcard
883 const PString & wildcard
897 const char * wildcard
904 const PString & wildcard
909 virtual PObject *
Clone()
const;
913 virtual Comparison
Compare(
const PObject & obj)
const;
919 virtual void PrintOn(ostream & strm)
const;
923 virtual void ReadFrom(istream & strm);
954 bool copyPayloadType =
false
1069 const PString & name,
1080 const PString & name,
1081 const PString & value
1088 const PString & name,
1099 const PString & name,
1107 const PString & name,
1119 const PString & name,
1127 const PString & name,
1138 const PString & name,
1149 template <
typename Enum>
1151 const PString & name,
1164 template <
typename Enum>
1166 const PString & name,
1174 const PString & name,
1175 const PString & dflt = PString::Empty()
1185 const PString & name,
1186 const PString & value
1193 const PString & name,
1204 const PString & name,
1205 const PBYTEArray & octets
1208 const PString & name,
1239 PBoolean overwrite =
false
1251 const PString & name
1258 const PString & name
1259 )
const {
return dynamic_cast<T *
>(
FindOption(name)); }
1274 strm << setw(-1) << *
m_info;
1282 PVideoDevice::OpenArgs & args
1310 PBoolean SetSize(PINDEX) {
return true; }
1327 const char * fullName,
1329 const char * encodingName,
1336 time_t timeStamp = 0
1338 virtual PObject *
Clone()
const;
1350 const char * fullName,
1352 const char * encodingName,
1357 unsigned maxFrames = 256,
1358 unsigned clockRate = 8000,
1359 time_t timeStamp = 0
1373 const char * fullName,
1375 const char * encodingName,
1376 unsigned maxFrameWidth,
1377 unsigned maxFrameHeight,
1378 unsigned maxFrameRate,
1379 unsigned maxBitRate,
1380 time_t timeStamp = 0
1382 virtual PObject *
Clone()
const;
1395 const char * fullName,
1397 const char * encodingName,
1398 unsigned maxFrameWidth,
1399 unsigned maxFrameHeight,
1400 unsigned maxFrameRate,
1401 unsigned maxBitRate,
1402 time_t timeStamp = 0
1435 __inline
static unsigned ContentRoleBit(ContentRole contentRole) {
return contentRole != eNoRole ? (1<<(contentRole-1)) : 0; }
1453 "",
"pli",
"fir",
"tmmbr",
"tstr",
"vcbm",
"nack",
"sli"
1511 #endif // OPAL_VIDEO
1515 #if OPAL_T38_CAPABILITY
1521 #define OpalPCM16 GetOpalPCM16()
1522 #define OpalPCM16S GetOpalPCM16S()
1523 #define OpalPCM16_16KHZ GetOpalPCM16_16KHZ()
1524 #define OpalPCM16S_16KHZ GetOpalPCM16S_16KHZ()
1525 #define OpalPCM16_32KHZ GetOpalPCM16_32KHZ()
1526 #define OpalPCM16S_32KHZ GetOpalPCM16S_32KHZ()
1527 #define OpalPCM16_48KHZ GetOpalPCM16_48KHZ()
1528 #define OpalPCM16S_48KHZ GetOpalPCM16S_48KHZ()
1529 #define OpalL16_MONO_8KHZ GetOpalL16_MONO_8KHZ()
1530 #define OpalL16_STEREO_8KHZ GetOpalL16_STEREO_8KHZ()
1531 #define OpalL16_MONO_16KHZ GetOpalL16_MONO_16KHZ()
1532 #define OpalL16_STEREO_16KHZ GetOpalL16_STEREO_16KHZ()
1533 #define OpalL16_MONO_32KHZ GetOpalL16_MONO_32KHZ()
1534 #define OpalL16_STEREO_32KHZ GetOpalL16_STEREO_32KHZ()
1535 #define OpalL16_MONO_48KHZ GetOpalL16_MONO_48KHZ()
1536 #define OpalL16_STEREO_48KHZ GetOpalL16_STEREO_48KHZ()
1537 #define OpalG711_ULAW_64K GetOpalG711_ULAW_64K()
1538 #define OpalG711_ALAW_64K GetOpalG711_ALAW_64K()
1539 #define OpalG722 GetOpalG722()
1540 #define OpalG7221 OpalG7221_32K
1541 #define OpalG7221_24K GetOpalG7221_24K()
1542 #define OpalG7221_32K GetOpalG7221_32K()
1543 #define OpalG7221_48K GetOpalG7221_48K()
1544 #define OpalG7222 GetOpalG7222()
1545 #define OpalG726_40K GetOpalG726_40K()
1546 #define OpalG726_32K GetOpalG726_32K()
1547 #define OpalG726_24K GetOpalG726_24K()
1548 #define OpalG726_16K GetOpalG726_16K()
1549 #define OpalG728 GetOpalG728()
1550 #define OpalG729 GetOpalG729()
1551 #define OpalG729A GetOpalG729A()
1552 #define OpalG729B GetOpalG729B()
1553 #define OpalG729AB GetOpalG729AB()
1554 #define OpalG7231_6k3 GetOpalG7231_6k3()
1555 #define OpalG7231_5k3 GetOpalG7231_5k3()
1556 #define OpalG7231A_6k3 GetOpalG7231A_6k3()
1557 #define OpalG7231A_5k3 GetOpalG7231A_5k3()
1558 #define OpalGSM0610 GetOpalGSM0610()
1559 #define OpalGSMAMR GetOpalGSMAMR()
1560 #define OpaliLBC GetOpaliLBC()
1561 #define OpalRFC2833 GetOpalRFC2833()
1562 #define OpalCiscoNSE GetOpalCiscoNSE()
1563 #define OpalT38 GetOpalT38()
1566 #define OpalH261 GetOpalH261()
1567 #define OpalH263 GetOpalH263()
1568 #define OpalH263plus GetOpalH263plus()
1569 #define OpalH264 GetOpalH264_MODE1()
1570 #define OpalH264_MODE0 GetOpalH264_MODE0()
1571 #define OpalH264_MODE1 GetOpalH264_MODE1()
1572 #define OpalMPEG4 GetOpalMPEG4()
1575 #define OpalL16Mono8kHz OpalL16_MONO_8KHZ
1576 #define OpalL16Mono16kHz OpalL16_MONO_16KHZ
1577 #define OpalG711uLaw OpalG711_ULAW_64K
1578 #define OpalG711ALaw OpalG711_ALAW_64K
1581 #endif // OPAL_OPAL_MEDIAFMT_H