You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
799 B
C++
34 lines
799 B
C++
#ifndef FFMPEGPUSHSTREAM_H
|
|
#define FFMPEGPUSHSTREAM_H
|
|
|
|
#include "ffmpeginclude.h"
|
|
#include <QDebug>
|
|
#include <QObject>
|
|
|
|
class FFmpegPushStream : public QObject {
|
|
Q_OBJECT
|
|
public:
|
|
explicit FFmpegPushStream(QObject *parent = nullptr);
|
|
/**
|
|
* @brief 设置推流地址
|
|
* @param url 远端推流地址
|
|
*/
|
|
void setRemoteIP(QString url);
|
|
signals:
|
|
|
|
private:
|
|
AVFormatContext *inputFormatCtx = nullptr; //
|
|
AVFormatContext *outputFormatCtx = NULL; //
|
|
int videoIndex = -1;
|
|
QString pushStreamIP; // 推流地址
|
|
bool mInitStatus = false;
|
|
int64_t startTime;
|
|
public slots:
|
|
int pushStream(AVPacket *pkt, int frm_cnt, int64_t startTime,
|
|
int64_t firstDts);
|
|
void stopPush();
|
|
int openNetworkStream(AVFormatContext *inputFormatCtx);
|
|
};
|
|
|
|
#endif // FFMPEGPUSHSTREAM_H
|