KVIrc 5.2.0
Developer APIs
DccVideoWindow.h
Go to the documentation of this file.
1#ifndef _VIDEO_H_
2#define _VIDEO_H_
3//=============================================================================
4//
5// File : DccVideoWindow.h
6// Creation date : Tue Nov 10 18:08:09 2009 GMT by Fabio Bas
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 2009 Szymon Stefanek (pragma at kvirc dot net)
10//
11// This program is FREE software. You can redistribute it and/or
12// modify it under the terms of the GNU General Public License
13// as published by the Free Software Foundation; either version 2
14// of the License, 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.
19// See the GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this program. If not, write to the Free Software Foundation,
23// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24//
25//=============================================================================
26
27#include "DccVoiceCodec.h"
28#include "DccDescriptor.h"
29#include "DccThread.h"
30#include "DccWindow.h"
31
32#include "KviWindow.h"
33#include "KviDataBuffer.h"
34#include "kvi_sockettype.h"
35#include "KviTalHBox.h"
36#include "KviThemedLabel.h"
37#include "KviError.h"
38
39#include <QLabel>
40#include <QToolButton>
41#include <QTimer>
42#include <QImage>
43#include <QPixmap>
44#include <QComboBox>
45#include <QGridLayout>
46
47#include <QCamera>
48#include <QCameraViewfinder>
49
50#ifdef COMPILE_CRYPT_SUPPORT
51class KviCryptSessionInfo;
52#endif
53
54class QSlider;
55class DccMarshal;
56
57#ifndef _DCC_VIDEO_CPP_
58extern bool kvi_dcc_video_is_valid_codec(const char * codecName);
59#endif
60
61#define KVI_DCC_VIDEO_THREAD_ACTION_START_RECORDING 0
62#define KVI_DCC_VIDEO_THREAD_ACTION_STOP_RECORDING 1
63#define KVI_DCC_VIDEO_THREAD_ACTION_START_PLAYING 2
64#define KVI_DCC_VIDEO_THREAD_ACTION_STOP_PLAYING 3
65#define KVI_DCC_VIDEO_THREAD_ACTION_GRAB_FRAME 4
66
72
74{
75 friend class DccVideoWindow;
76
77public:
80
81protected:
91
92protected:
93 QImage m_inImage;
94 QImage m_outImage;
95
96protected:
97 bool readWriteStep();
98 bool videoStep();
99 bool textStep();
100 void startRecording();
101 void restartRecording(int iDevice, int iInput, int iStandard);
102 void stopRecording();
103 void startPlaying();
104 void stopPlaying();
105 bool isPlaying() const { return m_bPlaying; }
106 void run() override;
107 bool handleIncomingData(KviDccThreadIncomingData * data, bool bCritical);
108};
109
111{
112 Q_OBJECT
113 friend class DccVideoThread;
114
115public:
116 DccVideoWindow(DccDescriptor * dcc, const char * name);
118
119protected:
123 QCameraViewfinder * m_pCameraView;
124 QCamera * m_pCamera;
126 QComboBox * m_pCDevices;
127 QComboBox * m_pCInputs;
128 QComboBox * m_pCStandards;
129 QGridLayout * m_pLayout;
130 QTimer m_Timer;
131 QLabel * m_pVideoLabel[3];
132 QString * m_pszTarget;
136
137protected:
138 void triggerCreationEvents() override;
139 void triggerDestructionEvents() override;
140 const QString & target() override;
141 void fillCaptionBuffers() override;
142 QPixmap * myIconPtr() override;
143 bool event(QEvent * e) override;
144 void getBaseLogFileName(QString & buffer) override;
145 void startTalking();
146 void stopTalking();
147 void startConnection();
148 const QString & localNick() override;
149 void ownMessage(const QString & text, bool bUserFeedback = true) override;
150 void ownAction(const QString & text) override;
151 void resizeEvent(QResizeEvent *) override;
152 QSize sizeHint() const override;
153protected slots:
155 void connected();
156 void startOrStopTalking(bool bStart);
158 void slotUpdateImage();
160 void videoInputChanged(int);
161};
162
163#endif //_VIDEO_H_
bool kvi_dcc_video_is_valid_codec(const char *codecName)
Definition DccVideoWindow.cpp:64
Error List.
Class for horizontal box.
Contains the KviWindow class.
Definition DccDescriptor.h:34
Definition DccMarshal.h:57
Definition DccThread.h:56
Definition DccVoiceCodec.h:66
Definition DccVideoWindow.h:74
void stopRecording()
Definition DccVideoWindow.cpp:310
bool textStep()
Definition DccVideoWindow.cpp:187
bool handleIncomingData(KviDccThreadIncomingData *data, bool bCritical)
Definition DccVideoWindow.cpp:221
QImage m_inImage
Definition DccVideoWindow.h:93
QImage m_outImage
Definition DccVideoWindow.h:94
KviDataBuffer m_videoOutSignalBuffer
Definition DccVideoWindow.h:87
KviDccVideoThreadOptions * m_pOpt
Definition DccVideoWindow.h:82
bool m_bRecording
Definition DccVideoWindow.h:90
void restartRecording(int iDevice, int iInput, int iStandard)
Definition DccVideoWindow.cpp:290
bool isPlaying() const
Definition DccVideoWindow.h:105
KviDataBuffer m_videoInSignalBuffer
Definition DccVideoWindow.h:85
KviDataBuffer m_outFrameBuffer
Definition DccVideoWindow.h:83
void startRecording()
Definition DccVideoWindow.cpp:296
KviDataBuffer m_inFrameBuffer
Definition DccVideoWindow.h:84
void startPlaying()
Definition DccVideoWindow.cpp:323
KviDataBuffer m_textOutSignalBuffer
Definition DccVideoWindow.h:88
void stopPlaying()
Definition DccVideoWindow.cpp:335
bool videoStep()
Definition DccVideoWindow.cpp:152
bool m_bPlaying
Definition DccVideoWindow.h:89
KviDataBuffer m_textInSignalBuffer
Definition DccVideoWindow.h:86
bool readWriteStep()
Definition DccVideoWindow.cpp:103
void run() override
Definition DccVideoWindow.cpp:347
~DccVideoThread()
Definition DccVideoWindow.cpp:95
Definition DccVideoWindow.h:111
QByteArray m_tmpTextDataOut
Definition DccVideoWindow.h:134
QWidget * m_pContainerWidget
Definition DccVideoWindow.h:121
QPixmap * myIconPtr() override
Definition DccVideoWindow.cpp:678
QSize sizeHint() const override
Definition DccVideoWindow.cpp:577
void slotUpdateImage()
Definition DccVideoWindow.cpp:1003
void resizeEvent(QResizeEvent *) override
Definition DccVideoWindow.cpp:568
void triggerDestructionEvents() override
Definition DccVideoWindow.cpp:594
DccVideoThread * m_pSlaveThread
Definition DccVideoWindow.h:133
bool event(QEvent *e) override
Definition DccVideoWindow.cpp:802
QComboBox * m_pCStandards
Definition DccVideoWindow.h:128
QLabel * m_pInVideoLabel
Definition DccVideoWindow.h:125
QCamera * m_pCamera
Definition DccVideoWindow.h:124
void connected()
Definition DccVideoWindow.cpp:956
QString m_szLocalNick
Definition DccVideoWindow.h:135
KviThemedLabel * m_pLabel
Definition DccVideoWindow.h:120
void fillCaptionBuffers() override
Definition DccVideoWindow.cpp:669
void stopTalking()
Definition DccVideoWindow.cpp:981
QTimer m_Timer
Definition DccVideoWindow.h:130
QComboBox * m_pCDevices
Definition DccVideoWindow.h:126
QImage * m_pCameraImage
Definition DccVideoWindow.h:122
void ownMessage(const QString &text, bool bUserFeedback=true) override
Definition DccVideoWindow.cpp:683
QGridLayout * m_pLayout
Definition DccVideoWindow.h:129
void videoInputChanged(int)
Definition DccVideoWindow.cpp:1011
QCameraViewfinder * m_pCameraView
Definition DccVideoWindow.h:123
void handleMarshalError(KviError::Code eError)
Definition DccVideoWindow.cpp:950
void ownAction(const QString &text) override
Definition DccVideoWindow.cpp:773
void startTalking()
Definition DccVideoWindow.cpp:988
QComboBox * m_pCInputs
Definition DccVideoWindow.h:127
void startConnection()
Definition DccVideoWindow.cpp:599
void connectionInProgress()
Definition DccVideoWindow.cpp:619
void textViewRightClicked()
Definition DccVideoWindow.cpp:584
~DccVideoWindow()
Definition DccVideoWindow.cpp:498
const QString & localNick() override
Definition DccVideoWindow.cpp:766
void startOrStopTalking(bool bStart)
Definition DccVideoWindow.cpp:995
void getBaseLogFileName(QString &buffer) override
Definition DccVideoWindow.cpp:664
QString * m_pszTarget
Definition DccVideoWindow.h:132
const QString & target() override
Definition DccVideoWindow.cpp:654
void triggerCreationEvents() override
Definition DccVideoWindow.cpp:589
QLabel * m_pVideoLabel[3]
Definition DccVideoWindow.h:131
Definition DccWindow.h:35
Definition KviDataBuffer.h:31
Definition KviThemedLabel.h:34
Base class for all windows in KVIrc.
Definition KviWindow.h:75
#define e
Definition detector.cpp:70
int kvi_socket_t
Definition kvi_sockettype.h:40
Code
Contains all error codes.
Definition KviError.h:48
Definition DccThread.h:50
Definition DccVideoWindow.h:68
DccVideoCodec * pCodec
Definition DccVideoWindow.h:70
QString szVideoDevice
Definition DccVideoWindow.h:69