sipxmedialib  Version 3.3
StreamRAWFormatDecoder.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 _StreamRAWFormatDecoder_h_
17 #define _StreamRAWFormatDecoder_h_
18 
19 // SYSTEM INCLUDES
20 // APPLICATION INCLUDES
21 #include "utl/UtlDefs.h"
22 
24 #include "os/OsStatus.h"
25 #include "os/OsTask.h"
26 #include "os/OsBSem.h"
27 
28 // DEFINES
29 // MACROS
30 // EXTERNAL FUNCTIONS
31 // EXTERNAL VARIABLES
32 // CONSTANTS
33 // STRUCTS
34 // TYPEDEFS
35 // FORWARD DECLARATIONS
36 
37 //:A simple RAW format Decoder
39 {
40 /* //////////////////////////// PUBLIC //////////////////////////////////// */
41 public:
42 
43 /* ============================ CREATORS ================================== */
45 
47  //:Default constructor
48 
49 
50  virtual
52  //:Destructor
53 
55 
56 /* ============================ MANIPULATORS ============================== */
58 
59  virtual OsStatus init();
60  //:Initializes the decoder
61 
62  virtual OsStatus free();
63  //:Frees all resources consumed by the decoder
64 
65  virtual OsStatus begin();
66  //:Begins decoding
67 
68  virtual OsStatus end();
69  //:Ends decoding
70 
72 
73 /* ============================ ACCESSORS ================================= */
75 
76 
77  virtual OsStatus toString(UtlString& string);
78  //:Renders a string describing this decoder.
79  // This is often used for debugging purposes.
80 
82 
83 /* ============================ INQUIRY =================================== */
85 
86 
87  virtual UtlBoolean isDecoding();
88  //:Gets the decoding status. TRUE indicates decoding activity, false
89  //:indicates the decoder has completed.
90 
91  virtual UtlBoolean validDecoder();
92  //:Determines if this is a valid decoder given the associated data
93  //:source.
94  // The data source is "peeked" for data, so that the stream's
95  // data is not disturbed.
96 
97 
99 
100 /* //////////////////////////// PROTECTED ///////////////////////////////// */
101 protected:
102 
103  StreamRAWFormatDecoder(const StreamRAWFormatDecoder& rStreamRAWFormatDecoder);
104  //:Copy constructor (not supported)
105 
107  //:Assignment operator (not supported)
108 
109  int run(void* pArgs);
110  //:Thread entry point
111 
112 /* //////////////////////////// PRIVATE /////////////////////////////////// */
113 private:
114  UtlBoolean mbEnd ; // Has the decoder completed?
115  OsBSem mSemExited ; // Have we successfully exited?
116 };
117 
118 /* ============================ INLINE METHODS ============================ */
119 
120 #endif // _StreamRAWFormatDecoder_h_
121 
122 #endif // DISABLE_STREAM_PLAYER ]
virtual ~StreamRAWFormatDecoder()
Definition: StreamRAWFormatDecoder.cpp:39
An abstraction definition of a stream data source.
Definition: StreamDataSource.h:47
Definition: StreamRAWFormatDecoder.h:38
int run(void *pArgs)
Definition: StreamRAWFormatDecoder.cpp:158
virtual UtlBoolean validDecoder()
Definition: StreamRAWFormatDecoder.cpp:130
UtlBoolean mbEnd
Definition: StreamRAWFormatDecoder.h:114
virtual UtlBoolean isDecoding()
Definition: StreamRAWFormatDecoder.cpp:123
Definition: StreamQueueingFormatDecoder.h:41
virtual OsStatus end()
Definition: StreamRAWFormatDecoder.cpp:83
virtual OsStatus free()
Definition: StreamRAWFormatDecoder.cpp:53
virtual OsStatus begin()
Definition: StreamRAWFormatDecoder.cpp:60
virtual OsStatus toString(UtlString &string)
Definition: StreamRAWFormatDecoder.cpp:112
virtual OsStatus init()
Definition: StreamRAWFormatDecoder.cpp:46
StreamRAWFormatDecoder(StreamDataSource *pDataSource)
Definition: StreamRAWFormatDecoder.cpp:30
OsBSem mSemExited
Definition: StreamRAWFormatDecoder.h:115
StreamRAWFormatDecoder & operator=(const StreamRAWFormatDecoder &rhs)
Definition: StreamRAWFormatDecoder.cpp:148