From f19e079467b6e0fe62ce140210e367f025d812f7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-4RNDQIC\\29019" <290198252@qq.com> Date: Mon, 7 Dec 2020 00:01:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E4=BA=8E=E6=B5=8B=E8=AF=95dpi?= =?UTF-8?q?=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/qt_gl_/yuvgl/main.cpp | 14 +++++++++----- client/qt_gl_/yuvgl/mainwindow.cpp | 18 +++++++++++++++++- client/qt_gl_/yuvgl/mainwindow.h | 6 +++--- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/client/qt_gl_/yuvgl/main.cpp b/client/qt_gl_/yuvgl/main.cpp index 8356545..77070fd 100644 --- a/client/qt_gl_/yuvgl/main.cpp +++ b/client/qt_gl_/yuvgl/main.cpp @@ -4,10 +4,11 @@ #include #include "CameraCapture.h" #include "mainwindow.h" +#include +#include +#include +#include -void CameraDataCallback(double ts, BYTE *dat, LONG size){ - qDebug()<<"reieve cnt"< +#include MainWindow::MainWindow(QWidget *parent) : QssMainWindow(parent), @@ -11,7 +12,8 @@ MainWindow::MainWindow(QWidget *parent) : mPlayerWidget(nullptr), mVideoCoder(nullptr), mPusher(nullptr), - mAudioCapture(nullptr) + mAudioCapture(nullptr), + mTimer(nullptr) { ui->setupUi(this); this->move(50,50); @@ -38,6 +40,10 @@ MainWindow::MainWindow(QWidget *parent) : //mAudioCapture->InitCapture(0, 44100, 2); //mAudioCapture->StartCapture(); mPusher = new H264RtmpPuser(); + mTimer = new QTimer(this); + connect(mTimer, SIGNAL(timeout()), this, SLOT(DetectDpi())); + mTimer->start(1000); + } MainWindow::~MainWindow(){ @@ -123,3 +129,13 @@ void MainWindow::on_pushButton_3_clicked() { qDebug()<comboBox_2->currentText(); } + +void MainWindow::DetectDpi() +{ + qDebug()<<"detect dpi"; + int horizontalDPI = logicalDpiX(); + int verticalDPI = logicalDpiY(); + + qDebug()< mMic; + QTimer *mTimer; + }; #endif // MAINWINDOW_H