MythTV
master
|
Stream content from a URI. More...
#include <libmythtv/mheg/netstream.h>
Public Types | |
enum | EMode : std::uint8_t { kNeverCache, kPreferCache, kAlwaysCache } |
Signals | |
void | ReadyRead (QObject *) |
void | Finished (QObject *) |
Public Member Functions | |
NetStream (const QUrl &url, EMode mode=kPreferCache, QByteArray cert=QByteArray()) | |
Network streaming request. More... | |
~NetStream () override | |
bool | IsOpen () const |
void | Abort () |
int | safe_read (void *data, unsigned sz, unsigned millisecs=0) |
qlonglong | Seek (qlonglong pos) |
qlonglong | GetReadPosition () const |
qlonglong | GetSize () const |
const QUrl & | Url () const |
bool | WaitTillReady (std::chrono::milliseconds timeout) |
Synchronous interface. More... | |
bool | WaitTillFinished (std::chrono::milliseconds timeout) |
QNetworkReply::NetworkError | GetError () const |
QString | GetErrorString () const |
qlonglong | BytesAvailable () const |
QByteArray | ReadAll () |
bool | isStarted () const |
Asynchronous interface. More... | |
bool | isReady () const |
bool | isFinished () const |
Static Public Member Functions | |
static bool | IsSupported (const QUrl &url) |
RingBuffer interface. More... | |
static QDateTime | GetLastModified (const QUrl &url) |
static bool | isAvailable () |
Public helpers. More... | |
Private Types | |
enum | : std::uint8_t { kClosed, kPending, kStarted, kReady, kFinished } |
Private Slots | |
void | slotRequestStarted (int id, QNetworkReply *reply) |
void | slotFinished () |
void | slotSslErrors (const QList< QSslError > &errors) |
void | slotReadyRead () |
Private Member Functions | |
bool | Request (const QUrl &url) |
Private Attributes | |
const int | m_id |
const QUrl | m_url |
QMutex | m_mutex |
QNetworkRequest | m_request |
enum NetStream:: { ... } | kClosed |
NetStreamRequest * | m_pending {nullptr} |
QNetworkReply * | m_reply {nullptr} |
int | m_nRedirections {0} |
qlonglong | m_size {-1} |
qlonglong | m_pos {0} |
QByteArray | m_cert |
QWaitCondition | m_ready |
QWaitCondition | m_finished |
Stream content from a URI.
Definition at line 31 of file netstream.h.
enum NetStream::EMode : std::uint8_t |
Enumerator | |
---|---|
kNeverCache | |
kPreferCache | |
kAlwaysCache |
Definition at line 36 of file netstream.h.
|
private |
Enumerator | |
---|---|
kClosed | |
kPending | |
kStarted | |
kReady | |
kFinished |
Definition at line 99 of file netstream.h.
|
explicit |
Network streaming request.
Definition at line 96 of file netstream.cpp.
|
override |
Definition at line 124 of file netstream.cpp.
|
static |
RingBuffer interface.
Definition at line 529 of file netstream.cpp.
Referenced by MythInteractiveBuffer::OpenFile(), and Request().
bool NetStream::IsOpen | ( | ) | const |
Definition at line 537 of file netstream.cpp.
Referenced by MythInteractiveBuffer::IsOpen(), and MythInteractiveBuffer::OpenFile().
void NetStream::Abort | ( | ) |
Definition at line 543 of file netstream.cpp.
Referenced by ~NetStream().
int NetStream::safe_read | ( | void * | data, |
unsigned | sz, | ||
unsigned | millisecs = 0 |
||
) |
Definition at line 568 of file netstream.cpp.
Referenced by MythInteractiveBuffer::SafeRead().
qlonglong NetStream::Seek | ( | qlonglong | pos | ) |
Definition at line 600 of file netstream.cpp.
Referenced by MythInteractiveBuffer::SeekInternal().
qlonglong NetStream::GetReadPosition | ( | ) | const |
Definition at line 621 of file netstream.cpp.
Referenced by MythInteractiveBuffer::GetReadPosition(), and MythInteractiveBuffer::SeekInternal().
qlonglong NetStream::GetSize | ( | ) | const |
Definition at line 628 of file netstream.cpp.
Referenced by MythInteractiveBuffer::GetRealFileSizeInternal(), and MythInteractiveBuffer::SeekInternal().
|
inline |
Definition at line 52 of file netstream.h.
bool NetStream::WaitTillReady | ( | std::chrono::milliseconds | timeout | ) |
Synchronous interface.
Definition at line 639 of file netstream.cpp.
Referenced by MythInteractiveBuffer::OpenFile().
bool NetStream::WaitTillFinished | ( | std::chrono::milliseconds | timeout | ) |
Definition at line 656 of file netstream.cpp.
Referenced by MHInteractionChannel::GetFile().
QNetworkReply::NetworkError NetStream::GetError | ( | ) | const |
Definition at line 673 of file netstream.cpp.
Referenced by MHInteractionChannel::GetFile().
QString NetStream::GetErrorString | ( | ) | const |
Definition at line 679 of file netstream.cpp.
qlonglong NetStream::BytesAvailable | ( | ) | const |
Definition at line 685 of file netstream.cpp.
QByteArray NetStream::ReadAll | ( | ) |
Definition at line 691 of file netstream.cpp.
Referenced by MHInteractionChannel::GetFile().
bool NetStream::isStarted | ( | ) | const |
Asynchronous interface.
Definition at line 706 of file netstream.cpp.
bool NetStream::isReady | ( | ) | const |
Definition at line 712 of file netstream.cpp.
bool NetStream::isFinished | ( | ) | const |
Definition at line 718 of file netstream.cpp.
|
signal |
Referenced by slotReadyRead().
|
signal |
Referenced by MHInteractionChannel::CheckFile(), MHInteractionChannel::GetFile(), and slotFinished().
|
static |
Definition at line 735 of file netstream.cpp.
Referenced by isCached().
|
static |
Public helpers.
Definition at line 728 of file netstream.cpp.
Referenced by MHInteractionChannel::status().
|
privateslot |
Definition at line 279 of file netstream.cpp.
Referenced by NetStream().
|
privateslot |
Definition at line 418 of file netstream.cpp.
Referenced by slotRequestStarted().
|
privateslot |
Definition at line 487 of file netstream.cpp.
Referenced by slotRequestStarted().
|
privateslot |
Definition at line 367 of file netstream.cpp.
Referenced by slotRequestStarted().
|
private |
Definition at line 159 of file netstream.cpp.
Referenced by NetStream(), Seek(), and slotFinished().
|
private |
Definition at line 94 of file netstream.h.
Referenced by Abort(), Request(), safe_read(), Seek(), slotFinished(), slotReadyRead(), slotRequestStarted(), and slotSslErrors().
|
private |
Definition at line 95 of file netstream.h.
Referenced by Url().
|
mutableprivate |
Definition at line 97 of file netstream.h.
Referenced by Abort(), BytesAvailable(), GetError(), GetErrorString(), GetReadPosition(), GetSize(), isFinished(), IsOpen(), isReady(), isStarted(), NetStream(), ReadAll(), safe_read(), Seek(), slotFinished(), slotReadyRead(), slotRequestStarted(), slotSslErrors(), WaitTillFinished(), WaitTillReady(), and ~NetStream().
|
private |
Definition at line 98 of file netstream.h.
Referenced by NetStream(), Request(), Seek(), and slotFinished().
enum { ... } NetStream::kClosed |
Referenced by IsOpen().
|
private |
Definition at line 101 of file netstream.h.
Referenced by Abort(), Request(), and slotRequestStarted().
|
private |
Definition at line 102 of file netstream.h.
Referenced by Abort(), BytesAvailable(), GetError(), GetErrorString(), ReadAll(), Request(), safe_read(), slotFinished(), slotReadyRead(), slotRequestStarted(), slotSslErrors(), and ~NetStream().
|
private |
Definition at line 103 of file netstream.h.
Referenced by slotFinished().
|
private |
Definition at line 104 of file netstream.h.
Referenced by GetSize(), Request(), safe_read(), Seek(), slotFinished(), and slotReadyRead().
|
private |
Definition at line 105 of file netstream.h.
Referenced by GetReadPosition(), ReadAll(), Request(), safe_read(), Seek(), and slotFinished().
|
private |
Definition at line 106 of file netstream.h.
Referenced by Request().
|
private |
Definition at line 107 of file netstream.h.
Referenced by safe_read(), slotReadyRead(), and WaitTillReady().
|
private |
Definition at line 108 of file netstream.h.
Referenced by slotFinished(), and WaitTillFinished().