digiKam
DigikamGenericMjpegStreamPlugin::MjpegServer::Private Class Reference
+ Inheritance diagram for DigikamGenericMjpegStreamPlugin::MjpegServer::Private:

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...
 

Detailed Description

MJPEG Server private container. Internal use only.

Constructor & Destructor Documentation

◆ Private()

DigikamGenericMjpegStreamPlugin::MjpegServer::Private::Private ( QObject *const  parent)
explicit

◆ ~Private()

DigikamGenericMjpegStreamPlugin::MjpegServer::Private::~Private ( )

Member Function Documentation

◆ clientDescription()

QString DigikamGenericMjpegStreamPlugin::MjpegServer::Private::clientDescription ( QTcpSocket *const  client) const

Return an human readable description of client connected through a socket.

◆ close()

void DigikamGenericMjpegStreamPlugin::MjpegServer::Private::close ( )

◆ isOpened()

bool DigikamGenericMjpegStreamPlugin::MjpegServer::Private::isOpened ( ) const

Return true if the server is running.

◆ maxClients()

int DigikamGenericMjpegStreamPlugin::MjpegServer::Private::maxClients ( ) const

◆ open()

bool DigikamGenericMjpegStreamPlugin::MjpegServer::Private::open ( const QString &  address,
int  port 
)

Initialize the server.

Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::MjpegServer().

◆ setMaxClients()

void DigikamGenericMjpegStreamPlugin::MjpegServer::Private::setMaxClients ( int  max)

◆ start()

void DigikamGenericMjpegStreamPlugin::MjpegServer::Private::start ( )

Start the server (aka listening on network).

Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::start().

◆ stop()

void DigikamGenericMjpegStreamPlugin::MjpegServer::Private::stop ( )

Stop the server (aka not listening on network).

Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::stop().

◆ writeInSocket()

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.

Member Data Documentation

◆ blackList

QStringList DigikamGenericMjpegStreamPlugin::MjpegServer::Private::blackList

◆ clients

QList<QTcpSocket*> DigikamGenericMjpegStreamPlugin::MjpegServer::Private::clients

list of client connected sockets.

◆ delay

int DigikamGenericMjpegStreamPlugin::MjpegServer::Private::delay

delay between frames in us (1E6/rate).

Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::setRate().

◆ lastFrame

QByteArray DigikamGenericMjpegStreamPlugin::MjpegServer::Private::lastFrame

the current JPEG frame to dispatch to all connected clients.

Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::slotWriteFrame().

◆ mutexClients

QMutex DigikamGenericMjpegStreamPlugin::MjpegServer::Private::mutexClients

to protect current clients list.

◆ mutexFrame

QMutex DigikamGenericMjpegStreamPlugin::MjpegServer::Private::mutexFrame

to protect current frame data.

Referenced by DigikamGenericMjpegStreamPlugin::MjpegServer::slotWriteFrame().

◆ rate

int DigikamGenericMjpegStreamPlugin::MjpegServer::Private::rate

◆ server

QTcpServer* DigikamGenericMjpegStreamPlugin::MjpegServer::Private::server

main tcp/ip server.

◆ srvTask

QFuture<void> DigikamGenericMjpegStreamPlugin::MjpegServer::Private::srvTask

server threaded task used to stream on clients.


The documentation for this class was generated from the following files: