sipxmedialib  Version 3.3
MprDecodeConstructor.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2008 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2008 SIPez LLC.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 // Author: Alexander Chemeris <Alexander DOT Chemeris AT SIPez DOT com>
12 
13 #ifndef _MprDecodeConstructor_h_
14 #define _MprDecodeConstructor_h_
15 
16 // SYSTEM INCLUDES
17 // APPLICATION INCLUDES
19 #include <mp/MprDecode.h>
20 #include <mp/MprDejitter.h>
21 
22 // DEFINES
23 // MACROS
24 // EXTERNAL FUNCTIONS
25 // EXTERNAL VARIABLES
26 // CONSTANTS
27 // STRUCTS
28 // TYPEDEFS
29 // FORWARD DECLARATIONS
30 
35 {
36 /* //////////////////////////// PUBLIC //////////////////////////////////// */
37 public:
38 
39 /* ============================ CREATORS ================================== */
40 
44  1, 1, //minInputs, maxInputs,
45  1, 1) //minOutputs, maxOutputs
46  {
47  }
48 
50  virtual ~MprDecodeConstructor() {}
51 
52 /* ============================ MANIPULATORS ============================== */
53 
55  virtual OsStatus newResource(const UtlString& resourceName,
56  int maxResourcesToCreate,
57  int& numResourcesCreated,
58  MpResource* resourceArray[])
59  {
60  MprDecode *pDecode = new MprDecode(resourceName);
61 
62  // Attach dejitter
63  MprDejitter *pDejitter = new MprDejitter();
64  pDecode->setMyDejitter(pDejitter, TRUE);
65 
66  // Return created resource
67  assert(maxResourcesToCreate >= 1);
68  numResourcesCreated = 1;
69  resourceArray[0] = pDecode;
70  resourceArray[0]->disable();
71 
72  return OS_SUCCESS;
73  }
74 
75 /* ============================ ACCESSORS ================================= */
76 
77 /* ============================ INQUIRY =================================== */
78 
79 /* //////////////////////////// PROTECTED ///////////////////////////////// */
80 protected:
81 
82 /* //////////////////////////// PRIVATE /////////////////////////////////// */
83 private:
84 
86  MprDecodeConstructor(const MprDecodeConstructor& rMprDecodeConstructor);
87 
90 
91 };
92 
93 /* ============================ INLINE METHODS ============================ */
94 
95 #endif // _MprDecodeConstructor_h_
MprDecodeConstructor is used to construct a Decode resource.
Definition: MprDecodeConstructor.h:34
#define DEFAULT_DECODE_RESOURCE_TYPE
Definition: MpResourceFactory.h:31
MprDecodeConstructor & operator=(const MprDecodeConstructor &rhs)
Disabled assignment operator.
virtual UtlBoolean disable()
Disable this resource.
Definition: MpResource.cpp:121
void setMyDejitter(MprDejitter *newDJ, UtlBoolean ownDj)
Pair this decode resource with the dejitter resource.
Definition: MprDecode.cpp:221
The "Decode" media processing resource.
Definition: MprDecode.h:45
MprDecodeConstructor()
Constructor.
Definition: MprDecodeConstructor.h:42
virtual OsStatus newResource(const UtlString &resourceName, int maxResourcesToCreate, int &numResourcesCreated, MpResource *resourceArray[])
Create a new resource.
Definition: MprDecodeConstructor.h:55
Abstract base class for all media processing objects.
Definition: MpResource.h:56
MpAudioResourceConstructor is used to construct a specific audio resource type.
Definition: MpAudioResourceConstructor.h:36
The "Dejitter" utility class.
Definition: MprDejitter.h:39
#define TRUE
Definition: PlgDefsV1.h:41
virtual ~MprDecodeConstructor()
Destructor.
Definition: MprDecodeConstructor.h:50