OPAL  Version 3.14.3
mediacmd.h
Go to the documentation of this file.
1 /*
2  * mediacmd.h
3  *
4  * Abstractions for sending commands to media processors.
5  *
6  * Open Phone Abstraction Library (OPAL)
7  * Formally known as the Open H323 project.
8  *
9  * Copyright (c) 2001 Equivalence Pty. Ltd.
10  *
11  * The contents of this file are subject to the Mozilla Public License
12  * Version 1.0 (the "License"); you may not use this file except in
13  * compliance with the License. You may obtain a copy of the License at
14  * http://www.mozilla.org/MPL/
15  *
16  * Software distributed under the License is distributed on an "AS IS"
17  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
18  * the License for the specific language governing rights and limitations
19  * under the License.
20  *
21  * The Original Code is Open Phone Abstraction Library.
22  *
23  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
24  *
25  * Contributor(s): ______________________________________.
26  */
27 
28 #ifndef OPAL_OPAL_MEDIACMD_H
29 #define OPAL_OPAL_MEDIACMD_H
30 
31 #ifdef P_USE_PRAGMA
32 #pragma interface
33 #endif
34 
35 #include <opal_config.h>
36 
38 
43 class OpalMediaCommand : public PObject
44 {
45  PCLASSINFO(OpalMediaCommand, PObject);
46  public:
53  virtual void PrintOn(
54  ostream & strm
55  ) const;
56 
68  virtual Comparison Compare(
69  const PObject & obj
70  ) const;
71 
72  // Redefine as pure, derived classes from here MUST implment it.
73  virtual PObject * Clone() const = 0;
75 
80  virtual PString GetName() const = 0;
81 
84  virtual void * GetPlugInData() const;
85 
88  virtual unsigned * GetPlugInSize() const;
90 };
91 
92 
93 #define OPAL_DEFINE_MEDIA_COMMAND(cls, name) \
94  class cls : public OpalMediaCommand \
95  { \
96  PCLASSINFO_WITH_CLONE(cls, OpalMediaCommand) \
97  public: \
98  cls() { } \
99  virtual PString GetName() const { return name; } \
100  }
101 
102 
106 {
107  PCLASSINFO_WITH_CLONE(OpalMediaFlowControl, OpalMediaCommand);
108  public:
109  OpalMediaFlowControl(unsigned maxBitRate)
110  : m_maxBitRate(maxBitRate) { }
111 
112  virtual PString GetName() const;
113 
114  unsigned GetMaxBitRate() const { return m_maxBitRate; }
115 
116  protected:
117  unsigned m_maxBitRate;
118 };
119 
120 #endif // OPAL_OPAL_MEDIACMD_H
121 
122 
123 // End of File ///////////////////////////////////////////////////////////////