# mediafmt.h

Go to the documentation of this file.

    00001 /*
    00002  * mediafmt.h
    00003  *
    00004  * Media Format descriptions
    00005  *
    00006  * Open Phone Abstraction Library (OPAL)
    00007  * Formally known as the Open H323 project.
    00008  *
    00009  * Copyright (c) 2001 Equivalence Pty. Ltd.
    00010  *
    00011  * The contents of this file are subject to the Mozilla Public License
    00012  * Version 1.0 (the "License"); you may not use this file except in
    00013  * compliance with the License. You may obtain a copy of the License at
    00014  * http://www.mozilla.org/MPL/
    00015  *
    00016  * Software distributed under the License is distributed on an "AS IS"
    00017  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
    00018  * the License for the specific language governing rights and limitations
    00019  * under the License.
    00020  *
    00021  * The Original Code is Open H323 Library.
    00022  *
    00023  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
    00024  *
    00025  * Contributor(s): ______________________________________.
    00026  *
    00027  * $Revision: 27856 $
    00028  * $Author: rjongbloed $
    00029  * $Date: 2012-06-18 21:51:57 -0500 (Mon, 18 Jun 2012) $
    00030  */
    00031
    00032 #ifndef OPAL_OPAL_MEDIAFMT_H
    00033 #define OPAL_OPAL_MEDIAFMT_H
    00034
    00035 #ifdef P_USE_PRAGMA
    00036 #pragma interface
    00037 #endif
    00038
    00039 #ifdef _MSC_VER
    00040 #if _MSC_VER < 1300
    00041 #pragma warning(disable:4663)
    00042 #endif
    00043 #endif
    00044
    00045 #include <opal/buildopts.h>
    00046
    00047 #include <opal/mediatype.h>
    00048 #include <rtp/rtp.h>
    00049
    00050 #if OPAL_VIDEO
    00051 #include <ptlib/videoio.h>
    00052 #endif
    00053
    00054 #include <limits>
    00055
    00056 #ifdef min
    00057 #undef min
    00058 #endif
    00059 #ifdef max
    00060 #undef max
    00061 #endif
    00062
    00063 class OpalMediaFormat;
    00064
    00065
    00067
    00068 PLIST(OpalMediaFormatBaseList, OpalMediaFormat);
    00069
    00072 class OpalMediaFormatList : public OpalMediaFormatBaseList
    00073 {
    00074   PCLASSINFO(OpalMediaFormatList, OpalMediaFormatBaseList);
    00075   public:
    00080     OpalMediaFormatList();
    00081
    00084     OpalMediaFormatList(
    00085       const OpalMediaFormat & format
    00086     );
    00087
    00090     OpalMediaFormatList(const OpalMediaFormatList & l) : OpalMediaFormatBaseList(l) { }
    00092
    00098     OpalMediaFormatList & operator+=(
    00099       const char * wildcard
    00100     ) { PConstString s(wildcard); return operator+=(s); }
    00101
    00105     OpalMediaFormatList & operator+=(
    00106       const PString & wildcard
    00107     );
    00108
    00112     OpalMediaFormatList & operator+=(
    00113       const OpalMediaFormat & format
    00114     );
    00115
    00119     OpalMediaFormatList & operator+=(
    00120       const OpalMediaFormatList & formats
    00121     );
    00122
    00126     OpalMediaFormatList & operator-=(
    00127       const OpalMediaFormat & format
    00128     );
    00129
    00133     OpalMediaFormatList & operator-=(
    00134       const OpalMediaFormatList & formats
    00135     );
    00136
    00142     const_iterator FindFormat(
    00143       RTP_DataFrame::PayloadTypes rtpPayloadType,
    00144       const unsigned clockRate,
    00145       const char * rtpEncodingName = NULL,
    00146       const char * protocol = NULL,
    00147       const_iterator start = const_iterator()
    00148     ) const;
    00149
    00166     const_iterator FindFormat(
    00167       const PString & wildcard,
    00168       const_iterator start = const_iterator()
    00169     ) const;
    00170
    00173     PBoolean HasFormat(
    00174       RTP_DataFrame::PayloadTypes rtpPayloadType
    00175     ) const { return FindFormat(rtpPayloadType) != end(); }
    00176
    00182     PBoolean HasFormat(
    00183       const PString & wildcard
    00184     ) const { return FindFormat(wildcard) != end(); }
    00185
    00204     void Remove(
    00205       const PStringArray & mask
    00206     );
    00207
    00223     void Reorder(
    00224       const PStringArray & order
    00225     );
    00226
    00229     bool HasType(
    00230       const OpalMediaType & type,
    00231       bool mustBeTransportable = true
    00232     ) const;
    00234
    00235   private:
    00236     virtual PINDEX Append(PObject *) { return P_MAX_INDEX; }
    00237     virtual PINDEX Insert(const PObject &, PObject *) { return P_MAX_INDEX; }
    00238     virtual PINDEX InsertAt(PINDEX, PObject *) { return P_MAX_INDEX; }
    00239     virtual PBoolean SetAt(PINDEX, PObject *) { return false; }
    00240 };
    00241
    00242
    00244
    00247 class OpalMediaOption : public PObject
    00248 {
    00249     PCLASSINFO(OpalMediaOption, PObject);
    00250   public:
    00251     // Note the below enum must be identical to PluginCodec_OptionMerge in opalplugin.h
    00252     enum MergeType {
    00253       NoMerge,
    00254       MinMerge,
    00255       MaxMerge,
    00256       EqualMerge,
    00257       NotEqualMerge,
    00258       AlwaysMerge,
    00259       CustomMerge,
    00260       IntersectionMerge, // Set intersection, applies to numeric (bit wise AND) or string (common substrings)
    00261
    00262       // Synonyms
    00263       AndMerge = MinMerge,  // Applies to Boolean option or Enum with two elements
    00264       OrMerge  = MaxMerge   // Applies to Boolean option or Enum with two elements
    00265     };
    00266
    00267   protected:
    00268     OpalMediaOption(
    00269       const PString & name
    00270     );
    00271     OpalMediaOption(
    00272       const char * name,
    00273       bool readOnly,
    00274       MergeType merge
    00275     );
    00276
    00277   public:
    00278     virtual Comparison Compare(const PObject & obj) const;
    00279
    00280     virtual bool Merge(
    00281       const OpalMediaOption & option
    00282     );
    00283
    00284     virtual bool ValidateMerge(
    00285       const OpalMediaOption & option
    00286     ) const;
    00287
    00288     virtual Comparison CompareValue(
    00289       const OpalMediaOption & option
    00290     ) const = 0;
    00291     virtual void Assign(
    00292       const OpalMediaOption & option
    00293     ) = 0;
    00294
    00295     PString AsString() const;
    00296     bool FromString(const PString & value);
    00297
    00298     const PString & GetName() const { return m_name; }
    00299
    00300     bool IsReadOnly() const { return m_readOnly; }
    00301     void SetReadOnly(bool readOnly) { m_readOnly = readOnly; }
    00302
    00303     MergeType GetMerge() const { return m_merge; }
    00304     void SetMerge(MergeType merge) { m_merge = merge; }
    00305
    00306 #if OPAL_SIP
    00307     const PString & GetFMTPName() const { return m_FMTPName; }
    00308     void SetFMTPName(const char * name) { m_FMTPName = name; }
    00309
    00310     const PString & GetFMTPDefault() const { return m_FMTPDefault; }
    00311     void SetFMTPDefault(const char * value) { m_FMTPDefault = value; }
    00312 #endif // OPAL_SIP
    00313
    00314 #if OPAL_H323
    00315     struct H245GenericInfo {
    00316       H245GenericInfo()
    00317         : ordinal(0)
    00318         , mode(None)
    00319         , integerType(UnsignedInt)
    00320         , excludeTCS(false)
    00321         , excludeOLC(false)
    00322         , excludeReqMode(false)
    00323         , position(-1)
    00324       { }
    00325
    00326       unsigned ordinal;
    00327
    00328       enum Modes {
    00329         None,
    00330         Collapsing,
    00331         NonCollapsing
    00332       } mode;
    00333
    00334       enum IntegerTypes {
    00335         UnsignedInt,
    00336         Unsigned32,
    00337         BooleanArray
    00338       } integerType;
    00339
    00340       bool    excludeTCS;
    00341       bool    excludeOLC;
    00342       bool    excludeReqMode;
    00343       int     position;     // Position in sequence for parameter
    00344       PString defaultValue; // Do not include parameter if this value
    00345     };
    00346
    00347     const H245GenericInfo & GetH245Generic() const { return m_H245Generic; }
    00348     void SetH245Generic(const H245GenericInfo & genericInfo) { m_H245Generic = genericInfo; }
    00349 #endif // OPAL_H323
    00350
    00351   protected:
    00352     PCaselessString m_name;
    00353     bool            m_readOnly;
    00354     MergeType       m_merge;
    00355
    00356 #if OPAL_SIP
    00357     PCaselessString m_FMTPName;
    00358     PString         m_FMTPDefault;
    00359 #endif // OPAL_SIP
    00360
    00361 #if OPAL_H323
    00362     H245GenericInfo m_H245Generic;
    00363 #endif // OPAL_H323
    00364 };
    00365
    00366
    00367 template <typename T>
    00368 class OpalMediaOptionValue : public OpalMediaOption
    00369 {
    00370     PCLASSINFO(OpalMediaOptionValue, OpalMediaOption);
    00371   public:
    00372     OpalMediaOptionValue(
    00373       const char * name,
    00374       bool readOnly,
    00375       OpalMediaOption::MergeType merge = OpalMediaOption::MinMerge,
    00376       T value = T()
    00377     )
    00378       : OpalMediaOption(name, readOnly, merge)
    00379       , m_value(value)
    00380     {
    00381     }
    00382
    00383     virtual PObject * Clone() const
    00384     {
    00385       return new OpalMediaOptionValue(*this);
    00386     }
    00387
    00388     virtual void PrintOn(ostream & strm) const
    00389     {
    00390       strm << m_value;
    00391     }
    00392
    00393     virtual void ReadFrom(istream & strm)
    00394     {
    00395       strm >> m_value;
    00396     }
    00397
    00398     virtual bool Merge(const OpalMediaOption & option)
    00399     {
    00400       if (m_merge != IntersectionMerge)
    00401         return OpalMediaOption::Merge(option);
    00402
    00403       const OpalMediaOptionValue * otherOption = PDownCast(const OpalMediaOptionValue, &option);
    00404       if (otherOption == NULL)
    00405         return false;
    00406
    00407       m_value &= otherOption->m_value;
    00408       return true;
    00409     }
    00410
    00411     virtual Comparison CompareValue(const OpalMediaOption & option) const
    00412     {
    00413       const OpalMediaOptionValue * otherOption = PDownCast(const OpalMediaOptionValue, &option);
    00414       if (otherOption == NULL)
    00415         return GreaterThan;
    00416       if (m_value < otherOption->m_value)
    00417         return LessThan;
    00418       if (m_value > otherOption->m_value)
    00419         return GreaterThan;
    00420       return EqualTo;
    00421     }
    00422
    00423     virtual void Assign(const OpalMediaOption & option)
    00424     {
    00425       const OpalMediaOptionValue * otherOption = PDownCast(const OpalMediaOptionValue, &option);
    00426       if (otherOption != NULL)
    00427         m_value = otherOption->m_value;
    00428     }
    00429
    00430     T GetValue() const
    00431     {
    00432       return m_value;
    00433     }
    00434
    00435     void SetValue(T value)
    00436     {
    00437       m_value = value;
    00438     }
    00439
    00440   protected:
    00441     T m_value;
    00442 };
    00443
    00444
    00445 template <typename T>
    00446 class OpalMediaOptionNumericalValue : public OpalMediaOptionValue<T>
    00447 {
    00448     typedef OpalMediaOptionValue<T> BaseClass;
    00449     PCLASSINFO(OpalMediaOptionNumericalValue, BaseClass);
    00450   public:
    00451     OpalMediaOptionNumericalValue(
    00452       const char * name,
    00453       bool readOnly,
    00454       OpalMediaOption::MergeType merge = OpalMediaOption::MinMerge,
    00455       T value = 0,
    00456       T minimum = std::numeric_limits<T>::min(),
    00457       T maximum = std::numeric_limits<T>::max()
    00458     )
    00459       : BaseClass(name, readOnly, merge, value)
    00460       , m_minimum(minimum)
    00461       , m_maximum(maximum)
    00462     {
    00463     }
    00464
    00465     virtual PObject * Clone() const
    00466     {
    00467       return new OpalMediaOptionNumericalValue(*this);
    00468     }
    00469
    00470     virtual void ReadFrom(istream & strm)
    00471     {
    00472       T temp = 0;
    00473       strm >> temp;
    00474       if (strm.fail())
    00475         return;
    00476       if (temp >= m_minimum && temp <= m_maximum)
    00477         this->m_value = temp;
    00478       else
    00479         strm.setstate(ios::badbit);
    00480     }
    00481
    00482     void SetValue(T value)
    00483     {
    00484       if (value < m_minimum)
    00485         this->m_value = m_minimum;
    00486       else if (value > m_maximum)
    00487         this->m_value = m_maximum;
    00488       else
    00489         this->m_value = value;
    00490     }
    00491
    00492     void SetMinimum(T m)
    00493     {
    00494       this->m_minimum = m;
    00495     }
    00496
    00497     void SetMaximum(T m)
    00498     {
    00499       this->m_maximum = m;
    00500     }
    00501
    00502   protected:
    00503     T m_minimum;
    00504     T m_maximum;
    00505 };
    00506
    00507
    00508 typedef OpalMediaOptionNumericalValue<bool>     OpalMediaOptionBoolean;
    00509 typedef OpalMediaOptionNumericalValue<int>      OpalMediaOptionInteger;
    00510 typedef OpalMediaOptionNumericalValue<unsigned> OpalMediaOptionUnsigned;
    00511
    00512 // Wrapper class so we can implement intersection (&= operator) for floating point
    00513 class OpalMediaOptionRealValue
    00514 {
    00515     double m_value;
    00516   public:
    00517     OpalMediaOptionRealValue(double value = 0) : m_value(value) { }
    00518     operator double() const { return m_value; }
    00519     void operator&=(double other) { if (m_value > other) m_value = other; }
    00520     friend ostream & operator<<(ostream & strm, const OpalMediaOptionRealValue & value) { return strm << value.m_value; }
    00521     friend istream & operator>>(istream & strm,       OpalMediaOptionRealValue & value) { return strm >> value.m_value; }
    00522 };
    00523
    00524 typedef OpalMediaOptionNumericalValue<OpalMediaOptionRealValue> OpalMediaOptionReal;
    00525
    00526
    00527 class OpalMediaOptionEnum : public OpalMediaOption
    00528 {
    00529     PCLASSINFO(OpalMediaOptionEnum, OpalMediaOption);
    00530   public:
    00531     OpalMediaOptionEnum(
    00532       const char * name,
    00533       bool readOnly
    00534     );
    00535     OpalMediaOptionEnum(
    00536       const char * name,
    00537       bool readOnly,
    00538       const char * const * enumerations,
    00539       PINDEX count,
    00540       MergeType merge = EqualMerge,
    00541       PINDEX value = 0
    00542     );
    00543
    00544     virtual PObject * Clone() const;
    00545     virtual void PrintOn(ostream & strm) const;
    00546     virtual void ReadFrom(istream & strm);
    00547
    00548     virtual Comparison CompareValue(const OpalMediaOption & option) const;
    00549     virtual void Assign(const OpalMediaOption & option);
    00550
    00551     PINDEX GetValue() const { return m_value; }
    00552     void SetValue(PINDEX value);
    00553
    00554     const PStringArray & GetEnumerations() const { return m_enumerations; }
    00555     void SetEnumerations(const PStringArray & e)
    00556     {
    00557       m_enumerations = e;
    00558     }
    00559
    00560   protected:
    00561     PStringArray m_enumerations;
    00562     PINDEX       m_value;
    00563 };
    00564
    00565
    00566 class OpalMediaOptionString : public OpalMediaOption
    00567 {
    00568     PCLASSINFO(OpalMediaOptionString, OpalMediaOption);
    00569   public:
    00570     OpalMediaOptionString(
    00571       const char * name,
    00572       bool readOnly
    00573     );
    00574     OpalMediaOptionString(
    00575       const char * name,
    00576       bool readOnly,
    00577       const PString & value
    00578     );
    00579
    00580     virtual PObject * Clone() const;
    00581     virtual void PrintOn(ostream & strm) const;
    00582     virtual void ReadFrom(istream & strm);
    00583
    00584     virtual bool Merge(const OpalMediaOption & option);
    00585     virtual Comparison CompareValue(const OpalMediaOption & option) const;
    00586     virtual void Assign(const OpalMediaOption & option);
    00587
    00588     const PString & GetValue() const { return m_value; }
    00589     void SetValue(const PString & value);
    00590
    00591   protected:
    00592     PString m_value;
    00593 };
    00594
    00595
    00596 class OpalMediaOptionOctets : public OpalMediaOption
    00597 {
    00598     PCLASSINFO(OpalMediaOptionOctets, OpalMediaOption);
    00599   public:
    00600     OpalMediaOptionOctets(
    00601       const char * name,
    00602       bool readOnly,
    00603       bool base64 = false
    00604     );
    00605     OpalMediaOptionOctets(
    00606       const char * name,
    00607       bool readOnly,
    00608       bool base64,
    00609       const PBYTEArray & value
    00610     );
    00611     OpalMediaOptionOctets(
    00612       const char * name,
    00613       bool readOnly,
    00614       bool base64,
    00615       const BYTE * data,
    00616       PINDEX length
    00617     );
    00618
    00619     virtual PObject * Clone() const;
    00620     virtual void PrintOn(ostream & strm) const;
    00621     virtual void ReadFrom(istream & strm);
    00622
    00623     virtual Comparison CompareValue(const OpalMediaOption & option) const;
    00624     virtual void Assign(const OpalMediaOption & option);
    00625
    00626     const PBYTEArray & GetValue() const { return m_value; }
    00627     void SetValue(const PBYTEArray & value);
    00628     void SetValue(const BYTE * data, PINDEX length);
    00629
    00630     void SetBase64(bool b)
    00631     {
    00632       m_base64 = b;
    00633     }
    00634
    00635   protected:
    00636     PBYTEArray m_value;
    00637     bool       m_base64;
    00638 };
    00639
    00640
    00642
    00643 class OpalMediaFormatInternal : public PObject
    00644 {
    00645     PCLASSINFO(OpalMediaFormatInternal, PObject);
    00646   public:
    00647     OpalMediaFormatInternal(
    00648       const char * fullName,
    00649       const OpalMediaType & mediaType,
    00650       RTP_DataFrame::PayloadTypes rtpPayloadType,
    00651       const char * encodingName,
    00652       PBoolean     needsJitter,
    00653       unsigned bandwidth,
    00654       PINDEX   frameSize,
    00655       unsigned frameTime,
    00656       unsigned clockRate,
    00657       time_t timeStamp
    00658     );
    00659
    00660     const PCaselessString & GetName() const { return formatName; }
    00661
    00662     virtual PObject * Clone() const;
    00663     virtual void PrintOn(ostream & strm) const;
    00664
    00665     virtual bool IsValid() const;
    00666     virtual bool IsTransportable() const;
    00667
    00668     virtual PStringToString GetOptions() const;
    00669     virtual bool GetOptionValue(const PString & name, PString & value) const;
    00670     virtual bool SetOptionValue(const PString & name, const PString & value);
    00671     virtual bool GetOptionBoolean(const PString & name, bool dflt) const;
    00672     virtual bool SetOptionBoolean(const PString & name, bool value);
    00673     virtual int GetOptionInteger(const PString & name, int dflt) const;
    00674     virtual bool SetOptionInteger(const PString & name, int value);
    00675     virtual double GetOptionReal(const PString & name, double dflt) const;
    00676     virtual bool SetOptionReal(const PString & name, double value);
    00677     virtual PINDEX GetOptionEnum(const PString & name, PINDEX dflt) const;
    00678     virtual bool SetOptionEnum(const PString & name, PINDEX value);
    00679     virtual PString GetOptionString(const PString & name, const PString & dflt) const;
    00680     virtual bool SetOptionString(const PString & name, const PString & value);
    00681     virtual bool GetOptionOctets(const PString & name, PBYTEArray & octets) const;
    00682     virtual bool SetOptionOctets(const PString & name, const PBYTEArray & octets);
    00683     virtual bool SetOptionOctets(const PString & name, const BYTE * data, PINDEX length);
    00684     virtual bool AddOption(OpalMediaOption * option, PBoolean overwrite = false);
    00685     virtual OpalMediaOption * FindOption(const PString & name) const;
    00686
    00687     virtual bool ToNormalisedOptions();
    00688     virtual bool ToCustomisedOptions();
    00689     virtual bool Merge(const OpalMediaFormatInternal & mediaFormat);
    00690
    00691     virtual bool ValidateMerge(const OpalMediaFormatInternal & mediaFormat) const;
    00692
    00693     virtual bool IsValidForProtocol(const PString & protocol) const;
    00694
    00695   protected:
    00696     PCaselessString              formatName;
    00697     RTP_DataFrame::PayloadTypes  rtpPayloadType;
    00698     PString                      rtpEncodingName;
    00699     OpalMediaType                mediaType;
    00700     PMutex                       media_format_mutex;
    00701     PSortedList<OpalMediaOption> options;
    00702     time_t                       codecVersionTime;
    00703     bool                         forceIsTransportable;
    00704     int                          m_channels;
    00705
    00706   friend bool operator==(const char * other, const OpalMediaFormat & fmt);
    00707   friend bool operator!=(const char * other, const OpalMediaFormat & fmt);
    00708   friend bool operator==(const PString & other, const OpalMediaFormat & fmt);
    00709   friend bool operator!=(const PString & other, const OpalMediaFormat & fmt);
    00710
    00711   friend class OpalMediaFormat;
    00712   friend class OpalMediaFormatList;
    00713   friend class OpalAudioFormatInternal;
    00714 };
    00715
    00716
    00718
    00724 class OpalMediaFormat : public PContainer
    00725 {
    00726     PCLASSINFO(OpalMediaFormat, PContainer)
    00727   public:
    00728     OpalMediaFormat(const OpalMediaFormat & c);
    00729     virtual ~OpalMediaFormat();
    00730     OpalMediaFormat & operator=(const OpalMediaFormat & c)     { AssignContents(c); return *this; }
    00731     virtual PBoolean MakeUnique();
    00732   protected:
    00733     virtual void DestroyContents();
    00734     virtual void AssignContents(const PContainer & c);
    00735
    00736   public:
    00739     OpalMediaFormat(
    00740       OpalMediaFormatInternal * info = NULL
    00741     );
    00742
    00756     OpalMediaFormat(
    00757       const char * fullName,
    00758       const OpalMediaType & mediaType,
    00759       RTP_DataFrame::PayloadTypes rtpPayloadType,
    00760       const char * encodingName,
    00761       PBoolean     needsJitter,
    00762       unsigned bandwidth,
    00763       PINDEX   frameSize,
    00764       unsigned frameTime,
    00765       unsigned clockRate,
    00766       time_t timeStamp = 0
    00767     );
    00768
    00778     OpalMediaFormat(
    00779       RTP_DataFrame::PayloadTypes rtpPayloadType,
    00780       unsigned clockRate,
    00781       const char * rtpEncodingName = NULL,
    00782       const char * protocol = NULL
    00783     );
    00784
    00798     OpalMediaFormat(
    00799       const char * wildcard
    00800     );
    00801
    00815     OpalMediaFormat(
    00816       const PString & wildcard
    00817     );
    00818
    00822     OpalMediaFormat & operator=(
    00823       RTP_DataFrame::PayloadTypes rtpPayloadType
    00824     );
    00825
    00829     OpalMediaFormat & operator=(
    00830       const char * wildcard
    00831     );
    00832
    00836     OpalMediaFormat & operator=(
    00837       const PString & wildcard
    00838     );
    00839
    00842     virtual PObject * Clone() const;
    00843
    00846     virtual Comparison Compare(const PObject & obj) const;
    00847
    00852     virtual void PrintOn(ostream & strm) const;
    00853
    00856     virtual void ReadFrom(istream & strm);
    00857
    00862     bool ToNormalisedOptions();
    00863
    00867     bool ToCustomisedOptions();
    00868
    00871     bool Update(
    00872       const OpalMediaFormat & mediaFormat
    00873     );
    00874
    00885     bool Merge(
    00886       const OpalMediaFormat & mediaFormat
    00887     );
    00890     bool ValidateMerge(
    00891       const OpalMediaFormat & mediaFormat
    00892     ) const;
    00893
    00896     PString GetName() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? "" : m_info->formatName; }
    00897
    00902     PBoolean IsValid() const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->IsValid(); }
    00903
    00907     PBoolean IsTransportable() const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->IsTransportable(); }
    00908
    00914     RTP_DataFrame::PayloadTypes GetPayloadType() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? RTP_DataFrame::IllegalPayloadType : m_info->rtpPayloadType; }
    00915     void SetPayloadType(RTP_DataFrame::PayloadTypes type) { PWaitAndSignal m(m_mutex); MakeUnique(); if (m_info != NULL) m_info->rtpPayloadType = type; }
    00916
    00919     const char * GetEncodingName() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? "" : m_info->rtpEncodingName.GetPointer(); }
    00920
    00923     OpalMediaType GetMediaType() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? OpalMediaType() : m_info->mediaType; }
    00924
    00928     bool NeedsJitterBuffer() const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->GetOptionBoolean(NeedsJitterOption(), false); }
    00929     static const PString & NeedsJitterOption();
    00930
    00933     unsigned GetBandwidth() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? 0 : m_info->GetOptionInteger(MaxBitRateOption(), 0); }
    00934     static const PString & MaxBitRateOption();
    00935     static const PString & TargetBitRateOption();
    00936
    00941     PINDEX GetFrameSize() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? 0 : m_info->GetOptionInteger(MaxFrameSizeOption(), 0); }
    00942     static const PString & MaxFrameSizeOption();
    00943
    00947     unsigned GetFrameTime() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? 0 : m_info->GetOptionInteger(FrameTimeOption(), 0); }
    00948     static const PString & FrameTimeOption();
    00949
    00952     unsigned GetTimeUnits() const { return GetClockRate()/1000; }
    00953
    00954     enum StandardClockRate {
    00955       AudioClockRate = 8000,
    00956       VideoClockRate = 90000
    00957     };
    00958
    00961     unsigned GetClockRate() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? 0 : m_info->GetOptionInteger(ClockRateOption(), 1000); }
    00962     static const PString & ClockRateOption();
    00963
    00966     static const PString & ProtocolOption();
    00967
    00974     static const PString & MaxTxPacketSizeOption();
    00975
    00979     PStringToString GetOptions() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? PStringToString() : m_info->GetOptions(); }
    00980
    00983     PINDEX GetOptionCount() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? 0 : m_info->options.GetSize(); }
    00984
    00988     const OpalMediaOption & GetOption(
    00989       PINDEX index
    00990     ) const { PWaitAndSignal m(m_mutex); return m_info->options[index]; }
    00991
    00996     bool GetOptionValue(
    00997       const PString & name,
    00998       PString & value
    00999     ) const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->GetOptionValue(name, value); }
    01000
    01007     bool SetOptionValue(
    01008       const PString & name,
    01009       const PString & value
    01010     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionValue(name, value); }
    01011
    01015     bool GetOptionBoolean(
    01016       const PString & name,
    01017       bool dflt = false
    01018     ) const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->GetOptionBoolean(name, dflt); }
    01019
    01026     bool SetOptionBoolean(
    01027       const PString & name,
    01028       bool value
    01029     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionBoolean(name, value); }
    01030
    01034     int GetOptionInteger(
    01035       const PString & name,
    01036       int dflt = 0
    01037     ) const { PWaitAndSignal m(m_mutex); return m_info == NULL ? dflt : m_info->GetOptionInteger(name, dflt); }
    01038
    01046     bool SetOptionInteger(
    01047       const PString & name,
    01048       int value
    01049     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionInteger(name, value); }
    01050
    01054     double GetOptionReal(
    01055       const PString & name,
    01056       double dflt = 0
    01057     ) const { PWaitAndSignal m(m_mutex); return m_info == NULL ? dflt : m_info->GetOptionReal(name, dflt); }
    01058
    01065     bool SetOptionReal(
    01066       const PString & name,
    01067       double value
    01068     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionReal(name, value); }
    01069
    01074     PINDEX GetOptionEnum(
    01075       const PString & name,
    01076       PINDEX dflt = 0
    01077     ) const { PWaitAndSignal m(m_mutex); return m_info == NULL ? dflt : m_info->GetOptionEnum(name, dflt); }
    01078
    01085     bool SetOptionEnum(
    01086       const PString & name,
    01087       PINDEX value
    01088     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionEnum(name, value); }
    01089
    01093     PString GetOptionString(
    01094       const PString & name,
    01095       const PString & dflt = PString::Empty()
    01096     ) const { PWaitAndSignal m(m_mutex); return m_info == NULL ? dflt : m_info->GetOptionString(name, dflt); }
    01097
    01104     bool SetOptionString(
    01105       const PString & name,
    01106       const PString & value
    01107     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionString(name, value); }
    01108
    01112     bool GetOptionOctets(
    01113       const PString & name,
    01114       PBYTEArray & octets
    01115     ) const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->GetOptionOctets(name, octets); }
    01116
    01123     bool SetOptionOctets(
    01124       const PString & name,
    01125       const PBYTEArray & octets
    01126     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionOctets(name, octets); }
    01127     bool SetOptionOctets(
    01128       const PString & name,
    01129       const BYTE * data,
    01130       PINDEX length
    01131     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionOctets(name, data, length); }
    01132
    01135     static OpalMediaFormatList GetAllRegisteredMediaFormats();
    01136     static void GetAllRegisteredMediaFormats(
    01137       OpalMediaFormatList & copy
    01138     );
    01139
    01143     static bool SetRegisteredMediaFormat(
    01144       const OpalMediaFormat & mediaFormat
    01145     );
    01146
    01150     static bool RemoveRegisteredMediaFormat(
    01151       const OpalMediaFormat & mediaFormat
    01152     );
    01153
    01157     bool AddOption(
    01158       OpalMediaOption * option,
    01159       PBoolean overwrite = false
    01160     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->AddOption(option, overwrite); }
    01161
    01165     bool HasOption(const PString & name) const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->FindOption(name) != NULL; }
    01166
    01170     OpalMediaOption * FindOption(
    01171       const PString & name
    01172     ) const { PWaitAndSignal m(m_mutex); return m_info == NULL ? NULL : m_info->FindOption(name); }
    01173
    01177     template <class T> T * FindOptionAs(
    01178       const PString & name
    01179     ) const { return dynamic_cast<T *>(FindOption(name)); }
    01180
    01186     bool IsValidForProtocol(const PString & protocol) const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->IsValidForProtocol(protocol); }
    01187
    01188     time_t GetCodecVersionTime() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? 0 : m_info->codecVersionTime; }
    01189
    01190     ostream & PrintOptions(ostream & strm) const
    01191     {
    01192       PWaitAndSignal m(m_mutex);
    01193       if (m_info != NULL)
    01194         strm << setw(-1) << *m_info;
    01195       return strm;
    01196     }
    01197
    01198 #if OPAL_VIDEO
    01199
    01201     void AdjustVideoArgs(
    01202       PVideoDevice::OpenArgs & args
    01203     ) const;
    01204 #endif
    01205
    01206     // Backward compatibility
    01207     virtual PBoolean IsEmpty() const { PWaitAndSignal m(m_mutex); return m_info == NULL || !m_info->IsValid(); }
    01208     operator PString() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? "" : m_info->formatName; }
    01209     operator const char *() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? "" : m_info->formatName; }
    01210     bool operator==(const char * other) const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->formatName == other; }
    01211     bool operator!=(const char * other) const { PWaitAndSignal m(m_mutex); return m_info == NULL || m_info->formatName != other; }
    01212     bool operator==(const PString & other) const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->formatName == other; }
    01213     bool operator!=(const PString & other) const { PWaitAndSignal m(m_mutex); return m_info == NULL || m_info->formatName != other; }
    01214     bool operator==(const OpalMediaFormat & other) const { PWaitAndSignal m(m_mutex); return Compare(other) == EqualTo; }
    01215     bool operator!=(const OpalMediaFormat & other) const { PWaitAndSignal m(m_mutex); return Compare(other) != EqualTo; }
    01216     friend bool operator==(const char * other, const OpalMediaFormat & fmt) { return fmt.m_info != NULL && fmt.m_info->formatName == other; }
    01217     friend bool operator!=(const char * other, const OpalMediaFormat & fmt) { return fmt.m_info == NULL || fmt.m_info->formatName != other; }
    01218     friend bool operator==(const PString & other, const OpalMediaFormat & fmt) { return fmt.m_info != NULL && fmt.m_info->formatName == other; }
    01219     friend bool operator!=(const PString & other, const OpalMediaFormat & fmt) { return fmt.m_info == NULL || fmt.m_info->formatName != other; }
    01220
    01221 #if OPAL_H323
    01222     static const PString & MediaPacketizationOption();
    01223     static const PString & MediaPacketizationsOption();
    01224     PStringSet GetMediaPacketizations() const;
    01225     void SetMediaPacketizations(const PStringSet & packetizations);
    01226 #endif
    01227
    01228   private:
    01229     PBoolean SetSize(PINDEX) { return true; }
    01230
    01231   protected:
    01232     void Construct(OpalMediaFormatInternal * info);
    01233
    01234     OpalMediaFormatInternal * m_info;
    01235     PMutex                    m_mutex;
    01236
    01237   friend class OpalMediaFormatInternal;
    01238   friend class OpalMediaFormatList;
    01239 };
    01240
    01241
    01242 class OpalAudioFormatInternal : public OpalMediaFormatInternal
    01243 {
    01244   public:
    01245     OpalAudioFormatInternal(
    01246       const char * fullName,
    01247       RTP_DataFrame::PayloadTypes rtpPayloadType,
    01248       const char * encodingName,
    01249       PINDEX   frameSize,
    01250       unsigned frameTime,
    01251       unsigned rxFrames,
    01252       unsigned txFrames,
    01253       unsigned maxFrames,
    01254       unsigned clockRate,
    01255       time_t timeStamp
    01256     );
    01257     virtual PObject * Clone() const;
    01258     virtual bool Merge(const OpalMediaFormatInternal & mediaFormat);
    01259 };
    01260
    01261 class OpalAudioFormat : public OpalMediaFormat
    01262 {
    01263     PCLASSINFO(OpalAudioFormat, OpalMediaFormat);
    01264   public:
    01265     OpalAudioFormat(
    01266       OpalMediaFormatInternal * info = NULL
    01267     ) : OpalMediaFormat(info) { }
    01268     OpalAudioFormat(
    01269       const char * fullName,
    01270       RTP_DataFrame::PayloadTypes rtpPayloadType,
    01271       const char * encodingName,
    01272       PINDEX   frameSize,
    01273       unsigned frameTime,
    01274       unsigned rxFrames,
    01275       unsigned txFrames,
    01276       unsigned maxFrames = 256,
    01277       unsigned clockRate = 8000,
    01278       time_t timeStamp = 0
    01279     );
    01280
    01281     static const PString & RxFramesPerPacketOption();
    01282     static const PString & TxFramesPerPacketOption();
    01283     static const PString & MaxFramesPerPacketOption();
    01284     static const PString & ChannelsOption();
    01285 };
    01286
    01287 #if OPAL_VIDEO
    01288 class OpalVideoFormatInternal : public OpalMediaFormatInternal
    01289 {
    01290   public:
    01291     OpalVideoFormatInternal(
    01292       const char * fullName,
    01293       RTP_DataFrame::PayloadTypes rtpPayloadType,
    01294       const char * encodingName,
    01295       unsigned maxFrameWidth,
    01296       unsigned maxFrameHeight,
    01297       unsigned maxFrameRate,
    01298       unsigned maxBitRate,
    01299       time_t timeStamp
    01300     );
    01301     virtual PObject * Clone() const;
    01302     virtual bool Merge(const OpalMediaFormatInternal & mediaFormat);
    01303 };
    01304
    01305
    01306 class OpalVideoFormat : public OpalMediaFormat
    01307 {
    01308     PCLASSINFO(OpalVideoFormat, OpalMediaFormat);
    01309   public:
    01310     OpalVideoFormat(
    01311       OpalMediaFormatInternal * info = NULL
    01312     ) : OpalMediaFormat(info) { }
    01313     OpalVideoFormat(
    01314       const char * fullName,
    01315       RTP_DataFrame::PayloadTypes rtpPayloadType,
    01316       const char * encodingName,
    01317       unsigned maxFrameWidth,
    01318       unsigned maxFrameHeight,
    01319       unsigned maxFrameRate,
    01320       unsigned maxBitRate,
    01321       time_t timeStamp = 0
    01322     );
    01323
    01324     static const PString & FrameWidthOption();
    01325     static const PString & FrameHeightOption();
    01326     static const PString & MinRxFrameWidthOption();
    01327     static const PString & MinRxFrameHeightOption();
    01328     static const PString & MaxRxFrameWidthOption();
    01329     static const PString & MaxRxFrameHeightOption();
    01330     static const PString & TemporalSpatialTradeOffOption();
    01331     static const PString & TxKeyFramePeriodOption();
    01332     static const PString & RateControlPeriodOption(); // Period over which the rate controller maintains the target bit rate.
    01333     static const PString & RateControllerOption(); // String for controller algorithm. Empty is none.
    01334
    01345     enum ContentRole {
    01346       eNoRole,
    01347       ePresentation,
    01348       eMainRole,
    01349       eSpeaker,
    01350       eSignLanguage,
    01351       eNumRoles
    01352     };
    01353     enum { ContentRoleMask = 15 };
    01354     __inline static unsigned ContentRoleBit(ContentRole contentRole) { return contentRole != eNoRole ? (1<<(contentRole-1)) : 0; }
    01355     static const PString & ContentRoleOption();
    01356     static const PString & ContentRoleMaskOption();
    01357 };
    01358 #endif
    01359
    01360 // List of known media formats
    01361
    01362 #define OPAL_PCM16          "PCM-16"
    01363 #define OPAL_PCM16S         "PCM-16S"
    01364 #define OPAL_PCM16_16KHZ    "PCM-16-16kHz"
    01365 #define OPAL_PCM16S_16KHZ   "PCM-16S-16kHz"
    01366 #define OPAL_PCM16_32KHZ    "PCM-16-32kHz"
    01367 #define OPAL_PCM16S_32KHZ   "PCM-16S-32kHz"
    01368 #define OPAL_PCM16_48KHZ    "PCM-16-48kHz"
    01369 #define OPAL_PCM16S_48KHZ   "PCM-16S-48kHz"
    01370 #define OPAL_L16_MONO_8KHZ  "Linear-16-Mono-8kHz"
    01371 #define OPAL_L16_STEREO_8KHZ "Linear-16-Stereo-8kHz"
    01372 #define OPAL_L16_MONO_16KHZ "Linear-16-Mono-16kHz"
    01373 #define OPAL_L16_STEREO_16KHZ "Linear-16-Stereo-16kHz"
    01374 #define OPAL_L16_MONO_32KHZ "Linear-16-Mono-32kHz"
    01375 #define OPAL_L16_STEREO_32KHZ "Linear-16-Stereo-32kHz"
    01376 #define OPAL_L16_MONO_48KHZ "Linear-16-Mono-48kHz"
    01377 #define OPAL_L16_STEREO_48KHZ "Linear-16-Stereo-48kHz"
    01378 #define OPAL_G711_ULAW_64K  "G.711-uLaw-64k"
    01379 #define OPAL_G711_ALAW_64K  "G.711-ALaw-64k"
    01380 #define OPAL_G722           "G.722"
    01381 #define OPAL_G7221          "G.722.1"
    01382 #define OPAL_G7222          "G.722.2"
    01383 #define OPAL_G726_40K       "G.726-40K"
    01384 #define OPAL_G726_32K       "G.726-32K"
    01385 #define OPAL_G726_24K       "G.726-24K"
    01386 #define OPAL_G726_16K       "G.726-16K"
    01387 #define OPAL_G728           "G.728"
    01388 #define OPAL_G729           "G.729"
    01389 #define OPAL_G729A          "G.729A"
    01390 #define OPAL_G729B          "G.729B"
    01391 #define OPAL_G729AB         "G.729A/B"
    01392 #define OPAL_G7231          "G.723.1"
    01393 #define OPAL_G7231_6k3      OPAL_G7231
    01394 #define OPAL_G7231_5k3      "G.723.1(5.3k)"
    01395 #define OPAL_G7231A_6k3     "G.723.1A(6.3k)"
    01396 #define OPAL_G7231A_5k3     "G.723.1A(5.3k)"
    01397 #define OPAL_GSM0610        "GSM-06.10"
    01398 #define OPAL_GSMAMR         "GSM-AMR"
    01399 #define OPAL_iLBC           "iLBC"
    01400 #define OPAL_H261           "H.261"
    01401 #define OPAL_H263           "H.263"
    01402 #define OPAL_H264           "H.264"
    01403 #define OPAL_H264_MODE0     "H.264-0"
    01404 #define OPAL_H264_MODE1     "H.264-1"
    01405 #define OPAL_MPEG4          "MPEG4"
    01406 #define OPAL_RFC2833        "UserInput/RFC2833"
    01407 #define OPAL_CISCONSE       "NamedSignalEvent"
    01408 #define OPAL_T38            "T.38"
    01409
    01410 extern const OpalAudioFormat & GetOpalPCM16();
    01411 extern const OpalAudioFormat & GetOpalPCM16S();
    01412 extern const OpalAudioFormat & GetOpalPCM16_16KHZ();
    01413 extern const OpalAudioFormat & GetOpalPCM16S_16KHZ();
    01414 extern const OpalAudioFormat & GetOpalPCM16_32KHZ();
    01415 extern const OpalAudioFormat & GetOpalPCM16S_32KHZ();
    01416 extern const OpalAudioFormat & GetOpalPCM16_48KHZ();
    01417 extern const OpalAudioFormat & GetOpalPCM16S_48KHZ();
    01418 extern const OpalAudioFormat & GetOpalL16_MONO_8KHZ();
    01419 extern const OpalAudioFormat & GetOpalL16_STEREO_8KHZ();
    01420 extern const OpalAudioFormat & GetOpalL16_MONO_16KHZ();
    01421 extern const OpalAudioFormat & GetOpalL16_STEREO_16KHZ();
    01422 extern const OpalAudioFormat & GetOpalL16_MONO_32KHZ();
    01423 extern const OpalAudioFormat & GetOpalL16_STEREO_32KHZ();
    01424 extern const OpalAudioFormat & GetOpalL16_MONO_48KHZ();
    01425 extern const OpalAudioFormat & GetOpalL16_STEREO_48KHZ();
    01426 extern const OpalAudioFormat & GetOpalG711_ULAW_64K();
    01427 extern const OpalAudioFormat & GetOpalG711_ALAW_64K();
    01428 extern const OpalAudioFormat & GetOpalG722();
    01429 extern const OpalAudioFormat & GetOpalG7221();
    01430 extern const OpalAudioFormat & GetOpalG7222();
    01431 extern const OpalAudioFormat & GetOpalG726_40K();
    01432 extern const OpalAudioFormat & GetOpalG726_32K();
    01433 extern const OpalAudioFormat & GetOpalG726_24K();
    01434 extern const OpalAudioFormat & GetOpalG726_16K();
    01435 extern const OpalAudioFormat & GetOpalG728();
    01436 extern const OpalAudioFormat & GetOpalG729();
    01437 extern const OpalAudioFormat & GetOpalG729A();
    01438 extern const OpalAudioFormat & GetOpalG729B();
    01439 extern const OpalAudioFormat & GetOpalG729AB();
    01440 extern const OpalAudioFormat & GetOpalG7231_6k3();
    01441 extern const OpalAudioFormat & GetOpalG7231_5k3();
    01442 extern const OpalAudioFormat & GetOpalG7231A_6k3();
    01443 extern const OpalAudioFormat & GetOpalG7231A_5k3();
    01444 extern const OpalAudioFormat & GetOpalGSM0610();
    01445 extern const OpalAudioFormat & GetOpalGSMAMR();
    01446 extern const OpalAudioFormat & GetOpaliLBC();
    01447
    01448 extern const OpalMediaFormat & GetOpalRFC2833();
    01449
    01450 #if OPAL_T38_CAPABILITY
    01451 extern const OpalMediaFormat & GetOpalCiscoNSE();
    01452 extern const OpalMediaFormat & GetOpalT38();
    01453 #endif
    01454
    01455
    01456 #define OpalPCM16          GetOpalPCM16()
    01457 #define OpalPCM16S         GetOpalPCM16S()
    01458 #define OpalPCM16_16KHZ    GetOpalPCM16_16KHZ()
    01459 #define OpalPCM16S_16KHZ   GetOpalPCM16S_16KHZ()
    01460 #define OpalPCM16_32KHZ    GetOpalPCM16_32KHZ()
    01461 #define OpalPCM16S_32KHZ   GetOpalPCM16S_32KHZ()
    01462 #define OpalPCM16_48KHZ    GetOpalPCM16_48KHZ()
    01463 #define OpalPCM16S_48KHZ   GetOpalPCM16S_48KHZ()
    01464 #define OpalL16_MONO_8KHZ  GetOpalL16_MONO_8KHZ()
    01465 #define OpalL16_STEREO_8KHZ GetOpalL16_STEREO_8KHZ()
    01466 #define OpalL16_MONO_16KHZ GetOpalL16_MONO_16KHZ()
    01467 #define OpalL16_STEREO_16KHZ GetOpalL16_STEREO_16KHZ()
    01468 #define OpalL16_MONO_32KHZ GetOpalL16_MONO_32KHZ()
    01469 #define OpalL16_STEREO_32KHZ GetOpalL16_STEREO_32KHZ()
    01470 #define OpalL16_MONO_48KHZ GetOpalL16_MONO_48KHZ()
    01471 #define OpalL16_STEREO_48KHZ GetOpalL16_STEREO_48KHZ()
    01472 #define OpalG711_ULAW_64K  GetOpalG711_ULAW_64K()
    01473 #define OpalG711_ALAW_64K  GetOpalG711_ALAW_64K()
    01474 #define OpalG722           GetOpalG722()
    01475 #define OpalG7221          GetOpalG7221()
    01476 #define OpalG7222          GetOpalG7222()
    01477 #define OpalG726_40K       GetOpalG726_40K()
    01478 #define OpalG726_32K       GetOpalG726_32K()
    01479 #define OpalG726_24K       GetOpalG726_24K()
    01480 #define OpalG726_16K       GetOpalG726_16K()
    01481 #define OpalG728           GetOpalG728()
    01482 #define OpalG729           GetOpalG729()
    01483 #define OpalG729A          GetOpalG729A()
    01484 #define OpalG729B          GetOpalG729B()
    01485 #define OpalG729AB         GetOpalG729AB()
    01486 #define OpalG7231_6k3      GetOpalG7231_6k3()
    01487 #define OpalG7231_5k3      GetOpalG7231_5k3()
    01488 #define OpalG7231A_6k3     GetOpalG7231A_6k3()
    01489 #define OpalG7231A_5k3     GetOpalG7231A_5k3()
    01490 #define OpalGSM0610        GetOpalGSM0610()
    01491 #define OpalGSMAMR         GetOpalGSMAMR()
    01492 #define OpaliLBC           GetOpaliLBC()
    01493 #define OpalRFC2833        GetOpalRFC2833()
    01494 #define OpalCiscoNSE       GetOpalCiscoNSE()
    01495 #define OpalT38            GetOpalT38()
    01496
    01497 #define OpalL16Mono8kHz    OpalL16_MONO_8KHZ
    01498 #define OpalL16Mono16kHz   OpalL16_MONO_16KHZ
    01499 #define OpalG711uLaw       OpalG711_ULAW_64K
    01500 #define OpalG711ALaw       OpalG711_ALAW_64K
    01501
    01502 #define OPAL_T140             "T.140"
    01503 #define OpalT140              GetOpalT140()
    01504 extern const OpalMediaFormat & GetOpalT140();
    01505
    01506 #if OPAL_HAS_MSRP
    01507 #define OPAL_MSRP           "MSRP"
    01508 #define OpalMSRP            GetOpalMSRP()
    01509 extern const OpalMediaFormat & GetOpalMSRP();
    01510 #endif
    01511
    01512 #if OPAL_HAS_SIPIM
    01513 #define OPAL_SIPIM             "SIP-IM"
    01514 #define OpalSIPIM              GetOpalSIPIM()
    01515 extern const OpalMediaFormat & GetOpalSIPIM();
    01516 #endif
    01517
    01518 #ifdef _MSC_VER
    01519 #if _MSC_VER < 1300
    01520 #pragma warning(default:4663)
    01521 #endif
    01522 #endif
    01523
    01524 #endif  // OPAL_OPAL_MEDIAFMT_H
    01525
    01526
    01527 // End of File ///////////////////////////////////////////////////////////////