qt_rtmp_demo/mainwindow.h

82 lines
1.8 KiB
C
Raw Normal View History

2023-11-12 16:13:24 +00:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "media/CameraCapture.h"
#include "cplaywidget.h"
#include "media/VideoCoder.h"
#include "media/RtmpPusher.h"
#include "components/toast.h"
#include "utils.h"
#include "Qss.h"
#include "media/audiocaptureff.h"
#include <vector>
2023-12-17 16:33:54 +00:00
#include <QChart>
#include <QChartView>
#include <QLineSeries>
#include <QPoint>
#include <QVector>
#include <QList>
#include <QMutex>
2024-06-16 16:14:06 +00:00
#include "media/screen_capture.h"
#include "utils/screenshotwidget.h"
2023-12-17 16:33:54 +00:00
using namespace QtCharts;
2023-11-12 16:13:24 +00:00
using namespace std;
namespace Ui {
class MainWindow;
}
2024-06-16 16:14:06 +00:00
#include <QMutex>
2023-11-12 16:13:24 +00:00
2023-12-17 16:33:54 +00:00
class MainWindow : public QssMainWindow ,CaptureAudioFfmpeg::CaptureAudioObserver
2023-11-12 16:13:24 +00:00
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
2023-12-17 16:33:54 +00:00
void OnAudioData(const void *frameaddress, uint32_t framelen) ;
2024-06-16 16:14:06 +00:00
public slots:
void on_rect_selected(QRect rect);
2023-11-12 16:13:24 +00:00
private slots:
void on_pushButton_clicked();
void on_pushButton_2_clicked();
void on_pushButton_3_clicked();
void DetectDpi();
2024-06-16 16:14:06 +00:00
void on_pushButton_4_clicked();
void on_pushButton_5_clicked();
2024-06-21 17:05:29 +00:00
void on_pushButton_6_clicked();
void on_pushButton_5_clicked(bool checked);
2023-11-12 16:13:24 +00:00
private:
2023-12-17 16:33:54 +00:00
QLineSeries* mSeries;
QVector<QPoint> mPoint1,mPoint2;
2023-11-12 16:13:24 +00:00
Ui::MainWindow *ui;
Camera *mCamera;
QStringList mCameraList;
bool m_bCameraOpen;
CPlayWidget *mPlayerWidget;
VideoCoder *mVideoCoder;
bool m_bRtmpPushing;
H264RtmpPuser *mPusher;
CaptureAudioFfmpeg *mAudioCapture;
vector<CaptureAudioFfmpeg::MICInfo> mMic;
QTimer *mTimer;
2023-12-17 16:33:54 +00:00
QChart *mChart;
QChartView *mChartView;
QList<void *>mBufferAudio;
2024-06-16 16:14:06 +00:00
QMutex mMux; // lock for audio
ScreenShotWidget *mScreenshot;
ScreenCapture *mScreenCap;
bool mCapScreen;
2023-11-12 16:13:24 +00:00
};
#endif // MAINWINDOW_H