#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <VLCQtCore/Common.h>
#include <VLCQtCore/Instance.h>
#include <VLCQtCore/Media.h>
#include <VLCQtCore/MediaPlayer.h>
#include <VLCQtCore/VideoStream.h>
#include <QFileDialog>
#include <QInputDialog>
#include <qdebug.h>
#include <VLCQtCore/VideoStream.h>
#include <VLCQtCore/YUVVideoFrame.h>
#include "opencv2/opencv.hpp"//添加Opencv相关头文件
#include "opencv2/highgui/highgui.hpp"
void MainWindow::reload_chanel(void){
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
label_channel_0 = new QLabel(this);
label_channel_0->setObjectName(QStringLiteral("label_channel_0"));
sizePolicy.setHeightForWidth(label_channel_0->sizePolicy().hasHeightForWidth());
label_channel_0->setSizePolicy(sizePolicy);
label_channel_0->setMinimumSize(QSize(0, 0));
label_channel_0->setStyleSheet(QStringLiteral("background-color: rgb(53, 54, 194);"));
ui->horizontalLayout_2->addWidget(label_channel_0);
#if 1
label_channel_1 = new QLabel(this);
label_channel_1->setObjectName(QStringLiteral("label_channel_1"));
sizePolicy.setHeightForWidth(label_channel_1->sizePolicy().hasHeightForWidth());
label_channel_1->setSizePolicy(sizePolicy);
label_channel_1->setMinimumSize(QSize(0, 0));
label_channel_1->setStyleSheet(QStringLiteral("background-color: rgb(53, 54, 194);"));
ui->horizontalLayout_2->addWidget(label_channel_1);
if(parameter_rtst.chanal_num==3){
label_channel_2 = new QLabel(this);
label_channel_2->setObjectName(QStringLiteral("label_channel_2"));
sizePolicy.setHeightForWidth(label_channel_2->sizePolicy().hasHeightForWidth());
label_channel_2->setSizePolicy(sizePolicy);
label_channel_2->setMinimumSize(QSize(0, 0));
label_channel_2->setStyleSheet(QStringLiteral("background-color: rgb(53, 54, 194);"));
ui->horizontalLayout_2->addWidget(label_channel_2);
}else if(parameter_rtst.chanal_num>=4){
label_channel_2 = new QLabel(this);
label_channel_2->setObjectName(QStringLiteral("label_channel_2"));
sizePolicy.setHeightForWidth(label_channel_2->sizePolicy().hasHeightForWidth());
label_channel_2->setSizePolicy(sizePolicy);
label_channel_2->setMinimumSize(QSize(0, 0));
label_channel_2->setStyleSheet(QStringLiteral("background-color: rgb(53, 54, 194);"));
ui->horizontalLayout_2->addWidget(label_channel_2);
label_channel_3 = new QLabel(this);
label_channel_3->setObjectName(QStringLiteral("label_channel_3"));
sizePolicy.setHeightForWidth(label_channel_3->sizePolicy().hasHeightForWidth());
label_channel_3->setSizePolicy(sizePolicy);
label_channel_3->setMinimumSize(QSize(0, 0));
label_channel_3->setStyleSheet(QStringLiteral("background-color: rgb(53, 54, 194);"));
ui->horizontalLayout_3->addWidget(label_channel_3);
label_channel_4 = new QLabel(this);
label_channel_4->setObjectName(QStringLiteral("label_channel_4"));
sizePolicy.setHeightForWidth(label_channel_4->sizePolicy().hasHeightForWidth());
label_channel_4->setSizePolicy(sizePolicy);
label_channel_4->setMinimumSize(QSize(0, 0));
label_channel_4->setStyleSheet(QStringLiteral("background-color: rgb(53, 54, 194);"));
ui->horizontalLayout_3->addWidget(label_channel_4);
label_channel_5 = new QLabel(this);
label_channel_5->setObjectName(QStringLiteral("label_channel_5"));
sizePolicy.setHeightForWidth(label_channel_5->sizePolicy().hasHeightForWidth());
label_channel_5->setSizePolicy(sizePolicy);
label_channel_5->setMinimumSize(QSize(0, 0));
label_channel_5->setStyleSheet(QStringLiteral("background-color: rgb(53, 54, 194);"));
ui->horizontalLayout_3->addWidget(label_channel_5);
}
#endif
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
// ui->frame_2->hide();
// ui->frame_4->show();
ui->frame_2->show();
ui->frame_4->hide();
// ui->frame_5->hide();
// ui->frame_3->show();
ui->frame_3->hide();
ui->frame_5->show();
newmanual_in=new manual_in();
newmanual_in->setWindowFlags(Qt::FramelessWindowHint);
newmanual_in->move((this->width() - newmanual_in->width())/2, (this->height() - newmanual_in->height())/2);
newmanual_in->hide();
newmanual_out=new manual_out();
newmanual_out->setWindowFlags(Qt::FramelessWindowHint);
newmanual_out->move((this->width() - newmanual_out->width())/2, (this->height() - newmanual_out->height())/2);
newmanual_out->hide();
newsystemset=new systemset();
newsystemset->setWindowFlags(Qt::FramelessWindowHint);
newsystemset->move((this->width() - newsystemset->width())/2, (this->height() - newsystemset->height())/2);
newsystemset->hide();
newchangeuser=new changeuser();
newchangeuser->setWindowFlags(Qt::FramelessWindowHint);
newchangeuser->move((this->width() - newchangeuser->width())/2, (this->height() - newchangeuser->height())/2);
newchangeuser->hide();
//列表显示
// QStringList header;
// header<<tr("name")<<tr("last modify time")<<tr("type")<<tr("size");
// ui->tableWidget->setHorizontalHeaderLabels(header);
ui->tableWidget_2->setColumnWidth(0, 70);
ui->tableWidget_2->setColumnWidth(1, 80);
ui->tableWidget_2->setColumnWidth(2, 140);
ui->tableWidget_2->setColumnWidth(3, 70);
//ui->widget->hide();
int row_count = ui->tableWidget_2->rowCount(); //获取表单行数
ui->tableWidget_2->insertRow(row_count); //插入新行
QTableWidgetItem *item = new QTableWidgetItem();
QTableWidgetItem *item1 = new QTableWidgetItem();
QTableWidgetItem *item2 = new QTableWidgetItem();
QTableWidgetItem *item3 = new QTableWidgetItem();
//设置对应的图标、文件名称、最后更新时间、对应的类型、文件大小
//item->setText("icon"); //icon为调用系统的图标,以后缀来区分
item->setText("name");
item1->setText("last_modify_time");
item2->setText("type"); //type为调用系统的类型,以后缀来区分
item3->setText("size");
ui->tableWidget_2->setItem(row_count, 0, item);
ui->tableWidget_2->setItem(row_count, 1, item1);
ui->tableWidget_2->setItem(row_count, 2, item2);
ui->tableWidget_2->setItem(row_count, 3, item3);
//列表显示end
//树形显示
ui->treeWidget_2->expandAll();
//ui->frame_3->hide();
ui->treeWidget->hide();
ui->treeWidget_2->hide();
//树形显示end
//参数初始化
parameter_rtst_init();
//动态画面加载
reload_chanel();
mqtt_link=new communication(this);
getimage_flag=0;
QStringList args = VlcCommon::args();
args << "--network-caching=100";
_instance0 = new VlcInstance(args, this);
_player0 = new VlcMediaPlayer(_instance0);
//_videostream=new VlcVideoStream(Vlc::YUVFormat,this);
//_player->setVideoWidget(ui->vlc_widget);
//ui->vlc_widget->setMediaPlayer(_player);
//_videostream=new VlcVideoStream(Vlc::RenderFormat format,this);
m_video_stream0= new VideoStreaming(Vlc::YUVFormat,0,0);
//m_video_stream->init(_player);
//m_video_stream->init(_player);
m_video_stream0->setCallbacks(_player0);
_instance1 = new VlcInstance(args, this);
_player1 = new VlcMediaPlayer(_instance1);
//_player1->setVideoWidget(ui->widget);
//ui->widget->setMediaPlayer(_player1);
m_video_stream1= new VideoStreaming(Vlc::YUVFormat,0,1);
//m_video_stream->init(_player);
//m_video_stream->init(_player);
m_video_stream1->setCallbacks(_player1);
_instance2 = new VlcInstance(args, this);
_player2 = new VlcMediaPlayer(_instance2);
//_player2->setVideoWidget(ui->widget_2);
//u
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
vlc_demo20220223.zip (22个子文件)
vlc_demo
communication.cpp 4KB
vlc_demo.pro 4KB
changeuser.ui 9KB
common.h 482B
systemset.cpp 284B
changeuser.cpp 292B
systemset.ui 3KB
systemset.h 384B
manual_in.h 458B
common.cpp 146B
manual_out.h 466B
main.cpp 243B
mainwindow.ui 68KB
manual_in.ui 5KB
mainwindow.cpp 23KB
mainwindow.h 2KB
vlc_demo.pro.user 64KB
communication.h 511B
manual_out.cpp 513B
manual_out.ui 3KB
manual_in.cpp 704B
changeuser.h 392B
共 22 条
- 1
资源评论
- 李岩2023-06-08内容与描述一致,超赞的资源,值得借鉴的内容很多,支持!
- wh31161232022-08-19资源内容详实,描述详尽,解决了我的问题,受益匪浅,学到了。
- mindy08172023-03-12感谢大佬,让我及时解决了当下的问题,解燃眉之急,必须支持!
jie030901106
- 粉丝: 1
- 资源: 45
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功