代码拉取完成,页面将自动刷新
#ifndef NETSTREAMVIDEO_H
#define NETSTREAMVIDEO_H
#include <QObject>
#include <QThread>
#include <QImage>
#include"audiodecode.h"
extern "C"{
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libswresample/swresample.h"
#include "libswscale/swscale.h"
};
class NetStreamVideo : public QObject
{
Q_OBJECT
public:
explicit NetStreamVideo(QObject *parent = nullptr);
virtual ~NetStreamVideo();
void openUrlVideo(QString url);
void playVideo(bool b ){m_play = b;}
bool isPlayVideo(){return m_play;}
QString getFFmpegError(int ret);
// void decodeAudio(const AVPacket *pkt);
int ToPCM(char *out,AVFormatContext *m_afc,AVFrame *avframe);
bool YuvToRGB(AVFormatContext *m_afc,AVFrame *avframe, int outweight, int outheight);
signals:
void sig_startThread();
void sig_imageFrame(QImage img);
void sig_audio(QByteArray b);
public slots:
void s_startThread();
private:
QThread *m_thread = nullptr;
QString m_urlVideo = "";
bool m_play = false;
AudioDecode *m_audio = nullptr;
int m_audioStream = -1;
};
#endif // NETSTREAMVIDEO_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。