1 Star 0 Fork 1

wzw200/qtMediasoupMyDemo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
MainWgt.h 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
cNull 提交于 2022-07-04 08:02 . update README.md.
#pragma once
#include <QWidget>
#include "ui_MainWgt.h"
#include "MediaCtroller.h"
#include "api/video/video_sink_interface.h"
#include "api/video/video_frame.h"
#include <QHBoxLayout>
#include <QDebug>
#include "MediaCtroller.h"
#include <QPaintEvent>
#include <QPainter>
class Display :public QWidget {
Q_OBJECT
public:
Display(QWidget* parent) :QWidget(parent) {
}
void inputData(unsigned char*data,int width,int height) {
m_image = QImage(data,width,height,QImage::Format_ARGB32);
update();
}
void setPeerId(QString peerId)
{
m_peerId = peerId;
}
QString getPeerId()
{
return m_peerId;
}
protected:
void paintEvent(QPaintEvent* event) {
QPainter painter(this);
if (!m_image.isNull()){
painter.drawImage(rect(), m_image);
}
}
private:
QImage m_image;
QString m_peerId;
};
class MainWgt : public QWidget,public MediasoupEventCB
{
Q_OBJECT
public:
MainWgt(QWidget *parent = Q_NULLPTR);
~MainWgt();
void dataCallback(QString peerId,unsigned char*data,int width,int height);
virtual void onNewPeer(QString peerId);
public Q_SLOTS:
void onCreateCanvas(QString peerId);
private:
Ui::MainWgt ui;
vi::MediaCtroller* m_mediaCtrl;
QHBoxLayout* m_layout;
QList<Display*> m_peerList;
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/wzw200/qt-mediasoup-my-demo.git
git@gitee.com:wzw200/qt-mediasoup-my-demo.git
wzw200
qt-mediasoup-my-demo
qtMediasoupMyDemo
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385