sipxmedialib  Version 3.3
MprFromStream.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2004-2006 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
9 // Licensed to SIPfoundry under a Contributor Agreement.
10 //
11 // $$
13 
14 #ifndef DISABLE_STREAM_PLAYER // [
15 
16 #ifndef _MprFromStream_h_
17 #define _MprFromStream_h_
18 
19 // SYSTEM INCLUDES
20 
21 // APPLICATION INCLUDES
22 #include "mp/dtmflib.h"
23 #include "mp/MpFlowGraphMsg.h"
24 #include "mp/MpAudioResource.h"
25 #include "mp/StreamDefs.h"
26 
27 #include "mp/MpStreamFeeder.h"
28 #include "os/OsLockingList.h"
29 
30 // DEFINES
31 // MACROS
32 // EXTERNAL FUNCTIONS
33 // EXTERNAL VARIABLES
34 // CONSTANTS
35 // STRUCTS
36 // TYPEDEFS
37 typedef struct tagSTREAMDESC
38 {
41 
42 } STREAMDESC ;
43 // FORWARD DECLARATIONS
44 
45 
48 
74 {
75 /* //////////////////////////// PUBLIC //////////////////////////////////// */
76 public:
77 
78 /* ============================ CREATORS ================================== */
80 
81 
82  MprFromStream(const UtlString& rName);
83  //:Constructor
84 
85  virtual
86  ~MprFromStream();
87  //:Destructor
88 
90 
91 /* ============================ MANIPULATORS ============================== */
93 
94 
95  OsStatus realize(Url urlSource,
96  int flags,
98  OsNotification* event = NULL);
99 
100  OsStatus realize(UtlString* pBuffer,
101  int flags,
102  StreamHandle &handle,
103  OsNotification* event = NULL);
104 
105  OsStatus prefetch(StreamHandle handle);
106 
107  OsStatus play(StreamHandle handle);
108 
109  OsStatus rewind(StreamHandle handle);
110 
111  OsStatus pause(StreamHandle handle);
112 
113  OsStatus stop(StreamHandle handle) ;
114 
115  OsStatus destroy(StreamHandle handle) ;
116 
117  OsStatus getFlags(StreamHandle handle, int& flags) ;
118 
120 
121 /* ============================ ACCESSORS ================================= */
123 
124 
126 
127 /* ============================ INQUIRY =================================== */
129 
130 
132 
133 /* //////////////////////////// PROTECTED ///////////////////////////////// */
134 protected:
135  OsStatus setStreamSource(MpStreamFeeder *pFeeder) ;
136  MpStreamFeeder* getStreamSource() ;
137 
138 /* //////////////////////////// PRIVATE /////////////////////////////////// */
139 private:
140  typedef enum
141  {
147  SOURCE_RENDER
148  } AddlMsgTypes;
149 
150 
151  OsNotification* mpNotify;
154  UtlBoolean mbStreamChange;
156  OsLockingList mStreamList;
157 
158  virtual UtlBoolean doProcessFrame(MpBufPtr inBufs[],
159  MpBufPtr outBufs[],
160  int inBufsSize,
161  int outBufsSize,
162  UtlBoolean isEnabled,
163  int samplesPerFrame,
164  int samplesPerSecond);
165 
167  virtual UtlBoolean handleMessage(MpFlowGraphMsg& rMsg);
168 
169  UtlBoolean handleRender(MpStreamFeeder* pFeeder);
170  UtlBoolean handlePlay(MpStreamFeeder* pFeeder);
171  UtlBoolean handleRewind(MpStreamFeeder* pFeeder);
172  UtlBoolean handlePause(MpStreamFeeder* pFeeder);
173  UtlBoolean handleStop(MpStreamFeeder* pFeeder);
174  UtlBoolean handleDestroy(MpStreamFeeder* pFeeder);
175 
176 
178  MprFromStream(const MprFromStream& rMprFromStream);
179 
181  MprFromStream& operator=(const MprFromStream& rhs);
182 
184  MpStreamFeeder* getStreamFeeder(StreamHandle handle) ;
185 
187  MpStreamFeeder* removeStreamFeeder(StreamHandle handle) ;
193  void destroyFeeders() ;
195 
196 };
197 
198 /* ============================ INLINE METHODS ============================ */
199 
200 #endif /* _MprFromStream_h_ */
201 
202 #endif // DISABLE_STREAM_PLAYER ]
Message object used to communicate with the media processing task.
Definition: MpFlowGraphMsg.h:33
FeederEvent mEventState
Definition: MprFromStream.h:153
Definition: MprFromStream.h:143
Definition: MprFromStream.h:145
int samplesPerFrame
OsLockingList mStreamList
List of stream players.
Definition: MprFromStream.h:156
MpStreamFeeder * pFeeder
Definition: MprFromStream.h:40
MpStreamFeeder * mpStreamRenderer
Definition: MprFromStream.h:152
Definition: MprFromStream.h:37
struct tagSTREAMDESC STREAMDESC
int samplesPerSecond
void * StreamHandle
Handles used by the renderer.
Definition: StreamDefs.h:42
The MpStreamFeed coordinates with the data source and decoder to ready the input stream and then plug...
Definition: MpStreamFeeder.h:90
AddlMsgTypes
Definition: MprFromStream.h:140
UtlBoolean mbStreamChange
Definition: MprFromStream.h:154
Abstract base class for all audio processing objects.
Definition: MpAudioResource.h:38
Definition: MprFromStream.h:144
Definition: MprFromStream.h:146
Smart pointer to MpBuf.
Definition: MpBuf.h:160
int miStreamCount
Count for generating unique handles.
Definition: MprFromStream.h:155
OsNotification * mpNotify
Definition: MprFromStream.h:151
StreamHandle handle
Definition: MprFromStream.h:39
FeederEvent
Definition: StreamDefs.h:44
start of resource-specific messages
Definition: MpFlowGraphMsg.h:67
This resource is an insertion point for the streaming infrastructure by connecting the flowgraph to M...
Definition: MprFromStream.h:73