2012-12-27 06:48:17 +04:00
|
|
|
#ifndef PLAYAUDIO_H
|
|
|
|
#define PLAYAUDIO_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define __STDC_CONSTANT_MACROS
|
|
|
|
#ifdef _STDINT_H
|
|
|
|
#undef _STDINT_H
|
|
|
|
#endif
|
|
|
|
#include <stdint.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QQueue>
|
|
|
|
#include <QMutex>
|
|
|
|
|
|
|
|
#include "mediapacket.h"
|
|
|
|
#include "xrdpvr.h"
|
|
|
|
|
|
|
|
/* ffmpeg related stuff */
|
|
|
|
extern "C"
|
|
|
|
{
|
2021-05-08 19:58:11 +03:00
|
|
|
#include <libavformat/avformat.h>
|
|
|
|
#include <libavcodec/avcodec.h>
|
2012-12-27 06:48:17 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
#define VCR_PLAY 1
|
|
|
|
#define VCR_PAUSE 2
|
|
|
|
#define VCR_STOP 3
|
|
|
|
#define VCR_REWIND 4
|
|
|
|
#define VCR_POWER_OFF 5
|
|
|
|
|
|
|
|
class PlayAudio : public QObject
|
|
|
|
{
|
2021-05-08 19:58:11 +03:00
|
|
|
Q_OBJECT
|
2012-12-27 06:48:17 +04:00
|
|
|
|
2021-05-08 19:58:11 +03:00
|
|
|
public:
|
|
|
|
explicit PlayAudio(QObject *parent = 0,
|
|
|
|
QQueue<MediaPacket *> *audioQueue = 0,
|
|
|
|
QMutex *sendMutex = 0,
|
|
|
|
void *channel = 0,
|
|
|
|
int stream_id = 101);
|
2012-12-27 06:48:17 +04:00
|
|
|
|
2021-05-08 19:58:11 +03:00
|
|
|
void setVcrOp(int op);
|
2012-12-27 06:48:17 +04:00
|
|
|
|
2021-05-08 19:58:11 +03:00
|
|
|
public slots:
|
|
|
|
void play();
|
2012-12-27 06:48:17 +04:00
|
|
|
|
2021-05-08 19:58:11 +03:00
|
|
|
private:
|
|
|
|
QQueue<MediaPacket *> *audioQueue;
|
|
|
|
QMutex *sendMutex;
|
|
|
|
QMutex vcrMutex;
|
|
|
|
int vcrFlag;
|
|
|
|
void *channel;
|
|
|
|
int stream_id;
|
2012-12-27 06:48:17 +04:00
|
|
|
|
2021-05-08 19:58:11 +03:00
|
|
|
void clearAudioQ();
|
2012-12-27 06:48:17 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PLAYAUDIO_H
|