28 #ifndef OPAL_OPAL_MEDIAFMT_H
29 #define OPAL_OPAL_MEDIAFMT_H
39 #include <ptlib/bitwise_enum.h>
42 #include <ptlib/videoio.h>
86 virtual Comparison
Compare(
const PObject & other)
const;
87 virtual void PrintOn(std::ostream & strm)
const;
88 virtual void ReadFrom(std::istream & strm);
93 void SetH225(H225_BandWidth & bw)
const;
94 void SetH245(PASN_Integer & bitRate)
const;
95 void FromH245(
const PASN_Integer & bitRate);
139 const char * wildcard
140 ) { PConstString w(wildcard);
return operator+=(w); }
146 const PString & wildcard
195 const unsigned clockRate = 0,
196 const char * rtpEncodingName = NULL,
197 const char * protocol = NULL,
198 const_iterator start = const_iterator()
218 const PString & wildcard,
219 const_iterator start = const_iterator()
226 )
const {
return FindFormat(rtpPayloadType) != end(); }
234 const PString & wildcard
235 )
const {
return FindFormat(wildcard) != end(); }
241 bool mustBeTransportable =
true
264 const PStringArray & order
286 const PStringArray & mask
303 virtual PINDEX Append(PObject *) {
return P_MAX_INDEX; }
304 virtual PINDEX Insert(
const PObject &, PObject *) {
return P_MAX_INDEX; }
343 virtual Comparison
Compare(
const PObject & obj)
const;
372 const PString & GetFMTPName()
const {
return m_FMTPName; }
373 void SetFMTPName(
const char * name) { m_FMTPName = name; }
375 const PString & GetFMTPDefault()
const {
return m_FMTPDefault; }
376 void SetFMTPDefault(
const char * value) { m_FMTPDefault = value; }
378 void SetFMTP(
const char * name,
const char * dflt)
381 m_FMTPDefault = dflt;
383 #define OPAL_SET_MEDIA_OPTION_FMTP(opt, name, dflt) (opt)->SetFMTP(name, dflt)
385 #define OPAL_SET_MEDIA_OPTION_FMTP(opt, name, dflt)
393 const char * dflt = NULL
419 #define OPAL_SET_MEDIA_OPTION_H245(opt, ...) (opt)->SetH245Generic(OpalMediaOption::H245GenericInfo(__VA_ARGS__))
421 #define OPAL_SET_MEDIA_OPTION_H245(opt, ...)
430 PCaselessString m_FMTPName;
431 PString m_FMTPDefault;
440 template <
typename T>
477 if (otherOption == NULL)
487 if (otherOption == NULL)
489 if (m_value < otherOption->
m_value)
491 if (m_value > otherOption->
m_value)
499 if (otherOption != NULL)
518 template <
typename T>
529 T minimum = std::numeric_limits<T>::min(),
530 T maximum = std::numeric_limits<T>::max()
532 :
BaseClass(name, readOnly, merge, value)
552 strm.setstate(ios::badbit);
591 operator double()
const {
return m_value; }
592 void operator&=(
double other) {
if (m_value > other) m_value = other; }
611 const char *
const * enumerations,
617 virtual PObject *
Clone()
const;
618 virtual void PrintOn(ostream & strm)
const;
619 virtual void ReadFrom(istream & strm);
651 const PString & value
654 virtual PObject *
Clone()
const;
655 virtual void PrintOn(ostream & strm)
const;
656 virtual void ReadFrom(istream & strm);
663 void SetValue(
const PString & value);
683 const PBYTEArray & value
693 virtual PObject *
Clone()
const;
694 virtual void PrintOn(ostream & strm)
const;
695 virtual void ReadFrom(istream & strm);
701 void SetValue(
const PBYTEArray & value);
702 void SetValue(
const BYTE * data, PINDEX length);
722 const char * fullName,
725 const char * encodingName,
731 time_t timeStamp = 0,
732 bool allowMultiple =
false
737 virtual PObject *
Clone()
const;
738 virtual void PrintOn(ostream & strm)
const;
744 virtual bool GetOptionValue(
const PString & name, PString & value)
const;
745 virtual bool SetOptionValue(
const PString & name,
const PString & value);
750 virtual double GetOptionReal(
const PString & name,
double dflt)
const;
751 virtual bool SetOptionReal(
const PString & name,
double value);
752 virtual PINDEX
GetOptionEnum(
const PString & name, PINDEX dflt)
const;
753 virtual bool SetOptionEnum(
const PString & name, PINDEX value);
754 virtual PString
GetOptionString(
const PString & name,
const PString & dflt)
const;
755 virtual bool SetOptionString(
const PString & name,
const PString & value);
756 virtual bool GetOptionOctets(
const PString & name, PBYTEArray & octets)
const;
757 virtual bool SetOptionOctets(
const PString & name,
const PBYTEArray & octets);
758 virtual bool SetOptionOctets(
const PString & name,
const BYTE * data, PINDEX length);
774 PTRACE_PARAM(
const char * operation,)
842 const char * fullName,
845 const char * encodingName,
846 PBoolean needsJitter,
851 time_t timeStamp = 0,
852 bool allowMultiple =
false
867 const char * rtpEncodingName = NULL,
868 const char * protocol = NULL
885 const char * wildcard
902 const PString & wildcard
916 const char * wildcard
923 const PString & wildcard
928 virtual PObject *
Clone()
const;
932 virtual Comparison
Compare(
const PObject & obj)
const;
938 virtual void PrintOn(ostream & strm)
const;
942 virtual void ReadFrom(istream & strm);
973 bool copyPayloadType =
false
1092 "",
"pli",
"fir",
"tmmbr",
"tstr",
"vcbm",
"nack",
"sli",
"remb"
1111 )
const { PWaitAndSignal m(m_mutex);
return m_info->
options[index]; }
1118 const PString & name,
1129 const PString & name,
1130 const PString & value
1137 const PString & name,
1148 const PString & name,
1156 const PString & name,
1168 const PString & name,
1176 const PString & name,
1184 const PString & name,
1195 const PString & name,
1206 template <
typename Enum>
1208 const PString & name,
1221 template <
typename Enum>
1223 const PString & name,
1231 const PString & name,
1232 const PString & dflt = PString::Empty()
1242 const PString & name,
1243 const PString & value
1250 const PString & name,
1261 const PString & name,
1262 const PBYTEArray & octets
1265 const PString & name,
1284 const PString & name = PString::Empty()
1298 const PString & wildcard
1306 PBoolean overwrite =
false
1318 const PString & name
1325 const PString & name
1326 )
const {
return dynamic_cast<T *
>(
FindOption(name)); }
1339 PWaitAndSignal m(m_mutex);
1341 strm << setw(-1) << *
m_info;
1349 PVideoDevice::OpenArgs & args
1377 PBoolean SetSize(PINDEX) {
return true; }
1402 bool dynamic =
false
1405 const char * fullName
1408 const char * fullName,
1410 const char * encodingName,
1415 unsigned maxFrames = 256,
1416 unsigned clockRate = 8000,
1417 time_t timeStamp = 0,
1418 unsigned channels = 1
1428 static const PString & MinPacketTimeOption();
1429 static const PString & MaxPacketTimeOption();
1430 static const PString & SilenceSuppressionOption();
1446 virtual FrameType
GetFrameType(
const BYTE * rtp, PINDEX size,
unsigned sampleRate) = 0;
1458 const char * fullName,
1460 const char * encodingName,
1467 time_t timeStamp = 0,
1468 unsigned channels = 1
1470 virtual PObject *
Clone()
const;
1488 bool dynamic =
false
1491 const char * fullName
1494 const char * fullName,
1496 const char * encodingName,
1497 unsigned maxFrameWidth,
1498 unsigned maxFrameHeight,
1499 unsigned maxFrameRate,
1500 unsigned maxBitRate,
1501 time_t timeStamp = 0
1537 __inline
static unsigned ContentRoleBit(ContentRole contentRole) {
return contentRole != eNoRole ? (1<<(contentRole-1)) : 0; }
1544 ImageAttrSuppressed,
1546 ImageAttrAnswerRequired
1549 static const PString & UseImageAttributeInSDP();
1577 const char * fullName,
1579 const char * encodingName,
1580 unsigned maxFrameWidth,
1581 unsigned maxFrameHeight,
1582 unsigned maxFrameRate,
1583 unsigned maxBitRate,
1584 time_t timeStamp = 0
1586 virtual PObject *
Clone()
const;
1592 #endif // OPAL_VIDEO
1614 template <
class MEDIA_FORMAT>
1639 template <
class MEDIA_FORMAT,
class H323_CAPABILITY>
1647 static H323CapabilityFactory::Worker<H323_CAPABILITY> capability(this->
m_mediaFormat->GetName(),
true);
1723 #endif // OPAL_VIDEO
1727 #if OPAL_T38_CAPABILITY
1733 #define OpalPCM16 GetOpalPCM16()
1734 #define OpalPCM16S GetOpalPCM16S()
1735 #define OpalPCM16_12KHZ GetOpalPCM16_12KHZ()
1736 #define OpalPCM16S_12KHZ GetOpalPCM16S_12KHZ()
1737 #define OpalPCM16_16KHZ GetOpalPCM16_16KHZ()
1738 #define OpalPCM16S_16KHZ GetOpalPCM16S_16KHZ()
1739 #define OpalPCM16_24KHZ GetOpalPCM16_24KHZ()
1740 #define OpalPCM16S_24KHZ GetOpalPCM16S_24KHZ()
1741 #define OpalPCM16_32KHZ GetOpalPCM16_32KHZ()
1742 #define OpalPCM16S_32KHZ GetOpalPCM16S_32KHZ()
1743 #define OpalPCM16_48KHZ GetOpalPCM16_48KHZ()
1744 #define OpalPCM16S_48KHZ GetOpalPCM16S_48KHZ()
1745 #define OpalL16_MONO_8KHZ GetOpalL16_MONO_8KHZ()
1746 #define OpalL16_STEREO_8KHZ GetOpalL16_STEREO_8KHZ()
1747 #define OpalL16_MONO_16KHZ GetOpalL16_MONO_16KHZ()
1748 #define OpalL16_STEREO_16KHZ GetOpalL16_STEREO_16KHZ()
1749 #define OpalL16_MONO_32KHZ GetOpalL16_MONO_32KHZ()
1750 #define OpalL16_STEREO_32KHZ GetOpalL16_STEREO_32KHZ()
1751 #define OpalL16_MONO_48KHZ GetOpalL16_MONO_48KHZ()
1752 #define OpalL16_STEREO_48KHZ GetOpalL16_STEREO_48KHZ()
1753 #define OpalG711_ULAW_64K GetOpalG711_ULAW_64K()
1754 #define OpalG711_ALAW_64K GetOpalG711_ALAW_64K()
1755 #define OpalG722 GetOpalG722()
1756 #define OpalG7221 OpalG7221_32K
1757 #define OpalG7221_24K GetOpalG7221_24K()
1758 #define OpalG7221_32K GetOpalG7221_32K()
1759 #define OpalG7221C_24K GetOpalG7221C_24K()
1760 #define OpalG7221C_32K GetOpalG7221C_32K()
1761 #define OpalG7221C_48K GetOpalG7221C_48K()
1762 #define OpalG7222 GetOpalG7222()
1763 #define OpalG726_40K GetOpalG726_40K()
1764 #define OpalG726_32K GetOpalG726_32K()
1765 #define OpalG726_24K GetOpalG726_24K()
1766 #define OpalG726_16K GetOpalG726_16K()
1767 #define OpalG728 GetOpalG728()
1768 #define OpalG729 GetOpalG729()
1769 #define OpalG729A GetOpalG729A()
1770 #define OpalG729B GetOpalG729B()
1771 #define OpalG729AB GetOpalG729AB()
1772 #define OpalG7231_6k3 GetOpalG7231_6k3()
1773 #define OpalG7231_5k3 GetOpalG7231_5k3()
1774 #define OpalG7231A_6k3 GetOpalG7231A_6k3()
1775 #define OpalG7231A_5k3 GetOpalG7231A_5k3()
1776 #define OpalG7231_Cisco_A GetOpalG7231_Cisco_A()
1777 #define OpalG7231_Cisco_AR GetOpalG7231_Cisco_AR()
1778 #define OpalGSM0610 GetOpalGSM0610()
1779 #define OpalGSMAMR GetOpalGSMAMR()
1780 #define OpaliLBC GetOpaliLBC()
1781 #define OpalSpeexNB GetOpalSpeexNB()
1782 #define OpalSpeexWB GetOpalSpeexWB()
1783 #define OpalOpus8 GetOpalOpus8()
1784 #define OpalOpus8S GetOpalOpus8S()
1785 #define OpalOpus12 GetOpalOpus12()
1786 #define OpalOpus12S GetOpalOpus12S()
1787 #define OpalOpus16 GetOpalOpus16()
1788 #define OpalOpus16S GetOpalOpus16S()
1789 #define OpalOpus24 GetOpalOpus24()
1790 #define OpalOpus24S GetOpalOpus24S()
1791 #define OpalOpus48 GetOpalOpus48()
1792 #define OpalOpus48S GetOpalOpus48S()
1794 #define OpalRFC2833 GetOpalRFC2833()
1795 #define OpalCiscoNSE GetOpalCiscoNSE()
1796 #define OpalT38 GetOpalT38()
1799 #define OpalH261 GetOpalH261()
1800 #define OpalH263 GetOpalH263()
1801 #define OpalH263plus GetOpalH263plus()
1802 #define OpalH264 GetOpalH264_MODE1()
1803 #define OpalH264_MODE0 GetOpalH264_MODE0()
1804 #define OpalH264_MODE1 GetOpalH264_MODE1()
1805 #define OpalMPEG4 GetOpalMPEG4()
1806 #define OpalVP8 GetOpalVP8()
1809 #define OpalL16Mono8kHz OpalL16_MONO_8KHZ
1810 #define OpalL16Mono16kHz OpalL16_MONO_16KHZ
1811 #define OpalG711uLaw OpalG711_ULAW_64K
1812 #define OpalG711ALaw OpalG711_ALAW_64K
1815 #endif // OPAL_OPAL_MEDIAFMT_H
Definition: opalplugin.hpp:380
unsigned int_type
Definition: mediafmt.h:72
PString GetName(const OpalMediaType &mediaType)
void SetH225(H225_BandWidth &bw) const
virtual Comparison Compare(const PObject &other) const
Definition: h323caps.h:95
__inline OpalBandwidth & operator-=(const OpalBandwidth &bw)
Definition: mediafmt.h:83
static OpalBandwidth Max()
Definition: mediafmt.h:99
__inline OpalBandwidth operator+(const OpalBandwidth &bw) const
Definition: mediafmt.h:80
Definition: mediafmt.h:66
PayloadTypes
Definition: rtp.h:556
Definition: mediafmt.h:60
unsigned kbps() const
Definition: mediafmt.h:97
virtual void PrintOn(std::ostream &strm) const
Direction
Definition: mediafmt.h:64
PLIST(H323LogicalChannelList, H323Channel)
virtual void ReadFrom(std::istream &strm)
OpalMediaFormat GetMediaFormat(const OpalMediaType &mediaType)
__inline OpalBandwidth operator-(const OpalBandwidth &bw) const
Definition: mediafmt.h:81
__inline OpalBandwidth & operator=(int_type bps)
Definition: mediafmt.h:75
void FromH245(const PASN_Integer &bitRate)
__inline OpalBandwidth(int_type bps=0)
Definition: mediafmt.h:74
friend std::ostream & operator<<(std::ostream &strm, OpalBandwidth::Direction dir)
void SetH245(PASN_Integer &bitRate) const
__inline OpalBandwidth & operator+=(const OpalBandwidth &bw)
Definition: mediafmt.h:82
Definition: mediafmt.h:67
const PString & AssociatedPayloadTypeOption()
const PCaselessString & EncodingName()
__inline OpalBandwidth & operator&=(const OpalBandwidth &bw)
Definition: mediafmt.h:84
int_type m_bps
Definition: mediafmt.h:102
const PString & RetransmitTimeOption()
Definition: mediafmt.h:68
Definition: mediafmt.h:65