sipxmedialib  Version 3.3
MpPlgStaffV1.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007-2008 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2007-2008 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // $$
10 
11 // Author: Sergey Kostanbaev <Sergey DOT Kostanbaev AT sipez DOT com>
12 
13 #ifndef _PlgStaff_h_
14 #define _PlgStaff_h_
15 
16 // SYSTEM INCLUDES
17 // APPLICATION INCLUDES
18 #include <utl/UtlInt.h>
19 #include <utl/UtlVoidPtr.h>
20 #include <utl/UtlString.h>
21 #include <mp/codecs/PlgDefsV1.h>
22 
23 // DEFINES
24 // MACROS
25 // EXTERNAL FUNCTIONS
26 // EXTERNAL VARIABLES
27 // CONSTANTS
28 // STRUCTS
29 // TYPEDEFS
30 // FORWARD DECLARATIONS
31 
40 {
41 public:
42 /* =============================== CREATORS =============================== */
44 
45 
47  inline
49 
51 
52 /* ============================= MANIPULATORS ============================= */
54 
55 
57  inline
59 
61 
62 /* ============================== ACCESSORS =============================== */
64 
65 
67  inline
69 
71 
72 /* =============================== INQUIRY ================================ */
74 
75 
76 
78 
79 /* ////////////////////////////// PROTECTED /////////////////////////////// */
80 protected:
81 
82 
83 /* /////////////////////////////// PRIVATE //////////////////////////////// */
84 private:
86 };
87 
94 class MpCodecCallInfoV1 : protected UtlVoidPtr, public MpStaticCodecSimpleList
95 {
96 public:
97 /* =============================== CREATORS =============================== */
99 
100 
102  inline
103  MpCodecCallInfoV1(const char* moduleName,
104  const char* codecModuleName,
105  const dlPlgInitV1_2 plgInit,
106  const dlPlgGetInfoV1_1 plgGetInfo,
107  const dlPlgGetPacketSamplesV1_2 plgGetPacketSamples,
108  const dlPlgDecodeV1 plgDecode,
109  const dlPlgEncodeV1 plgEncode,
110  const dlPlgFreeV1 plgFree,
111  const dlPlgGetSignalingDataV1 plgSignaling,
112  UtlBoolean bStatic = TRUE);
113 
115 
116 /* ============================= MANIPULATORS ============================= */
118 
119 
121 
122 /* ============================== ACCESSORS =============================== */
124 
125 
127  inline
128  MpCodecCallInfoV1* getNext() const;
129 
131  inline
132  const UtlString& getModuleName() const;
133 
135 
136 /* =============================== INQUIRY ================================ */
138 
139 
141  inline
142  const UtlBoolean isStatic() const;
143 
145 
146 /* =============================== WRAPPERS =============================== */
149 
150 
158 
160 
161 /* ////////////////////////////// PROTECTED /////////////////////////////// */
162 protected:
163  UtlBoolean mbStatic;
164  UtlString mModuleName;
165 
166 /* /////////////////////////////// PRIVATE //////////////////////////////// */
167 private:
168 
169 };
170 
171 /* ============================ INLINE METHODS ============================ */
172 
173 /* ======================== MpStaticCodecSimpleList ======================= */
174 
176 : mNext(NULL)
177 {}
178 
180 {
181  mNext = newItem;
182  return this;
183 }
184 
186 {
187  return mNext;
188 }
189 
190 /* =========================== MpCodecCallInfoV1 ========================== */
191 
193  const char* codecModuleName,
194  const dlPlgInitV1_2 plgInit,
195  const dlPlgGetInfoV1_1 plgGetInfo,
196  const dlPlgGetPacketSamplesV1_2 plgGetPacketSamples,
197  const dlPlgDecodeV1 plgDecode,
198  const dlPlgEncodeV1 plgEncode,
199  const dlPlgFreeV1 plgFree,
200  const dlPlgGetSignalingDataV1 plgSignaling,
201  UtlBoolean bStatic)
202 : mPlgInit(plgInit)
203 , mPlgGetInfo(plgGetInfo)
204 , mPlgGetPacketSamples(plgGetPacketSamples)
205 , mPlgDecode(plgDecode)
206 , mPlgEncode(plgEncode)
207 , mPlgFree(plgFree)
208 , mPlgSignaling(plgSignaling)
209 , mbStatic(bStatic)
210 , mModuleName(moduleName)
211 {}
212 
213 const UtlBoolean MpCodecCallInfoV1::isStatic() const
214 {
215  return mbStatic;
216 }
217 
219 {
221 }
222 
223 const UtlString& MpCodecCallInfoV1::getModuleName() const
224 {
225  return mModuleName;
226 }
227 
228 #endif //_PlgStaff_h_
const dlPlgInitV1_2 mPlgInit
Definition: MpPlgStaffV1.h:151
int(* dlPlgDecodeV1)(void *handle, const void *pCodedData, unsigned cbCodedPacketSize, void *pAudioBuffer, unsigned cbBufferSize, unsigned *pcbDecodedSize, const struct RtpHeader *pRtpHeader)
Definition: PlgDefsV1.h:280
int(* dlPlgEncodeV1)(void *handle, const void *pAudioBuffer, unsigned cbAudioSamples, int *rSamplesConsumed, void *pCodedData, unsigned cbMaxCodedData, int *pcbCodedSize, unsigned *pbSendNow)
Definition: PlgDefsV1.h:283
const dlPlgDecodeV1 mPlgDecode
Definition: MpPlgStaffV1.h:154
MpCodecCallInfoV1(const char *moduleName, const char *codecModuleName, const dlPlgInitV1_2 plgInit, const dlPlgGetInfoV1_1 plgGetInfo, const dlPlgGetPacketSamplesV1_2 plgGetPacketSamples, const dlPlgDecodeV1 plgDecode, const dlPlgEncodeV1 plgEncode, const dlPlgFreeV1 plgFree, const dlPlgGetSignalingDataV1 plgSignaling, UtlBoolean bStatic=TRUE)
Constructor.
Definition: MpPlgStaffV1.h:192
const UtlString & getModuleName() const
Return module name.
Definition: MpPlgStaffV1.h:223
Very simple single-linked list implementation, used by codecs&#39; loading infrastructure.
Definition: MpPlgStaffV1.h:39
int(* dlPlgGetInfoV1_1)(const struct MppCodecInfoV1_1 **codecInfo)
Definition: PlgDefsV1.h:271
Object-oriented wrapper for codec.
Definition: MpPlgStaffV1.h:94
const dlPlgGetPacketSamplesV1_2 mPlgGetPacketSamples
Definition: MpPlgStaffV1.h:153
MpStaticCodecSimpleList * mNext
Pointer to next element in list.
Definition: MpPlgStaffV1.h:85
MpCodecCallInfoV1 * getNext() const
Return pointer to next codec in the list.
Definition: MpPlgStaffV1.h:218
const dlPlgGetInfoV1_1 mPlgGetInfo
Definition: MpPlgStaffV1.h:152
MpStaticCodecSimpleList * getNext() const
Return pointer to next element.
Definition: MpPlgStaffV1.h:185
MpStaticCodecSimpleList()
Default Constructor.
Definition: MpPlgStaffV1.h:175
UtlBoolean mbStatic
Is codec compiled-in or dynamically loaded?
Definition: MpPlgStaffV1.h:163
UtlString mModuleName
Dynamic module name. Empty string for compiled-in codecs.
Definition: MpPlgStaffV1.h:164
int(* dlPlgFreeV1)(void *handle, int isDecoder)
Definition: PlgDefsV1.h:286
const dlPlgGetSignalingDataV1 mPlgSignaling
Definition: MpPlgStaffV1.h:157
const dlPlgFreeV1 mPlgFree
Definition: MpPlgStaffV1.h:156
MpStaticCodecSimpleList * bound(MpStaticCodecSimpleList *newItem)
Add this element head of the list and return pointer to it.
Definition: MpPlgStaffV1.h:179
int(* dlPlgGetPacketSamplesV1_2)(void *handle, const uint8_t *pPacketData, unsigned packetSize, unsigned *pNumSamples, const struct RtpHeader *pRtpHeader)
Definition: PlgDefsV1.h:275
const dlPlgEncodeV1 mPlgEncode
Definition: MpPlgStaffV1.h:155
int(* dlPlgGetSignalingDataV1)(void *handle, uint32_t *outEvent, uint32_t *outDuration, uint32_t *startStatus, uint32_t *stopStatus)
Definition: PlgDefsV1.h:273
void *(* dlPlgInitV1_2)(const char *fmtp, int isDecoder, struct MppCodecFmtpInfoV1_2 *pCodecFmtpInfo)
Definition: PlgDefsV1.h:272
#define TRUE
Definition: PlgDefsV1.h:41
const UtlBoolean isStatic() const
Is codec registered as static or dynamic?
Definition: MpPlgStaffV1.h:213