digiKam
|
Public Member Functions | |
QString | clientDescription (QTcpSocket *const client) const |
void | close () |
bool | isOpened () const |
int | maxClients () const |
bool | open (const QString &address, int port) |
Private (QObject *const parent) | |
void | setMaxClients (int) |
void | start () |
void | stop () |
int | writeInSocket (int sock, const QByteArray &data) const |
~Private () | |
Public Attributes | |
QStringList | blackList |
Clients Ip address list to ban. More... | |
QList< QTcpSocket * > | clients |
list of client connected sockets. More... | |
int | delay |
delay between frames in us (1E6/rate). More... | |
QByteArray | lastFrame |
the current JPEG frame to dispatch to all connected clients. More... | |
QMutex | mutexClients |
to protect current clients list. More... | |
QMutex | mutexFrame |
to protect current frame data. More... | |
int | rate |
stream frames rate per secs [1...30]. More... | |
QTcpServer * | server |
main tcp/ip server. More... | |
QFuture< void > | srvTask |
server threaded task used to stream on clients. More... | |
MJPEG Server private container. Internal use only.
|
explicit |
DigikamGenericMjpegStreamPlugin::MjpegServer::Private::~Private | ( | ) |
QString DigikamGenericMjpegStreamPlugin::MjpegServer::Private::clientDescription | ( | QTcpSocket *const | client | ) | const |
Return an human readable description of client connected through a socket.
void DigikamGenericMjpegStreamPlugin::MjpegServer::Private::close | ( | ) |
Shutdown the server.
Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::~MjpegServer().
bool DigikamGenericMjpegStreamPlugin::MjpegServer::Private::isOpened | ( | ) | const |
Return true if the server is running.
int DigikamGenericMjpegStreamPlugin::MjpegServer::Private::maxClients | ( | ) | const |
Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::maxClients().
bool DigikamGenericMjpegStreamPlugin::MjpegServer::Private::open | ( | const QString & | address, |
int | port | ||
) |
Initialize the server.
Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::MjpegServer().
void DigikamGenericMjpegStreamPlugin::MjpegServer::Private::setMaxClients | ( | int | max | ) |
Handle maximum clients connected to the server.
References DigikamGenericMjpegStreamPlugin::MjpegServer::maxClients().
Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::MjpegServer(), and DigikamGenericMjpegStreamPlugin::MjpegServer::setMaxClients().
void DigikamGenericMjpegStreamPlugin::MjpegServer::Private::start | ( | ) |
Start the server (aka listening on network).
Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::start().
void DigikamGenericMjpegStreamPlugin::MjpegServer::Private::stop | ( | ) |
Stop the server (aka not listening on network).
Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::stop().
int DigikamGenericMjpegStreamPlugin::MjpegServer::Private::writeInSocket | ( | int | sock, |
const QByteArray & | data | ||
) | const |
Write data in native socket file descriptor. We need to use native low level socket to write data inside from separated threads, as QTCPSocket only work with a single thread.
QStringList DigikamGenericMjpegStreamPlugin::MjpegServer::Private::blackList |
Clients Ip address list to ban.
Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::blackList(), and DigikamGenericMjpegStreamPlugin::MjpegServer::setBlackList().
QList<QTcpSocket*> DigikamGenericMjpegStreamPlugin::MjpegServer::Private::clients |
list of client connected sockets.
int DigikamGenericMjpegStreamPlugin::MjpegServer::Private::delay |
delay between frames in us (1E6/rate).
Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::setRate().
QByteArray DigikamGenericMjpegStreamPlugin::MjpegServer::Private::lastFrame |
the current JPEG frame to dispatch to all connected clients.
Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::slotWriteFrame().
QMutex DigikamGenericMjpegStreamPlugin::MjpegServer::Private::mutexClients |
to protect current clients list.
QMutex DigikamGenericMjpegStreamPlugin::MjpegServer::Private::mutexFrame |
to protect current frame data.
Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::slotWriteFrame().
int DigikamGenericMjpegStreamPlugin::MjpegServer::Private::rate |
stream frames rate per secs [1...30].
Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::rate(), and DigikamGenericMjpegStreamPlugin::MjpegServer::setRate().
QTcpServer* DigikamGenericMjpegStreamPlugin::MjpegServer::Private::server |
main tcp/ip server.
QFuture<void> DigikamGenericMjpegStreamPlugin::MjpegServer::Private::srvTask |
server threaded task used to stream on clients.