# mediacmd.h

Go to the documentation of this file.

    00001 /*
    00002  * mediacmd.h
    00003  *
    00004  * Abstractions for sending commands to media processors.
    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 Phone Abstraction Library.
    00022  *
    00023  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
    00024  *
    00025  * Contributor(s): ______________________________________.
    00026  */
    00027
    00028 #ifndef OPAL_OPAL_MEDIACMD_H
    00029 #define OPAL_OPAL_MEDIACMD_H
    00030
    00031 #ifdef P_USE_PRAGMA
    00032 #pragma interface
    00033 #endif
    00034
    00035 #include <opal/buildopts.h>
    00036
    00038
    00043 class OpalMediaCommand : public PObject
    00044 {
    00045   PCLASSINFO(OpalMediaCommand, PObject);
    00046   public:
    00053     virtual void PrintOn(
    00054       ostream & strm
    00055     ) const;
    00056
    00068     virtual Comparison Compare(
    00069       const PObject & obj
    00070     ) const;
    00071
    00072     // Redefine as pure, derived classes from here MUST implment it.
    00073     virtual PObject * Clone() const = 0;
    00075
    00080     virtual PString GetName() const = 0;
    00081
    00084     virtual void * GetPlugInData() const;
    00085
    00088     virtual unsigned * GetPlugInSize() const;
    00090 };
    00091
    00092
    00093 #define OPAL_DEFINE_MEDIA_COMMAND(cls, name) \
    00094   class cls : public OpalMediaCommand \
    00095   { \
    00096       PCLASSINFO_WITH_CLONE(cls, OpalMediaCommand) \
    00097     public: \
    00098       cls() { } \
    00099       virtual PString GetName() const { return name; } \
    00100   }
    00101
    00102
    00105 class OpalMediaFlowControl : public OpalMediaCommand
    00106 {
    00107     PCLASSINFO_WITH_CLONE(OpalMediaFlowControl, OpalMediaCommand);
    00108   public:
    00109     OpalMediaFlowControl(unsigned maxBitRate)
    00110       : m_maxBitRate(maxBitRate)  { }
    00111
    00112     virtual PString GetName() const;
    00113
    00114     unsigned GetMaxBitRate() const { return m_maxBitRate; }
    00115
    00116   protected:
    00117     unsigned m_maxBitRate;
    00118 };
    00119
    00120 #endif // OPAL_OPAL_MEDIACMD_H
    00121
    00122
    00123 // End of File ///////////////////////////////////////////////////////////////