#include <Phonon/AbstractMediaStream>
Base class for custom media data streams.
Implement this class to provide a custom data stream to the backend. The class supports both, the push and the pull model.
Push:
Pull:
Definition at line 103 of file abstractmediastream.h.
Public Member Functions | |
virtual | ~AbstractMediaStream () |
Public Member Functions inherited from QObject | |
Q_INVOKABLE | QObject (QObject *parent=0) |
virtual | ~QObject () |
virtual bool | event (QEvent *) |
virtual bool | eventFilter (QObject *, QEvent *) |
QString | objectName () const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const |
bool | signalsBlocked () const |
bool | blockSignals (bool b) |
QThread * | thread () const |
void | moveToThread (QThread *thread) |
int | startTimer (int interval) |
void | killTimer (int id) |
template<typename T > | |
T | findChild (const QString &aName=QString()) const |
template<typename T > | |
QList< T > | findChildren (const QString &aName=QString()) const |
template<typename T > | |
QList< T > | findChildren (const QRegExp &re) const |
const QObjectList & | children () const |
void | setParent (QObject *) |
void | installEventFilter (QObject *) |
void | removeEventFilter (QObject *) |
bool | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0) |
bool | disconnect (const QObject *receiver, const char *member=0) |
void | dumpObjectTree () |
void | dumpObjectInfo () |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const |
QList< QByteArray > | dynamicPropertyNames () const |
void | setUserData (uint id, QObjectUserData *data) |
QObjectUserData * | userData (uint id) const |
QObject * | parent () const |
bool | inherits (const char *classname) const |
Protected Member Functions | |
AbstractMediaStream (QObject *parent=0) | |
Constructs an AbstractMediaStream object with a parent . More... | |
qint64 | streamSize () const |
Returns the stream size that was set with setStreamSize. More... | |
void | setStreamSize (qint64) |
Sets the size of the stream in number of bytes. More... | |
bool | streamSeekable () const |
Returns whether your data stream is set as seekable. More... | |
void | setStreamSeekable (bool) |
Sets whether your data stream is seekable. More... | |
void | writeData (const QByteArray &data) |
Sends the media data to the backend for decoding. More... | |
void | endOfData () |
Tells the backend that the media data stream is at its end. More... | |
void | error (Phonon::ErrorType errorType, const QString &errorString) |
If an I/O error occurs you should call this function to make MediaObject go into ErrorState. More... | |
virtual void | reset ()=0 |
Reimplement this function to reset the stream. More... | |
virtual void | needData ()=0 |
Reimplement this function to be notified when the backend needs data. More... | |
virtual void | enoughData () |
Reimplement this function to be notified when the backend has enough data and your stream object may take a break. More... | |
virtual void | seekStream (qint64 offset) |
Reimplement this function if your stream is seekable. More... | |
AbstractMediaStream (AbstractMediaStreamPrivate &dd, QObject *parent) | |
Protected Member Functions inherited from QObject | |
QObject * | sender () const |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
virtual void | timerEvent (QTimerEvent *) |
virtual void | childEvent (QChildEvent *) |
virtual void | customEvent (QEvent *) |
virtual void | connectNotify (const char *signal) |
virtual void | disconnectNotify (const char *signal) |
QObject (QObjectPrivate &dd, QObject *parent=0) | |
Protected Attributes | |
QScopedPointer< AbstractMediaStreamPrivate > | d_ptr |
Protected Attributes inherited from QObject | |
QScopedPointer< QObjectData > | d_ptr |
Friends | |
class | MediaObject |
class | MediaObjectPrivate |
class | StreamInterface |
Additional Inherited Members | |
Public Slots inherited from QObject | |
void | deleteLater () |
Signals inherited from QObject | |
void | destroyed (QObject *=0) |
Static Public Member Functions inherited from QObject | |
static bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
static bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static uint | registerUserData () |
Static Protected Attributes inherited from QObject | |
static const QMetaObject | staticQtMetaObject |
Properties inherited from QObject | |
QString | objectName |
|
virtual |
|
explicitprotected |
Constructs an AbstractMediaStream object with a parent
.
|
protected |
|
protected |
Returns the stream size that was set with setStreamSize.
A negative value means that the length of the stream cannot be known.
Defaults to 0
.
Sets the size of the stream in number of bytes.
A negative value means that the length of the stream cannot be known.
Defaults to 0.
This function has to be called. A backend will not call needData() until the stream size is set.
|
protected |
Returns whether your data stream is set as seekable.
Defaults to false
.
|
protected |
Sets whether your data stream is seekable.
Defaults to false
.
If you set this to true
you have to implement the seekStream function.
|
protected |
Sends the media data
to the backend for decoding.
|
protected |
Tells the backend that the media data stream is at its end.
|
protected |
If an I/O error occurs you should call this function to make MediaObject go into ErrorState.
Reimplement this function to reset the stream.
Subsequent calls to writeData should start from the first position of the data unless a seek is requested.
The function is necessary for the case where a non-seekable MediaStream is played more than once. For a seekable stream the implementation can simply call
.
|
protectedpure virtual |
Reimplement this function to be notified when the backend needs data.
When this function is called you should try to call writeData or endOfData before returning.
|
protectedvirtual |
Reimplement this function to be notified when the backend has enough data and your stream object may take a break.
This method is important for pushing data to the backend in order to not fill the backend buffer unnecessarily.
Reimplement this function if your stream is seekable.
When this function is called the next call to writeData has to be at the requested offset
.
|
friend |
Definition at line 107 of file abstractmediastream.h.
|
friend |
Definition at line 108 of file abstractmediastream.h.
|
friend |
Definition at line 109 of file abstractmediastream.h.
|
protected |
Definition at line 217 of file abstractmediastream.h.