2014-07-13 09:57:25 -04:00
|
|
|
#include <QObject>
|
|
|
|
#include <QGraphicsEffect>
|
|
|
|
#include <gui/SpeexProcessor.h>
|
|
|
|
#include <gui/chat/ChatWidget.h>
|
2015-03-21 17:25:17 -04:00
|
|
|
#include <gui/common/RsButtonOnText.h>
|
2014-07-13 09:57:25 -04:00
|
|
|
|
|
|
|
class QToolButton;
|
|
|
|
class QAudioInput;
|
|
|
|
class QAudioOutput;
|
|
|
|
class QVideoInputDevice ;
|
|
|
|
class QVideoOutputDevice ;
|
|
|
|
class VideoEncoder ;
|
|
|
|
class VideoDecoder ;
|
|
|
|
|
|
|
|
#define VOIP_SOUND_INCOMING_CALL "VOIP_incoming_call"
|
|
|
|
|
|
|
|
class VOIPChatWidgetHolder : public QObject, public ChatWidgetHolder
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
VOIPChatWidgetHolder(ChatWidget *chatWidget);
|
|
|
|
virtual ~VOIPChatWidgetHolder();
|
|
|
|
|
|
|
|
virtual void updateStatus(int status);
|
|
|
|
|
|
|
|
void addAudioData(const QString name, QByteArray* array) ;
|
|
|
|
void addVideoData(const QString name, QByteArray* array) ;
|
2014-07-20 16:50:36 -04:00
|
|
|
void setAcceptedBandwidth(const QString name, uint32_t bytes_per_sec) ;
|
2014-07-13 09:57:25 -04:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void toggleAudioListen();
|
|
|
|
void toggleAudioCapture();
|
|
|
|
void toggleVideoCapture();
|
2015-03-21 17:25:17 -04:00
|
|
|
void startVideoCapture();
|
2014-07-13 09:57:25 -04:00
|
|
|
void hangupCall() ;
|
2015-03-21 17:25:17 -04:00
|
|
|
void botMouseEnter();
|
|
|
|
void botMouseLeave();
|
2014-07-13 09:57:25 -04:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void sendAudioData();
|
2014-07-15 16:04:31 -04:00
|
|
|
void sendVideoData();
|
2014-07-13 09:57:25 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Audio input/output
|
|
|
|
QAudioInput* inputAudioDevice;
|
|
|
|
QAudioOutput* outputAudioDevice;
|
|
|
|
|
|
|
|
QtSpeex::SpeexInputProcessor* inputAudioProcessor;
|
|
|
|
QtSpeex::SpeexOutputProcessor* outputAudioProcessor;
|
|
|
|
|
|
|
|
// Video input/output
|
|
|
|
QVideoOutputDevice *outputVideoDevice;
|
|
|
|
QVideoOutputDevice *echoVideoDevice;
|
|
|
|
QVideoInputDevice *inputVideoDevice;
|
|
|
|
|
|
|
|
QWidget *videoWidget ; // pointer to call show/hide
|
|
|
|
|
|
|
|
VideoEncoder *inputVideoProcessor;
|
|
|
|
VideoDecoder *outputVideoProcessor;
|
|
|
|
|
|
|
|
// Additional buttons to the chat bar
|
|
|
|
QToolButton *audioListenToggleButton ;
|
|
|
|
QToolButton *audioCaptureToggleButton ;
|
|
|
|
QToolButton *videoCaptureToggleButton ;
|
|
|
|
QToolButton *hangupButton ;
|
2015-03-21 17:25:17 -04:00
|
|
|
|
|
|
|
typedef QMap<QString, RSButtonOnText*> button_map;
|
|
|
|
button_map buttonMapTakeVideo;
|
2014-07-13 09:57:25 -04:00
|
|
|
};
|
|
|
|
|