YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
signalhandler.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6#ifndef SIGNALHANDLER_H
7#define SIGNALHANDLER_H
8
9#include <QObject>
10#include <QVideoFrame>
11#include <QMutex>
12#include <QTimer>
13#include "FpsStats.h"
14
22class SignalHandler : public QObject
23{
24 Q_OBJECT
25public:
26 explicit SignalHandler(QObject *parent = 0);
28
29 void sendVideoFrame(QVideoFrame);
30 void synchDisplayPeriod(bool check);
31 void synchDisplaySize(bool check);
32 void changeRefreshInterval(int ineterval);
33 void freeze(bool check);
34 void saveCurrentFrame();
35 void setFileName(QUrl url);
36 void setFileNames(QUrl url);
37 void startDumpFrames();
38 void stopDumpFrames();
39 bool getAutosizeMode();
40
41private:
42 void saveFrame(QImage);
43 void saveFrameSet(QImage);
44 void checkDefaultNameCounterCount();
45 void checkCustomNameCounterCount(QString file);
46
47signals:
48 void internalSendFrame(QVideoFrame);
49 void sendFrame(QVideoFrame*);
50 void sendFps(double portAvg, double portMin, double portMax,
51 double dispAvg, double dispMin, double dispMax);
53 void testSignal();
54
55private slots:
56 void internalReceiveFrame(QVideoFrame);
57 void onTimerElapsed();
58 void onSelfStartTimer();
59 void onFpsTimer();
60
61private:
62 FpsStats portFps;
63 FpsStats displayFps;
64 QString fileName;
65 QString fileNames;
66 bool b_saveSetFrameMode;
67 bool b_saveCurrentFrameMode;
68 bool b_freezeMode;
69 bool b_synchRateMode;
70 bool b_autosizeMode;
71 QVideoFrame frame;
72 QMutex mutex;
73 QTimer timer;
74 QTimer fpsTimer;
75 int defaultNameCounter;
76 int customNameCounter;
77 int framesetCounter;
78
79
80};
81
82#endif // SIGNALHANDLER_H
Class used for calculate the fps.
Definition FpsStats.h:16
The class that handles some signals.
void sendVideoFrame(QVideoFrame)
Gets a videoframe.
void testSignal()
void setFileNames(QUrl url)
Sets the filename used for saving a video frame set.
void sendFrame(QVideoFrame *)
void stopDumpFrames()
Stops the Dump frame modality (Save frame set).
void saveCurrentFrame()
Enable the save curretn frame mode.
void selfStartTimer()
void internalSendFrame(QVideoFrame)
void changeRefreshInterval(int ineterval)
Sets the refresh interval.
void freeze(bool check)
Enable/Disable the freeze mode.
void setFileName(QUrl url)
Sets the filename used for saving a video frame.
void sendFps(double portAvg, double portMin, double portMax, double dispAvg, double dispMin, double dispMax)
void startDumpFrames()
Enables the Dump frame modality (Save frame set).
void synchDisplayPeriod(bool check)
Enable/Disable the synch mode.
void synchDisplaySize(bool check)
Enable/Disable the synch size mode.