/usr/include/sipxtapi/mp/MpPlgStaffV1.h is in libsipxtapi-dev 3.3.0~test17-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | //
// Copyright (C) 2007-2008 SIPez LLC.
// Licensed to SIPfoundry under a Contributor Agreement.
//
// Copyright (C) 2007-2008 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// $$
///////////////////////////////////////////////////////////////////////////////
// Author: Sergey Kostanbaev <Sergey DOT Kostanbaev AT sipez DOT com>
#ifndef _PlgStaff_h_
#define _PlgStaff_h_
// SYSTEM INCLUDES
// APPLICATION INCLUDES
#include <utl/UtlInt.h>
#include <utl/UtlVoidPtr.h>
#include <utl/UtlString.h>
#include <mp/codecs/PlgDefsV1.h>
// DEFINES
// MACROS
// EXTERNAL FUNCTIONS
// EXTERNAL VARIABLES
// CONSTANTS
// STRUCTS
// TYPEDEFS
// FORWARD DECLARATIONS
/**
* @brief Very simple single-linked list implementation, used by codecs' loading
* infrastructure.
*
* We do not use Utl* lists to avoid excessive locking and complexity they
* introduce.
*/
class MpStaticCodecSimpleList
{
public:
/* =============================== CREATORS =============================== */
///@name Creators
//@{
/// Default Constructor
inline
MpStaticCodecSimpleList();
//@}
/* ============================= MANIPULATORS ============================= */
///@name Manipulators
//@{
/// Add this element head of the list and return pointer to it.
inline
MpStaticCodecSimpleList* bound(MpStaticCodecSimpleList* newItem);
//@}
/* ============================== ACCESSORS =============================== */
///@name Accessors
//@{
/// Return pointer to next element.
inline
MpStaticCodecSimpleList* getNext() const;
//@}
/* =============================== INQUIRY ================================ */
///@name Inquiry
//@{
//@}
/* ////////////////////////////// PROTECTED /////////////////////////////// */
protected:
/* /////////////////////////////// PRIVATE //////////////////////////////// */
private:
MpStaticCodecSimpleList* mNext; ///< Pointer to next element in list.
};
/**
* @brief Object-oriented wrapper for codec.
*
* This class is used to provide object-oriented access to codecs, which are
* represented as a set of plain functions originally.
*/
class MpCodecCallInfoV1 : protected UtlVoidPtr, public MpStaticCodecSimpleList
{
public:
/* =============================== CREATORS =============================== */
///@name Creators
//@{
/// Constructor.
inline
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);
//@}
/* ============================= MANIPULATORS ============================= */
///@name Manipulators
//@{
//@}
/* ============================== ACCESSORS =============================== */
///@name Accessors
//@{
/// Return pointer to next codec in the list.
inline
MpCodecCallInfoV1* getNext() const;
/// Return module name.
inline
const UtlString& getModuleName() const;
//@}
/* =============================== INQUIRY ================================ */
///@name Inquiry
//@{
/// Is codec registered as static or dynamic?
inline
const UtlBoolean isStatic() const;
//@}
/* =============================== WRAPPERS =============================== */
///@name Wrappers
/// Pointers to actual functions, defined for this codec.
//@{
const dlPlgInitV1_2 mPlgInit;
const dlPlgGetInfoV1_1 mPlgGetInfo;
const dlPlgGetPacketSamplesV1_2 mPlgGetPacketSamples;
const dlPlgDecodeV1 mPlgDecode;
const dlPlgEncodeV1 mPlgEncode;
const dlPlgFreeV1 mPlgFree;
const dlPlgGetSignalingDataV1 mPlgSignaling;
//@}
/* ////////////////////////////// PROTECTED /////////////////////////////// */
protected:
UtlBoolean mbStatic; ///< Is codec compiled-in or dynamically loaded?
UtlString mModuleName; ///< Dynamic module name. Empty string for compiled-in codecs.
/* /////////////////////////////// PRIVATE //////////////////////////////// */
private:
};
/* ============================ INLINE METHODS ============================ */
/* ======================== MpStaticCodecSimpleList ======================= */
MpStaticCodecSimpleList::MpStaticCodecSimpleList()
: mNext(NULL)
{}
MpStaticCodecSimpleList* MpStaticCodecSimpleList::bound(MpStaticCodecSimpleList* newItem)
{
mNext = newItem;
return this;
}
MpStaticCodecSimpleList* MpStaticCodecSimpleList::getNext() const
{
return mNext;
}
/* =========================== MpCodecCallInfoV1 ========================== */
MpCodecCallInfoV1::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)
: mPlgInit(plgInit)
, mPlgGetInfo(plgGetInfo)
, mPlgGetPacketSamples(plgGetPacketSamples)
, mPlgDecode(plgDecode)
, mPlgEncode(plgEncode)
, mPlgFree(plgFree)
, mPlgSignaling(plgSignaling)
, mbStatic(bStatic)
, mModuleName(moduleName)
{}
const UtlBoolean MpCodecCallInfoV1::isStatic() const
{
return mbStatic;
}
MpCodecCallInfoV1* MpCodecCallInfoV1::getNext() const
{
return (MpCodecCallInfoV1*)MpStaticCodecSimpleList::getNext();
}
const UtlString& MpCodecCallInfoV1::getModuleName() const
{
return mModuleName;
}
#endif //_PlgStaff_h_
|