-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathintegratedwindow.hpp
More file actions
75 lines (51 loc) · 1.77 KB
/
integratedwindow.hpp
File metadata and controls
75 lines (51 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//
// Created by pengx on 2026/2/6.
//
#ifndef GB28181_INTEGRATEDWINDOW_HPP
#define GB28181_INTEGRATEDWINDOW_HPP
#include "QMainWindow"
#include <QThread>
#include "frame_capture.hpp"
#include "frame_encoder.hpp"
#include "preview_worker.hpp"
#include "sip_register.hpp"
QT_BEGIN_NAMESPACE
namespace Ui {
class IntegratedWindow;
}
QT_END_NAMESPACE
class IntegratedWindow : public QMainWindow {
Q_OBJECT
public:
explicit IntegratedWindow(QWidget* parent = nullptr);
~IntegratedWindow() override;
private slots:
void registerButtonClicked();
void onSipStateChanged(int code, const QString& content);
void writeH264Packet(const std::vector<uint8_t>& h264) const;
void onG711DataReceived(const QByteArray& g711);
void onPcmDataReceived(const std::vector<int16_t>& pcm);
void doRegister();
private:
Ui::IntegratedWindow* ui;
std::unique_ptr<FrameCapture> _frameCapturePtr = nullptr;
std::unique_ptr<QThread> _captureThreadPtr = nullptr;
std::unique_ptr<PreviewWorker> _previewWorkerPtr = nullptr;
std::unique_ptr<QThread> _previewThreadPtr = nullptr;
std::unique_ptr<FrameEncoder> _frameEncoderPtr = nullptr;
std::unique_ptr<QThread> _encodeThreadPtr = nullptr;
mutable quint32 _frameCount = 0; // 帧计数器
static constexpr int TIMESTAMP_BASE = 90000; // 90kHz
// 音频采集
// PaStream *_audio_stream_ptr;
// bool _is_audio_capturing;
// 音频帧编码
// QThread *_audio_encoder_thread_ptr = nullptr;
// AudioFrameEncoder *_audio_encoder_ptr = nullptr;
// Sip注册
std::atomic<bool> _isRegistered{false};
std::unique_ptr<SipRegister> _registerPtr = nullptr;
// 推流
std::atomic<bool> _isStartStream{false};
};
#endif //GB28181_INTEGRATEDWINDOW_HPP