oprava dvojiteho connectu + smazani promenne url
[ctkuk.git] / StreamReciever.h
blob6ae6d4e47ed47d5468c52e85f384ccb480b815fc
1 #ifndef _STREAM_RECIEVER_H_
2 #define _STREAM_RECIEVER_H_
4 #include <QThread>
5 #include <QString>
6 #include <QBuffer>
7 #include <QReadWriteLock>
9 #include "StreamBuffer.h"
11 extern "C"
13 #include "mplayer/stream.h"
14 #include "mplayer/demuxer.h"
17 class StreamReciever : public QThread
19 Q_OBJECT
21 public:
22 StreamReciever(const QString &streamUrl);
23 ~StreamReciever();
25 void run();
27 qint64 getTotalPlayTime() const;
28 int getBufferSize() const;
29 QString getTempFileName() const;
31 signals:
32 void percentage(int value);
33 void loaded(qint64 value);
34 void bufferReady(const QString &file);
35 void bufferReady(StreamBuffer *buffer);
36 void error(QString errmsg);
38 private:
39 QString m_url;
40 QString m_tempFileName;
41 StreamBuffer *m_buffer;
42 QMutex m_mutex;
43 QReadWriteLock m_rwLock;
45 int m_bufferSize;
46 qint64 m_totalTime;
50 #endif // _STREAM_RECIEVER_H_