digiKam
mjpegframetask.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 frame generator.
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_FRAME_TASK_H
24 #define DIGIKAM_MJPEG_FRAME_TASK_H
25 
26 // Qt includes
27 
28 #include <QImage>
29 #include <QByteArray>
30 #include <QColor>
31 #include <QPoint>
32 #include <QFont>
33 #include <QDateTime>
34 
35 // Local includes
36 
37 #include "actionthread.h"
38 #include "mjpegserver.h"
39 #include "mjpegstreamsettings.h"
40 
41 using namespace Digikam;
42 
44 {
45 
46 class MjpegFrameTask : public ActionJob
47 {
48  Q_OBJECT
49 
50 public:
51 
55  explicit MjpegFrameTask(const MjpegStreamSettings& settings);
56  ~MjpegFrameTask();
57 
58 Q_SIGNALS:
59 
63  void signalFrameChanged(const QByteArray& frame);
64 
65 private:
66 
70  QByteArray imageToJPEGArray(const QImage& frame) const;
71 
75  QImage loadImageFromPreviewCache(const QString& path) const;
76 
82  void run();
83 
84 private:
85 
86  class Private;
87  Private* const d;
88 };
89 
90 } // namespace DigikamGenericMjpegStreamPlugin
91 
92 #endif // DIGIKAM_MJPEG_FRAME_TASK_H
void signalFrameChanged(const QByteArray &frame)
Definition: mjpegstreamsettings.h:49
Definition: actionthreadbase.h:45
Definition: mjpegframeosd.cpp:45
Definition: datefolderview.cpp:43