14 #ifndef DISABLE_STREAM_PLAYER // [ 16 #ifndef _StreamHttpDataSource_h_ 17 #define _StreamHttpDataSource_h_ 23 #include "os/OsDefs.h" 24 #include "os/OsStatus.h" 25 #include "os/OsTask.h" 26 #include "os/OsBSem.h" 30 #define DEFAULT_BUFFER_SIZE 128*1024 37 class OsConnectionSocket ;
77 virtual OsStatus
open() ;
81 virtual OsStatus
close() ;
88 virtual OsStatus
read(
char *szBuffer,
int iLength,
int& iLengthRead) ;
95 virtual OsStatus
peek(
char* szBuffer,
int iLength,
int& iLengthRead) ;
112 virtual OsStatus
seek(
unsigned int iLocation);
119 UtlBoolean
deliverData(
char *szData,
int iLength,
int iMaxLength) ;
129 virtual OsStatus
getLength(
int& iLength);
135 virtual OsStatus
toString(UtlString&
string) ;
159 int run(
void *pArgs);
185 #endif // _StreamHttpDataSource_h_ 187 #endif // DISABLE_STREAM_PLAYER ] int run(void *pArgs)
Thread entry point.
Definition: StreamHttpDataSource.cpp:497
virtual OsStatus seek(unsigned int iLocation)
Moves the stream pointer to the an absolute location.
Definition: StreamHttpDataSource.cpp:301
UtlBoolean mbClosed
Have we closed this down?
Definition: StreamHttpDataSource.h:177
An abstraction definition of a stream data source.
Definition: StreamDataSource.h:47
OsBSem mSemNeedData
Used block when we need more data.
Definition: StreamHttpDataSource.h:165
static OsBSem sSemGuardDelete
Guard deletion of data sources.
Definition: StreamHttpDataSource.h:180
virtual int getBufferedLength()
Gets the amount of data presently buffered.
Definition: StreamHttpDataSource.cpp:484
unsigned int miMaxData
Max amount of data to buffer.
Definition: StreamHttpDataSource.h:172
virtual ~StreamHttpDataSource()
Destructor.
Definition: StreamHttpDataSource.cpp:65
UtlBoolean mbDeleteOnCompletion
Should the run method delete the object?
Definition: StreamHttpDataSource.h:171
virtual OsStatus close()
Closes the data source.
Definition: StreamHttpDataSource.cpp:117
UtlString mBuffer
Buffered content.
Definition: StreamHttpDataSource.h:164
UtlBoolean mbQuit
Are we quiting?
Definition: StreamHttpDataSource.h:170
StreamHttpDataSource(Url url, int iFlags)
Default constructor.
Definition: StreamHttpDataSource.cpp:42
virtual OsStatus peek(char *szBuffer, int iLength, int &iLengthRead)
Identical to read, except the stream pointer is not advanced.
Definition: StreamHttpDataSource.cpp:244
Url m_url
Source url.
Definition: StreamHttpDataSource.h:163
unsigned int miBufferOffset
Buffer offset from start of stream.
Definition: StreamHttpDataSource.h:175
Defines a stream data source built on top of a Http Stream.
Definition: StreamHttpDataSource.h:58
UtlBoolean mbFiredThrottledEvent
Should fire event on next throttle?
Definition: StreamHttpDataSource.h:176
UtlBoolean deliverData(char *szData, int iLength, int iMaxLength)
Callback routine that is invoked whenever new data is available from http socket. ...
Definition: StreamHttpDataSource.cpp:369
UtlBoolean(* GetDataCallbackProc)(char *pData, int iLength, void *pOptionalData, HttpMessage *pMsg)
Definition: StreamHttpDataSource.h:40
virtual OsStatus read(char *szBuffer, int iLength, int &iLengthRead)
Definition: StreamHttpDataSource.cpp:176
UtlBoolean mbInterrupt
Interrupt current operation?
Definition: StreamHttpDataSource.h:178
virtual OsStatus open()
Opens the data source.
Definition: StreamHttpDataSource.cpp:73
virtual OsStatus toString(UtlString &string)
Renders a string describing this data source.
Definition: StreamHttpDataSource.cpp:447
unsigned int miDSLength
Data Stream Length.
Definition: StreamHttpDataSource.h:173
OsBSem mSemGuardData
Protected data structures.
Definition: StreamHttpDataSource.h:167
OsBSem mSemLimitData
Used to block when need to throttle.
Definition: StreamHttpDataSource.h:166
OsBSem mSemGuardStartClose
Protected Opening/Closing the DataSource.
Definition: StreamHttpDataSource.h:168
virtual OsStatus interrupt()
Interrupts any time consuming operation.
Definition: StreamHttpDataSource.cpp:288
virtual OsStatus getPosition(int &iPosition)
Gets the current position within the stream.
Definition: StreamHttpDataSource.cpp:436
virtual OsStatus destroyAndDelete()
Destroys and deletes the data source object.
Definition: StreamHttpDataSource.cpp:152
virtual OsStatus getLength(int &iLength)
Gets the length of the stream (if available)
Definition: StreamHttpDataSource.cpp:422
StreamHttpDataSource & operator=(const StreamHttpDataSource &rhs)
Assignment operator (not supported)
Definition: StreamHttpDataSource.cpp:475
unsigned int miOffset
Present offset into the buffer.
Definition: StreamHttpDataSource.h:174
UtlBoolean mbDone
Is the data source complete.
Definition: StreamHttpDataSource.h:169