# 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: 29200 $
    00028  * $Author: rjongbloed $
    00029  * $Date: 2013-03-04 22:07:48 -0600 (Mon, 04 Mar 2013) $
    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 #include <opal/buildopts.h>
    00040
    00041 #include <opal/mediatype.h>
    00042 #include <rtp/rtp.h>
    00043 #include <ptlib/bitwise_enum.h>
    00044
    00045 #if OPAL_VIDEO
    00046 #include <ptlib/videoio.h>
    00047 #endif
    00048
    00049 #include <limits>
    00050
    00051
    00052 class PluginCodec_OptionMap;
    00053 class OpalMediaFormat;
    00054 class H225_BandWidth;
    00055
    00056
    00058
    00063 class OpalBandwidth {
    00064   public:
    00065     enum Direction {
    00066       Rx = 1,
    00067       Tx,
    00068       RxTx,
    00069       TxRx = RxTx
    00070     };
    00071     friend std::ostream & operator<<(std::ostream & strm, OpalBandwidth::Direction dir);
    00072
    00073     typedef unsigned int_type;
    00074
    00075     __inline OpalBandwidth(int_type bps = 0) : m_bps(bps) { }
    00076     __inline OpalBandwidth & operator=(int_type bps) { m_bps = bps; return *this; }
    00077     __inline operator int_type() const { return m_bps; }
    00078
    00079     __inline OpalBandwidth & operator+=(const OpalBandwidth & bw) { m_bps += bw.m_bps; return *this; }
    00080     __inline OpalBandwidth & operator-=(const OpalBandwidth & bw) { m_bps += bw.m_bps; return *this; }
    00081     __inline OpalBandwidth & operator&=(const OpalBandwidth & bw) { m_bps &= bw.m_bps; return *this; }
    00082     __inline OpalBandwidth & operator+=(int_type bps) { m_bps += bps; return *this; }
    00083     __inline OpalBandwidth & operator-=(int_type bps) { m_bps += bps; return *this; }
    00084
    00085     friend std::ostream & operator<<(std::ostream & strm, const OpalBandwidth & bw);
    00086     friend std::istream & operator>>(std::istream & strm, OpalBandwidth & bw);
    00087
    00088 #if OPAL_H323
    00089     OpalBandwidth(const H225_BandWidth & bw);
    00090     OpalBandwidth & operator=(const H225_BandWidth & bw);
    00091     void SetH225(H225_BandWidth & bw) const;
    00092 #endif
    00093
    00094     static OpalBandwidth Max() { return OpalBandwidth(UINT_MAX); }
    00095
    00096   protected:
    00097     int_type m_bps;
    00098 };
    00099
    00100
    00102
    00103 PLIST(OpalMediaFormatBaseList, OpalMediaFormat);
    00104
    00107 class OpalMediaFormatList : public OpalMediaFormatBaseList
    00108 {
    00109   PCLASSINFO(OpalMediaFormatList, OpalMediaFormatBaseList);
    00110   public:
    00115     OpalMediaFormatList();
    00116
    00119     OpalMediaFormatList(
    00120       const OpalMediaFormat & format
    00121     );
    00122
    00125     OpalMediaFormatList(const OpalMediaFormatList & l) : OpalMediaFormatBaseList(l) { }
    00127
    00133     OpalMediaFormatList & operator+=(
    00134       const char * wildcard
    00135     ) { PConstString w(wildcard); return operator+=(w); }
    00136
    00140     OpalMediaFormatList & operator+=(
    00141       const PString & wildcard
    00142     );
    00143
    00147     OpalMediaFormatList & operator+=(
    00148       const OpalMediaFormat & format
    00149     );
    00150
    00154     OpalMediaFormatList & operator+=(
    00155       const OpalMediaFormatList & formats
    00156     );
    00157
    00161     OpalMediaFormatList & operator-=(
    00162       const OpalMediaFormat & format
    00163     );
    00164
    00168     OpalMediaFormatList & operator-=(
    00169       const OpalMediaFormatList & formats
    00170     );
    00171
    00188     const_iterator FindFormat(
    00189       RTP_DataFrame::PayloadTypes rtpPayloadType,
    00190       const unsigned clockRate = 0,
    00191       const char * rtpEncodingName = NULL,
    00192       const char * protocol = NULL,
    00193       const_iterator start = const_iterator()
    00194     ) const;
    00195
    00212     const_iterator FindFormat(
    00213       const PString & wildcard,
    00214       const_iterator start = const_iterator()
    00215     ) const;
    00216
    00219     PBoolean HasFormat(
    00220       RTP_DataFrame::PayloadTypes rtpPayloadType
    00221     ) const { return FindFormat(rtpPayloadType) != end(); }
    00222
    00228     PBoolean HasFormat(
    00229       const PString & wildcard
    00230     ) const { return FindFormat(wildcard) != end(); }
    00231
    00234     bool HasType(
    00235       const OpalMediaType & type,
    00236       bool mustBeTransportable = true
    00237     ) const;
    00238
    00241     OpalMediaTypeList GetMediaTypes() const;
    00242
    00258     void Reorder(
    00259       const PStringArray & order
    00260     );
    00261
    00280     void Remove(
    00281       const PStringArray & mask
    00282     );
    00283
    00286     void RemoveNonTransportable();
    00288
    00289   private:
    00290     virtual PINDEX Append(PObject *) { return P_MAX_INDEX; }
    00291     virtual PINDEX Insert(const PObject &, PObject *) { return P_MAX_INDEX; }
    00292 };
    00293
    00294
    00296
    00299 class OpalMediaOption : public PObject
    00300 {
    00301     PCLASSINFO(OpalMediaOption, PObject);
    00302   public:
    00303     // Note the below enum must be identical to PluginCodec_OptionMerge in opalplugin.h
    00304     enum MergeType {
    00305       NoMerge,
    00306       MinMerge,
    00307       MaxMerge,
    00308       EqualMerge,
    00309       NotEqualMerge,
    00310       AlwaysMerge,
    00311       CustomMerge,
    00312       IntersectionMerge, // Set intersection, applies to numeric (bit wise AND) or string (common substrings)
    00313
    00314       // Synonyms
    00315       AndMerge = MinMerge,  // Applies to Boolean option or Enum with two elements
    00316       OrMerge  = MaxMerge   // Applies to Boolean option or Enum with two elements
    00317     };
    00318
    00319   protected:
    00320     OpalMediaOption(
    00321       const PString & name
    00322     );
    00323     OpalMediaOption(
    00324       const char * name,
    00325       bool readOnly,
    00326       MergeType merge
    00327     );
    00328
    00329   public:
    00330     virtual Comparison Compare(const PObject & obj) const;
    00331
    00332     virtual bool Merge(
    00333       const OpalMediaOption & option
    00334     );
    00335
    00336     virtual bool ValidateMerge(
    00337       const OpalMediaOption & option
    00338     ) const;
    00339
    00340     virtual Comparison CompareValue(
    00341       const OpalMediaOption & option
    00342     ) const = 0;
    00343     virtual void Assign(
    00344       const OpalMediaOption & option
    00345     ) = 0;
    00346
    00347     PString AsString() const;
    00348     bool FromString(const PString & value);
    00349
    00350     const PString & GetName() const { return m_name; }
    00351
    00352     bool IsReadOnly() const { return m_readOnly; }
    00353     void SetReadOnly(bool readOnly) { m_readOnly = readOnly; }
    00354
    00355     MergeType GetMerge() const { return m_merge; }
    00356     void SetMerge(MergeType merge) { m_merge = merge; }
    00357
    00358 #if OPAL_SIP
    00359     const PString & GetFMTPName() const { return m_FMTPName; }
    00360     void SetFMTPName(const char * name) { m_FMTPName = name; }
    00361
    00362     const PString & GetFMTPDefault() const { return m_FMTPDefault; }
    00363     void SetFMTPDefault(const char * value) { m_FMTPDefault = value; }
    00364
    00365     void SetFMTP(const char * name, const char * dflt)
    00366     {
    00367       m_FMTPName = name;
    00368       m_FMTPDefault = dflt;
    00369     }
    00370 #define OPAL_SET_MEDIA_OPTION_FMTP(opt, name, dflt) (opt)->SetFMTP(name, dflt)
    00371 #else
    00372 #define OPAL_SET_MEDIA_OPTION_FMTP(opt, name, dflt)
    00373 #endif // OPAL_SIP
    00374
    00375 #if OPAL_H323
    00376     struct H245GenericInfo {
    00377       H245GenericInfo();
    00378       H245GenericInfo(
    00379         unsigned mask,
    00380         const char * dflt = NULL
    00381       );
    00382
    00383       unsigned ordinal;
    00384
    00385       enum Modes {
    00386         None,
    00387         Collapsing,
    00388         NonCollapsing
    00389       } mode;
    00390
    00391       enum IntegerTypes {
    00392         UnsignedInt,
    00393         Unsigned32,
    00394         BooleanArray
    00395       } integerType;
    00396
    00397       bool    excludeTCS;
    00398       bool    excludeOLC;
    00399       bool    excludeReqMode;
    00400       int     position;     // Position in sequence for parameter
    00401       PString defaultValue; // Do not include parameter if this value
    00402     };
    00403
    00404     const H245GenericInfo & GetH245Generic() const { return m_H245Generic; }
    00405     void SetH245Generic(const H245GenericInfo & genericInfo) { m_H245Generic = genericInfo; }
    00406 #define OPAL_SET_MEDIA_OPTION_H245(opt, ...) (opt)->SetH245Generic(OpalMediaOption::H245GenericInfo(__VA_ARGS__))
    00407 #else
    00408 #define OPAL_SET_MEDIA_OPTION_H245(opt, ...)
    00409 #endif // OPAL_H323
    00410
    00411   protected:
    00412     PCaselessString m_name;
    00413     bool            m_readOnly;
    00414     MergeType       m_merge;
    00415
    00416 #if OPAL_SIP
    00417     PCaselessString m_FMTPName;
    00418     PString         m_FMTPDefault;
    00419 #endif // OPAL_SIP
    00420
    00421 #if OPAL_H323
    00422     H245GenericInfo m_H245Generic;
    00423 #endif // OPAL_H323
    00424 };
    00425
    00426
    00427 template <typename T>
    00428 class OpalMediaOptionValue : public OpalMediaOption
    00429 {
    00430     PCLASSINFO(OpalMediaOptionValue, OpalMediaOption);
    00431   public:
    00432     OpalMediaOptionValue(
    00433       const char * name,
    00434       bool readOnly,
    00435       OpalMediaOption::MergeType merge = OpalMediaOption::MinMerge,
    00436       T value = T()
    00437     )
    00438       : OpalMediaOption(name, readOnly, merge)
    00439       , m_value(value)
    00440     {
    00441     }
    00442
    00443     virtual PObject * Clone() const
    00444     {
    00445       return new OpalMediaOptionValue(*this);
    00446     }
    00447
    00448     virtual void PrintOn(ostream & strm) const
    00449     {
    00450       strm << m_value;
    00451     }
    00452
    00453     virtual void ReadFrom(istream & strm)
    00454     {
    00455       strm >> m_value;
    00456     }
    00457
    00458     virtual bool Merge(const OpalMediaOption & option)
    00459     {
    00460       if (m_merge != IntersectionMerge)
    00461         return OpalMediaOption::Merge(option);
    00462
    00463       const OpalMediaOptionValue * otherOption = PDownCast(const OpalMediaOptionValue, &option);
    00464       if (otherOption == NULL)
    00465         return false;
    00466
    00467       m_value &= otherOption->m_value;
    00468       return true;
    00469     }
    00470
    00471     virtual Comparison CompareValue(const OpalMediaOption & option) const
    00472     {
    00473       const OpalMediaOptionValue * otherOption = PDownCast(const OpalMediaOptionValue, &option);
    00474       if (otherOption == NULL)
    00475         return GreaterThan;
    00476       if (m_value < otherOption->m_value)
    00477         return LessThan;
    00478       if (m_value > otherOption->m_value)
    00479         return GreaterThan;
    00480       return EqualTo;
    00481     }
    00482
    00483     virtual void Assign(const OpalMediaOption & option)
    00484     {
    00485       const OpalMediaOptionValue * otherOption = PDownCast(const OpalMediaOptionValue, &option);
    00486       if (otherOption != NULL)
    00487         m_value = otherOption->m_value;
    00488     }
    00489
    00490     T GetValue() const
    00491     {
    00492       return m_value;
    00493     }
    00494
    00495     void SetValue(T value)
    00496     {
    00497       m_value = value;
    00498     }
    00499
    00500   protected:
    00501     T m_value;
    00502 };
    00503
    00504
    00505 template <typename T>
    00506 class OpalMediaOptionNumericalValue : public OpalMediaOptionValue<T>
    00507 {
    00508     typedef OpalMediaOptionValue<T> BaseClass;
    00509     PCLASSINFO(OpalMediaOptionNumericalValue, BaseClass);
    00510   public:
    00511     OpalMediaOptionNumericalValue(
    00512       const char * name,
    00513       bool readOnly,
    00514       OpalMediaOption::MergeType merge = OpalMediaOption::MinMerge,
    00515       T value = 0,
    00516       T minimum = std::numeric_limits<T>::min(),
    00517       T maximum = std::numeric_limits<T>::max()
    00518     )
    00519       : BaseClass(name, readOnly, merge, value)
    00520       , m_minimum(minimum)
    00521       , m_maximum(maximum)
    00522     {
    00523     }
    00524
    00525     virtual PObject * Clone() const
    00526     {
    00527       return new OpalMediaOptionNumericalValue(*this);
    00528     }
    00529
    00530     virtual void ReadFrom(istream & strm)
    00531     {
    00532       T temp = 0;
    00533       strm >> temp;
    00534       if (strm.fail())
    00535         return;
    00536       if (temp >= m_minimum && temp <= m_maximum)
    00537         this->m_value = temp;
    00538       else
    00539         strm.setstate(ios::badbit);
    00540     }
    00541
    00542     void SetValue(T value)
    00543     {
    00544       if (value < m_minimum)
    00545         this->m_value = m_minimum;
    00546       else if (value > m_maximum)
    00547         this->m_value = m_maximum;
    00548       else
    00549         this->m_value = value;
    00550     }
    00551
    00552     void SetMinimum(T m)
    00553     {
    00554       this->m_minimum = m;
    00555     }
    00556
    00557     void SetMaximum(T m)
    00558     {
    00559       this->m_maximum = m;
    00560     }
    00561
    00562   protected:
    00563     T m_minimum;
    00564     T m_maximum;
    00565 };
    00566
    00567
    00568 typedef OpalMediaOptionNumericalValue<bool>     OpalMediaOptionBoolean;
    00569 typedef OpalMediaOptionNumericalValue<int>      OpalMediaOptionInteger;
    00570 typedef OpalMediaOptionNumericalValue<unsigned> OpalMediaOptionUnsigned;
    00571
    00572 // Wrapper class so we can implement intersection (&= operator) for floating point
    00573 class OpalMediaOptionRealValue
    00574 {
    00575     double m_value;
    00576   public:
    00577     OpalMediaOptionRealValue(double value = 0) : m_value(value) { }
    00578     operator double() const { return m_value; }
    00579     void operator&=(double other) { if (m_value > other) m_value = other; }
    00580     friend ostream & operator<<(ostream & strm, const OpalMediaOptionRealValue & value) { return strm << value.m_value; }
    00581     friend istream & operator>>(istream & strm,       OpalMediaOptionRealValue & value) { return strm >> value.m_value; }
    00582 };
    00583
    00584 typedef OpalMediaOptionNumericalValue<OpalMediaOptionRealValue> OpalMediaOptionReal;
    00585
    00586
    00587 class OpalMediaOptionEnum : public OpalMediaOption
    00588 {
    00589     PCLASSINFO(OpalMediaOptionEnum, OpalMediaOption);
    00590   public:
    00591     OpalMediaOptionEnum(
    00592       const char * name,
    00593       bool readOnly
    00594     );
    00595     OpalMediaOptionEnum(
    00596       const char * name,
    00597       bool readOnly,
    00598       const char * const * enumerations,
    00599       PINDEX count,
    00600       MergeType merge = EqualMerge,
    00601       PINDEX value = 0
    00602     );
    00603
    00604     virtual PObject * Clone() const;
    00605     virtual void PrintOn(ostream & strm) const;
    00606     virtual void ReadFrom(istream & strm);
    00607
    00608     virtual Comparison CompareValue(const OpalMediaOption & option) const;
    00609     virtual void Assign(const OpalMediaOption & option);
    00610
    00611     PINDEX GetValue() const { return m_value; }
    00612     void SetValue(PINDEX value);
    00613
    00614     const PStringArray & GetEnumerations() const { return m_enumerations; }
    00615     void SetEnumerations(const PStringArray & e)
    00616     {
    00617       m_enumerations = e;
    00618     }
    00619
    00620   protected:
    00621     PStringArray m_enumerations;
    00622     PINDEX       m_value;
    00623 };
    00624
    00625
    00626 class OpalMediaOptionString : public OpalMediaOption
    00627 {
    00628     PCLASSINFO(OpalMediaOptionString, OpalMediaOption);
    00629   public:
    00630     OpalMediaOptionString(
    00631       const char * name,
    00632       bool readOnly
    00633     );
    00634     OpalMediaOptionString(
    00635       const char * name,
    00636       bool readOnly,
    00637       const PString & value
    00638     );
    00639
    00640     virtual PObject * Clone() const;
    00641     virtual void PrintOn(ostream & strm) const;
    00642     virtual void ReadFrom(istream & strm);
    00643
    00644     virtual bool Merge(const OpalMediaOption & option);
    00645     virtual Comparison CompareValue(const OpalMediaOption & option) const;
    00646     virtual void Assign(const OpalMediaOption & option);
    00647
    00648     const PString & GetValue() const { return m_value; }
    00649     void SetValue(const PString & value);
    00650
    00651   protected:
    00652     PString m_value;
    00653 };
    00654
    00655
    00656 class OpalMediaOptionOctets : public OpalMediaOption
    00657 {
    00658     PCLASSINFO(OpalMediaOptionOctets, OpalMediaOption);
    00659   public:
    00660     OpalMediaOptionOctets(
    00661       const char * name,
    00662       bool readOnly,
    00663       bool base64 = false
    00664     );
    00665     OpalMediaOptionOctets(
    00666       const char * name,
    00667       bool readOnly,
    00668       bool base64,
    00669       const PBYTEArray & value
    00670     );
    00671     OpalMediaOptionOctets(
    00672       const char * name,
    00673       bool readOnly,
    00674       bool base64,
    00675       const BYTE * data,
    00676       PINDEX length
    00677     );
    00678
    00679     virtual PObject * Clone() const;
    00680     virtual void PrintOn(ostream & strm) const;
    00681     virtual void ReadFrom(istream & strm);
    00682
    00683     virtual Comparison CompareValue(const OpalMediaOption & option) const;
    00684     virtual void Assign(const OpalMediaOption & option);
    00685
    00686     const PBYTEArray & GetValue() const { return m_value; }
    00687     void SetValue(const PBYTEArray & value);
    00688     void SetValue(const BYTE * data, PINDEX length);
    00689
    00690     void SetBase64(bool b)
    00691     {
    00692       m_base64 = b;
    00693     }
    00694
    00695   protected:
    00696     PBYTEArray m_value;
    00697     bool       m_base64;
    00698 };
    00699
    00700
    00702
    00703 class OpalMediaFormatInternal : public PObject
    00704 {
    00705     PCLASSINFO(OpalMediaFormatInternal, PObject);
    00706   public:
    00707     OpalMediaFormatInternal(
    00708       const char  * fullName,
    00709       const OpalMediaType & mediaType,
    00710       RTP_DataFrame::PayloadTypes rtpPayloadType,
    00711       const char  * encodingName,
    00712       bool          needsJitter,
    00713       OpalBandwidth bandwidth,
    00714       PINDEX        frameSize,
    00715       unsigned      frameTime,
    00716       unsigned      clockRate,
    00717       time_t        timeStamp
    00718     );
    00719
    00720     const PCaselessString & GetName() const { return formatName; }
    00721
    00722     virtual PObject * Clone() const;
    00723     virtual void PrintOn(ostream & strm) const;
    00724
    00725     virtual bool IsValid() const;
    00726     virtual bool IsTransportable() const;
    00727
    00728     virtual PStringToString GetOptions() const;
    00729     virtual bool GetOptionValue(const PString & name, PString & value) const;
    00730     virtual bool SetOptionValue(const PString & name, const PString & value);
    00731     virtual bool GetOptionBoolean(const PString & name, bool dflt) const;
    00732     virtual bool SetOptionBoolean(const PString & name, bool value);
    00733     virtual int GetOptionInteger(const PString & name, int dflt) const;
    00734     virtual bool SetOptionInteger(const PString & name, int value);
    00735     virtual double GetOptionReal(const PString & name, double dflt) const;
    00736     virtual bool SetOptionReal(const PString & name, double value);
    00737     virtual PINDEX GetOptionEnum(const PString & name, PINDEX dflt) const;
    00738     virtual bool SetOptionEnum(const PString & name, PINDEX value);
    00739     virtual PString GetOptionString(const PString & name, const PString & dflt) const;
    00740     virtual bool SetOptionString(const PString & name, const PString & value);
    00741     virtual bool GetOptionOctets(const PString & name, PBYTEArray & octets) const;
    00742     virtual bool SetOptionOctets(const PString & name, const PBYTEArray & octets);
    00743     virtual bool SetOptionOctets(const PString & name, const BYTE * data, PINDEX length);
    00744     virtual bool AddOption(OpalMediaOption * option, PBoolean overwrite = false);
    00745     virtual OpalMediaOption * FindOption(const PString & name) const;
    00746
    00747     virtual bool ToNormalisedOptions();
    00748     virtual bool ToCustomisedOptions();
    00749     virtual bool Merge(const OpalMediaFormatInternal & mediaFormat);
    00750
    00751     virtual bool ValidateMerge(const OpalMediaFormatInternal & mediaFormat) const;
    00752
    00753     virtual bool IsValidForProtocol(const PString & protocol) const;
    00754
    00755   protected:
    00756     bool AdjustByOptionMaps(
    00757       PTRACE_PARAM(const char * operation,)
    00758       bool (*adjuster)(PluginCodec_OptionMap & original, PluginCodec_OptionMap & changed)
    00759     );
    00760
    00761     PCaselessString              formatName;
    00762     RTP_DataFrame::PayloadTypes  rtpPayloadType;
    00763     PString                      rtpEncodingName;
    00764     OpalMediaType                mediaType;
    00765     PMutex                       media_format_mutex;
    00766     PSortedList<OpalMediaOption> options;
    00767     time_t                       codecVersionTime;
    00768     bool                         forceIsTransportable;
    00769     int                          m_channels;
    00770
    00771   friend bool operator==(const char * other, const OpalMediaFormat & fmt);
    00772   friend bool operator!=(const char * other, const OpalMediaFormat & fmt);
    00773   friend bool operator==(const PString & other, const OpalMediaFormat & fmt);
    00774   friend bool operator!=(const PString & other, const OpalMediaFormat & fmt);
    00775
    00776   friend class OpalMediaFormat;
    00777   friend class OpalMediaFormatList;
    00778   friend class OpalAudioFormatInternal;
    00779 };
    00780
    00781
    00783
    00789 class OpalMediaFormat : public PContainer
    00790 {
    00791     PCLASSINFO(OpalMediaFormat, PContainer)
    00792   public:
    00793     OpalMediaFormat(const OpalMediaFormat & c);
    00794     virtual ~OpalMediaFormat();
    00795     OpalMediaFormat & operator=(const OpalMediaFormat & c)     { AssignContents(c); return *this; }
    00796     virtual PBoolean MakeUnique();
    00797   protected:
    00798     virtual void DestroyContents();
    00799     virtual void AssignContents(const PContainer & c);
    00800
    00801   public:
    00804     OpalMediaFormat(
    00805       OpalMediaFormatInternal * info = NULL
    00806     );
    00807
    00821     OpalMediaFormat(
    00822       const char * fullName,
    00823       const OpalMediaType & mediaType,
    00824       RTP_DataFrame::PayloadTypes rtpPayloadType,
    00825       const char * encodingName,
    00826       PBoolean     needsJitter,
    00827       OpalBandwidth bandwidth,
    00828       PINDEX   frameSize,
    00829       unsigned frameTime,
    00830       unsigned clockRate,
    00831       time_t timeStamp = 0
    00832     );
    00833
    00843     OpalMediaFormat(
    00844       RTP_DataFrame::PayloadTypes rtpPayloadType,
    00845       unsigned clockRate,
    00846       const char * rtpEncodingName = NULL,
    00847       const char * protocol = NULL
    00848     );
    00849
    00863     OpalMediaFormat(
    00864       const char * wildcard
    00865     );
    00866
    00880     OpalMediaFormat(
    00881       const PString & wildcard
    00882     );
    00883
    00887     OpalMediaFormat & operator=(
    00888       RTP_DataFrame::PayloadTypes rtpPayloadType
    00889     );
    00890
    00894     OpalMediaFormat & operator=(
    00895       const char * wildcard
    00896     );
    00897
    00901     OpalMediaFormat & operator=(
    00902       const PString & wildcard
    00903     );
    00904
    00907     virtual PObject * Clone() const;
    00908
    00911     virtual Comparison Compare(const PObject & obj) const;
    00912
    00917     virtual void PrintOn(ostream & strm) const;
    00918
    00921     virtual void ReadFrom(istream & strm);
    00922
    00927     bool ToNormalisedOptions();
    00928
    00932     bool ToCustomisedOptions();
    00933
    00936     bool Update(
    00937       const OpalMediaFormat & mediaFormat
    00938     );
    00939
    00950     bool Merge(
    00951       const OpalMediaFormat & mediaFormat
    00952     );
    00955     bool ValidateMerge(
    00956       const OpalMediaFormat & mediaFormat
    00957     ) const;
    00958
    00961     PString GetName() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? "" : m_info->formatName; }
    00962
    00967     PBoolean IsValid() const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->IsValid(); }
    00968
    00972     PBoolean IsTransportable() const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->IsTransportable(); }
    00973
    00979     RTP_DataFrame::PayloadTypes GetPayloadType() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? RTP_DataFrame::IllegalPayloadType : m_info->rtpPayloadType; }
    00980     void SetPayloadType(RTP_DataFrame::PayloadTypes type) { PWaitAndSignal m(m_mutex); MakeUnique(); if (m_info != NULL) m_info->rtpPayloadType = type; }
    00981
    00984     const char * GetEncodingName() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? "" : (const char *)m_info->rtpEncodingName; }
    00985
    00988     OpalMediaType GetMediaType() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? OpalMediaType() : m_info->mediaType; }
    00989
    00993     bool NeedsJitterBuffer() const { return GetOptionBoolean(NeedsJitterOption()); }
    00994     static const PString & NeedsJitterOption();
    00995
    00998     OpalBandwidth GetMaxBandwidth() const { return GetOptionInteger(MaxBitRateOption()); }
    00999     static const PString & MaxBitRateOption();
    01000
    01003     OpalBandwidth GetUsedBandwidth() const { return GetOptionInteger(TargetBitRateOption(), GetOptionInteger(MaxBitRateOption())); }
    01004     static const PString & TargetBitRateOption();
    01005
    01010     PINDEX GetFrameSize() const { return GetOptionInteger(MaxFrameSizeOption()); }
    01011     static const PString & MaxFrameSizeOption();
    01012
    01016     unsigned GetFrameTime() const { return GetOptionInteger(FrameTimeOption()); }
    01017     static const PString & FrameTimeOption();
    01018
    01021     unsigned GetTimeUnits() const { return GetClockRate()/1000; }
    01022
    01023     enum StandardClockRate {
    01024       AudioClockRate = 8000,
    01025       VideoClockRate = 90000
    01026     };
    01027
    01030     unsigned GetClockRate() const { return GetOptionInteger(ClockRateOption(), AudioClockRate); }
    01031     static const PString & ClockRateOption();
    01032
    01035     static const PString & ProtocolOption();
    01036
    01043     static const PString & MaxTxPacketSizeOption();
    01044
    01048     PStringToString GetOptions() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? PStringToString() : m_info->GetOptions(); }
    01049
    01052     PINDEX GetOptionCount() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? 0 : m_info->options.GetSize(); }
    01053
    01057     const OpalMediaOption & GetOption(
    01058       PINDEX index
    01059     ) const { PWaitAndSignal m(m_mutex); return m_info->options[index]; }
    01060
    01065     bool GetOptionValue(
    01066       const PString & name,
    01067       PString & value
    01068     ) const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->GetOptionValue(name, value); }
    01069
    01076     bool SetOptionValue(
    01077       const PString & name,
    01078       const PString & value
    01079     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionValue(name, value); }
    01080
    01084     bool GetOptionBoolean(
    01085       const PString & name,
    01086       bool dflt = false
    01087     ) const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->GetOptionBoolean(name, dflt); }
    01088
    01095     bool SetOptionBoolean(
    01096       const PString & name,
    01097       bool value
    01098     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionBoolean(name, value); }
    01099
    01103     int GetOptionInteger(
    01104       const PString & name,
    01105       int dflt = 0
    01106     ) const { PWaitAndSignal m(m_mutex); return m_info == NULL ? dflt : m_info->GetOptionInteger(name, dflt); }
    01107
    01115     bool SetOptionInteger(
    01116       const PString & name,
    01117       int value
    01118     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionInteger(name, value); }
    01119
    01123     double GetOptionReal(
    01124       const PString & name,
    01125       double dflt = 0
    01126     ) const { PWaitAndSignal m(m_mutex); return m_info == NULL ? dflt : m_info->GetOptionReal(name, dflt); }
    01127
    01134     bool SetOptionReal(
    01135       const PString & name,
    01136       double value
    01137     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionReal(name, value); }
    01138
    01146     template <typename Enum>
    01147     Enum GetOptionEnum(
    01148       const PString & name,
    01149       Enum dflt = (Enum)0
    01150     ) const { PWaitAndSignal m(m_mutex); return m_info == NULL ? dflt : (Enum)m_info->GetOptionEnum(name, dflt); }
    01151
    01161     template <typename Enum>
    01162     bool SetOptionEnum(
    01163       const PString & name,
    01164       Enum value
    01165     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionEnum(name, value); }
    01166
    01170     PString GetOptionString(
    01171       const PString & name,
    01172       const PString & dflt = PString::Empty()
    01173     ) const { PWaitAndSignal m(m_mutex); return m_info == NULL ? dflt : m_info->GetOptionString(name, dflt); }
    01174
    01181     bool SetOptionString(
    01182       const PString & name,
    01183       const PString & value
    01184     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionString(name, value); }
    01185
    01189     bool GetOptionOctets(
    01190       const PString & name,
    01191       PBYTEArray & octets
    01192     ) const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->GetOptionOctets(name, octets); }
    01193
    01200     bool SetOptionOctets(
    01201       const PString & name,
    01202       const PBYTEArray & octets
    01203     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionOctets(name, octets); }
    01204     bool SetOptionOctets(
    01205       const PString & name,
    01206       const BYTE * data,
    01207       PINDEX length
    01208     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->SetOptionOctets(name, data, length); }
    01209
    01212     static OpalMediaFormatList GetAllRegisteredMediaFormats();
    01213     static void GetAllRegisteredMediaFormats(
    01214       OpalMediaFormatList & copy
    01215     );
    01216
    01220     static bool SetRegisteredMediaFormat(
    01221       const OpalMediaFormat & mediaFormat
    01222     );
    01223
    01227     static bool RemoveRegisteredMediaFormat(
    01228       const OpalMediaFormat & mediaFormat
    01229     );
    01230
    01234     bool AddOption(
    01235       OpalMediaOption * option,
    01236       PBoolean overwrite = false
    01237     ) { PWaitAndSignal m(m_mutex); MakeUnique(); return m_info != NULL && m_info->AddOption(option, overwrite); }
    01238
    01242     bool HasOption(const PString & name) const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->FindOption(name) != NULL; }
    01243
    01247     OpalMediaOption * FindOption(
    01248       const PString & name
    01249     ) const { PWaitAndSignal m(m_mutex); return m_info == NULL ? NULL : m_info->FindOption(name); }
    01250
    01254     template <class T> T * FindOptionAs(
    01255       const PString & name
    01256     ) const { return dynamic_cast<T *>(FindOption(name)); }
    01257
    01263     bool IsValidForProtocol(const PString & protocol) const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->IsValidForProtocol(protocol); }
    01264
    01265     time_t GetCodecVersionTime() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? 0 : m_info->codecVersionTime; }
    01266
    01267     ostream & PrintOptions(ostream & strm) const
    01268     {
    01269       PWaitAndSignal m(m_mutex);
    01270       if (m_info != NULL)
    01271         strm << setw(-1) << *m_info;
    01272       return strm;
    01273     }
    01274
    01275 #if OPAL_VIDEO
    01276
    01278     void AdjustVideoArgs(
    01279       PVideoDevice::OpenArgs & args
    01280     ) const;
    01281 #endif
    01282
    01283     // Backward compatibility
    01284     virtual PBoolean IsEmpty() const { PWaitAndSignal m(m_mutex); return m_info == NULL || !m_info->IsValid(); }
    01285     operator PString() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? "" : m_info->formatName; }
    01286     operator const char *() const { PWaitAndSignal m(m_mutex); return m_info == NULL ? "" : m_info->formatName; }
    01287     bool operator==(const char * other) const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->formatName == other; }
    01288     bool operator!=(const char * other) const { PWaitAndSignal m(m_mutex); return m_info == NULL || m_info->formatName != other; }
    01289     bool operator==(const PString & other) const { PWaitAndSignal m(m_mutex); return m_info != NULL && m_info->formatName == other; }
    01290     bool operator!=(const PString & other) const { PWaitAndSignal m(m_mutex); return m_info == NULL || m_info->formatName != other; }
    01291     bool operator==(const OpalMediaFormat & other) const { PWaitAndSignal m(m_mutex); return Compare(other) == EqualTo; }
    01292     bool operator!=(const OpalMediaFormat & other) const { PWaitAndSignal m(m_mutex); return Compare(other) != EqualTo; }
    01293     friend bool operator==(const char * other, const OpalMediaFormat & fmt) { return fmt.m_info != NULL && fmt.m_info->formatName == other; }
    01294     friend bool operator!=(const char * other, const OpalMediaFormat & fmt) { return fmt.m_info == NULL || fmt.m_info->formatName != other; }
    01295     friend bool operator==(const PString & other, const OpalMediaFormat & fmt) { return fmt.m_info != NULL && fmt.m_info->formatName == other; }
    01296     friend bool operator!=(const PString & other, const OpalMediaFormat & fmt) { return fmt.m_info == NULL || fmt.m_info->formatName != other; }
    01297
    01298 #if OPAL_H323
    01299     static const PString & MediaPacketizationOption();
    01300     static const PString & MediaPacketizationsOption();
    01301     PStringArray GetMediaPacketizations() const;
    01302     PStringSet GetMediaPacketizationSet() const { return PStringSet(GetMediaPacketizations()); }
    01303     void SetMediaPacketizations(const PStringSet & packetizations);
    01304 #endif
    01305
    01306   private:
    01307     PBoolean SetSize(PINDEX) { return true; }
    01308
    01309   protected:
    01310     void Construct(OpalMediaFormatInternal * info);
    01311
    01312     OpalMediaFormatInternal * m_info;
    01313     PMutex                    m_mutex;
    01314
    01315   friend class OpalMediaFormatInternal;
    01316   friend class OpalMediaFormatList;
    01317 };
    01318
    01319
    01320 class OpalAudioFormatInternal : public OpalMediaFormatInternal
    01321 {
    01322   public:
    01323     OpalAudioFormatInternal(
    01324       const char * fullName,
    01325       RTP_DataFrame::PayloadTypes rtpPayloadType,
    01326       const char * encodingName,
    01327       PINDEX   frameSize,
    01328       unsigned frameTime,
    01329       unsigned rxFrames,
    01330       unsigned txFrames,
    01331       unsigned maxFrames,
    01332       unsigned clockRate,
    01333       time_t timeStamp = 0
    01334     );
    01335     virtual PObject * Clone() const;
    01336     virtual bool Merge(const OpalMediaFormatInternal & mediaFormat);
    01337 };
    01338
    01339 class OpalAudioFormat : public OpalMediaFormat
    01340 {
    01341     PCLASSINFO(OpalAudioFormat, OpalMediaFormat);
    01342   public:
    01343     OpalAudioFormat(
    01344       OpalMediaFormatInternal * info = NULL
    01345     ) : OpalMediaFormat(info) { }
    01346     OpalAudioFormat(
    01347       const char * fullName,
    01348       RTP_DataFrame::PayloadTypes rtpPayloadType,
    01349       const char * encodingName,
    01350       PINDEX   frameSize,
    01351       unsigned frameTime,
    01352       unsigned rxFrames,
    01353       unsigned txFrames,
    01354       unsigned maxFrames = 256,
    01355       unsigned clockRate = 8000,
    01356       time_t timeStamp = 0
    01357     );
    01358
    01359     static const PString & RxFramesPerPacketOption();
    01360     static const PString & TxFramesPerPacketOption();
    01361     static const PString & MaxFramesPerPacketOption();
    01362     static const PString & ChannelsOption();
    01363 };
    01364
    01365 #if OPAL_VIDEO
    01366 class OpalVideoFormatInternal : public OpalMediaFormatInternal
    01367 {
    01368   public:
    01369     OpalVideoFormatInternal(
    01370       const char * fullName,
    01371       RTP_DataFrame::PayloadTypes rtpPayloadType,
    01372       const char * encodingName,
    01373       unsigned maxFrameWidth,
    01374       unsigned maxFrameHeight,
    01375       unsigned maxFrameRate,
    01376       unsigned maxBitRate,
    01377       time_t timeStamp = 0
    01378     );
    01379     virtual PObject * Clone() const;
    01380     virtual bool Merge(const OpalMediaFormatInternal & mediaFormat);
    01381 };
    01382
    01383
    01384 class OpalVideoFormat : public OpalMediaFormat
    01385 {
    01386     PCLASSINFO(OpalVideoFormat, OpalMediaFormat);
    01387   public:
    01388     OpalVideoFormat(
    01389       OpalMediaFormatInternal * info = NULL
    01390     ) : OpalMediaFormat(info) { }
    01391     OpalVideoFormat(
    01392       const char * fullName,
    01393       RTP_DataFrame::PayloadTypes rtpPayloadType,
    01394       const char * encodingName,
    01395       unsigned maxFrameWidth,
    01396       unsigned maxFrameHeight,
    01397       unsigned maxFrameRate,
    01398       unsigned maxBitRate,
    01399       time_t timeStamp = 0
    01400     );
    01401
    01402     static const PString & FrameWidthOption();
    01403     static const PString & FrameHeightOption();
    01404     static const PString & MinRxFrameWidthOption();
    01405     static const PString & MinRxFrameHeightOption();
    01406     static const PString & MaxRxFrameWidthOption();
    01407     static const PString & MaxRxFrameHeightOption();
    01408     static const PString & TemporalSpatialTradeOffOption();
    01409     static const PString & TxKeyFramePeriodOption();
    01410     static const PString & RateControlPeriodOption(); // Period over which the rate controller maintains the target bit rate.
    01411     static const PString & RateControllerOption(); // String for controller algorithm. Empty is none.
    01412
    01423     P_DECLARE_STREAMABLE_ENUM(ContentRole,
    01424       eNoRole,
    01425       ePresentation,
    01426       eMainRole,
    01427       eSpeaker,
    01428       eSignLanguage
    01429     );
    01430
    01431     enum { ContentRoleMask = 15 };
    01432     __inline static unsigned ContentRoleBit(ContentRole contentRole) { return contentRole != eNoRole ? (1<<(contentRole-1)) : 0; }
    01433     static const PString & ContentRoleOption();
    01434     static const PString & ContentRoleMaskOption();
    01435
    01437     P_DECLARE_STREAMABLE_BITWISE_ENUM_EX(
    01438       RTCPFeedback,
    01439       5,
    01440       (
    01441         e_NoRTCPFb,
    01442         e_PLI,
    01443         e_FIR,
    01444         e_TMMBR,
    01445         e_TSTR,
    01446         e_VBCM
    01447       ),
    01448       "", "pli", "fir", "tmmbr", "tstr", "vcbm"
    01449     );
    01451     static const PString & RTCPFeedbackOption();
    01452 };
    01453 #endif
    01454
    01455
    01456 #include <codec/known.h>
    01457
    01458
    01459 extern const OpalAudioFormat & GetOpalPCM16();
    01460 extern const OpalAudioFormat & GetOpalPCM16S();
    01461 extern const OpalAudioFormat & GetOpalPCM16_16KHZ();
    01462 extern const OpalAudioFormat & GetOpalPCM16S_16KHZ();
    01463 extern const OpalAudioFormat & GetOpalPCM16_32KHZ();
    01464 extern const OpalAudioFormat & GetOpalPCM16S_32KHZ();
    01465 extern const OpalAudioFormat & GetOpalPCM16_48KHZ();
    01466 extern const OpalAudioFormat & GetOpalPCM16S_48KHZ();
    01467 extern const OpalAudioFormat & GetOpalL16_MONO_8KHZ();
    01468 extern const OpalAudioFormat & GetOpalL16_STEREO_8KHZ();
    01469 extern const OpalAudioFormat & GetOpalL16_MONO_16KHZ();
    01470 extern const OpalAudioFormat & GetOpalL16_STEREO_16KHZ();
    01471 extern const OpalAudioFormat & GetOpalL16_MONO_32KHZ();
    01472 extern const OpalAudioFormat & GetOpalL16_STEREO_32KHZ();
    01473 extern const OpalAudioFormat & GetOpalL16_MONO_48KHZ();
    01474 extern const OpalAudioFormat & GetOpalL16_STEREO_48KHZ();
    01475 extern const OpalAudioFormat & GetOpalG711_ULAW_64K();
    01476 extern const OpalAudioFormat & GetOpalG711_ALAW_64K();
    01477 extern const OpalAudioFormat & GetOpalG722();
    01478 extern const OpalAudioFormat & GetOpalG7221_24K();
    01479 extern const OpalAudioFormat & GetOpalG7221_32K();
    01480 extern const OpalAudioFormat & GetOpalG7221_48K();
    01481 extern const OpalAudioFormat & GetOpalG7222();
    01482 extern const OpalAudioFormat & GetOpalG726_40K();
    01483 extern const OpalAudioFormat & GetOpalG726_32K();
    01484 extern const OpalAudioFormat & GetOpalG726_24K();
    01485 extern const OpalAudioFormat & GetOpalG726_16K();
    01486 extern const OpalAudioFormat & GetOpalG728();
    01487 extern const OpalAudioFormat & GetOpalG729();
    01488 extern const OpalAudioFormat & GetOpalG729A();
    01489 extern const OpalAudioFormat & GetOpalG729B();
    01490 extern const OpalAudioFormat & GetOpalG729AB();
    01491 extern const OpalAudioFormat & GetOpalG7231_6k3();
    01492 extern const OpalAudioFormat & GetOpalG7231_5k3();
    01493 extern const OpalAudioFormat & GetOpalG7231A_6k3();
    01494 extern const OpalAudioFormat & GetOpalG7231A_5k3();
    01495 extern const OpalAudioFormat & GetOpalGSM0610();
    01496 extern const OpalAudioFormat & GetOpalGSMAMR();
    01497 extern const OpalAudioFormat & GetOpaliLBC();
    01498
    01499 #if OPAL_VIDEO
    01500 extern const OpalVideoFormat & GetOpalH261();
    01501 extern const OpalVideoFormat & GetOpalH263();
    01502 extern const OpalVideoFormat & GetOpalH263plus();
    01503 extern const OpalVideoFormat & GetOpalH264_MODE0();
    01504 extern const OpalVideoFormat & GetOpalH264_MODE1();
    01505 extern const OpalVideoFormat & GetOpalMPEG4();
    01506 #endif // OPAL_VIDEO
    01507
    01508 extern const OpalMediaFormat & GetOpalRFC2833();
    01509
    01510 #if OPAL_T38_CAPABILITY
    01511 extern const OpalMediaFormat & GetOpalCiscoNSE();
    01512 extern const OpalMediaFormat & GetOpalT38();
    01513 #endif
    01514
    01515
    01516 #define OpalPCM16          GetOpalPCM16()
    01517 #define OpalPCM16S         GetOpalPCM16S()
    01518 #define OpalPCM16_16KHZ    GetOpalPCM16_16KHZ()
    01519 #define OpalPCM16S_16KHZ   GetOpalPCM16S_16KHZ()
    01520 #define OpalPCM16_32KHZ    GetOpalPCM16_32KHZ()
    01521 #define OpalPCM16S_32KHZ   GetOpalPCM16S_32KHZ()
    01522 #define OpalPCM16_48KHZ    GetOpalPCM16_48KHZ()
    01523 #define OpalPCM16S_48KHZ   GetOpalPCM16S_48KHZ()
    01524 #define OpalL16_MONO_8KHZ  GetOpalL16_MONO_8KHZ()
    01525 #define OpalL16_STEREO_8KHZ GetOpalL16_STEREO_8KHZ()
    01526 #define OpalL16_MONO_16KHZ GetOpalL16_MONO_16KHZ()
    01527 #define OpalL16_STEREO_16KHZ GetOpalL16_STEREO_16KHZ()
    01528 #define OpalL16_MONO_32KHZ GetOpalL16_MONO_32KHZ()
    01529 #define OpalL16_STEREO_32KHZ GetOpalL16_STEREO_32KHZ()
    01530 #define OpalL16_MONO_48KHZ GetOpalL16_MONO_48KHZ()
    01531 #define OpalL16_STEREO_48KHZ GetOpalL16_STEREO_48KHZ()
    01532 #define OpalG711_ULAW_64K  GetOpalG711_ULAW_64K()
    01533 #define OpalG711_ALAW_64K  GetOpalG711_ALAW_64K()
    01534 #define OpalG722           GetOpalG722()
    01535 #define OpalG7221          OpalG7221_32K
    01536 #define OpalG7221_24K      GetOpalG7221_24K()
    01537 #define OpalG7221_32K      GetOpalG7221_32K()
    01538 #define OpalG7221_48K      GetOpalG7221_48K()
    01539 #define OpalG7222          GetOpalG7222()
    01540 #define OpalG726_40K       GetOpalG726_40K()
    01541 #define OpalG726_32K       GetOpalG726_32K()
    01542 #define OpalG726_24K       GetOpalG726_24K()
    01543 #define OpalG726_16K       GetOpalG726_16K()
    01544 #define OpalG728           GetOpalG728()
    01545 #define OpalG729           GetOpalG729()
    01546 #define OpalG729A          GetOpalG729A()
    01547 #define OpalG729B          GetOpalG729B()
    01548 #define OpalG729AB         GetOpalG729AB()
    01549 #define OpalG7231_6k3      GetOpalG7231_6k3()
    01550 #define OpalG7231_5k3      GetOpalG7231_5k3()
    01551 #define OpalG7231A_6k3     GetOpalG7231A_6k3()
    01552 #define OpalG7231A_5k3     GetOpalG7231A_5k3()
    01553 #define OpalGSM0610        GetOpalGSM0610()
    01554 #define OpalGSMAMR         GetOpalGSMAMR()
    01555 #define OpaliLBC           GetOpaliLBC()
    01556 #define OpalRFC2833        GetOpalRFC2833()
    01557 #define OpalCiscoNSE       GetOpalCiscoNSE()
    01558 #define OpalT38            GetOpalT38()
    01559
    01560 #if OPAL_VIDEO
    01561 #define OpalH261       GetOpalH261()
    01562 #define OpalH263       GetOpalH263()
    01563 #define OpalH263plus   GetOpalH263plus()
    01564 #define OpalH264       GetOpalH264_MODE1()
    01565 #define OpalH264_MODE0 GetOpalH264_MODE0()
    01566 #define OpalH264_MODE1 GetOpalH264_MODE1()
    01567 #define OpalMPEG4      GetOpalMPEG4()
    01568 #endif
    01569
    01570 #define OpalL16Mono8kHz    OpalL16_MONO_8KHZ
    01571 #define OpalL16Mono16kHz   OpalL16_MONO_16KHZ
    01572 #define OpalG711uLaw       OpalG711_ULAW_64K
    01573 #define OpalG711ALaw       OpalG711_ALAW_64K
    01574
    01575
    01576 #endif  // OPAL_OPAL_MEDIAFMT_H
    01577
    01578
    01579 // End of File ///////////////////////////////////////////////////////////////