digiKam
mjpegserver.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2021-07-24
7  * Description : a MJPEG Stream server to export items on the network.
8  *
9  * Copyright (C) 2021-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * ============================================================ */
22 
23 #ifndef DIGIKAM_MJPEG_SERVER_H
24 #define DIGIKAM_MJPEG_SERVER_H
25 
26 // Qt includes
27 
28 #include <QDebug>
29 #include <QImage>
30 #include <QObject>
31 
33 {
34 
36 typedef QMap<QString, QList<QUrl> > MjpegServerMap;
37 
38 class MjpegServer : public QObject
39 {
40  Q_OBJECT
41 
42 public:
43 
50  explicit MjpegServer(const QString& address = QString(),
51  int port = 8080,
52  QObject* const parent = nullptr);
53  ~MjpegServer();
54 
55 public:
56 
62  bool setRate(int);
63  int rate() const;
64 
69  bool setMaxClients(int);
70  int maxClients() const;
71 
75  void setBlackList(const QStringList& lst);
76  QStringList blackList() const;
77 
82  void start();
83  void stop();
84 
85 public Q_SLOTS:
86 
93  void slotWriteFrame(const QByteArray& frame);
94 
95 private:
96 
97  class Private;
98  Private* const d;
99 };
100 
101 } // namespace DigikamGenericMjpegStreamPlugin
102 
103 #endif // DIGIKAM_MJPEG_SERVER_H
QStringList blackList() const
Definition: mjpegserver.cpp:100
bool setMaxClients(int)
Definition: mjpegserver.cpp:77
bool setRate(int)
Definition: mjpegserver.cpp:57
MjpegServer(const QString &address=QString(), int port=8080, QObject *const parent=nullptr)
Definition: mjpegserver.cpp:40
int rate() const
Definition: mjpegserver.cpp:72
void slotWriteFrame(const QByteArray &frame)
Definition: mjpegserver.cpp:105
void stop()
Definition: mjpegserver.cpp:124
int maxClients() const
Definition: mjpegserver.cpp:90
~MjpegServer()
Definition: mjpegserver.cpp:50
void start()
Definition: mjpegserver.cpp:119
void setBlackList(const QStringList &lst)
Definition: mjpegserver.cpp:95
Definition: mjpegframeosd.cpp:45
QMap< QString, QList< QUrl > > MjpegServerMap
A kind of map of albums with urls contents to share with MJPEG server.
Definition: mjpegserver.h:36