diff --git a/netserver/form/frmmain.cpp b/netserver/form/frmmain.cpp index 21ebe98..8ca947d 100644 --- a/netserver/form/frmmain.cpp +++ b/netserver/form/frmmain.cpp @@ -50,7 +50,7 @@ void frmMain::initConfig() void frmMain::saveConfig() { App::ListenPort1 = ui->txtListenPort1->text().trimmed().toInt(); - App::ListenPort2 = ui->txtListenPort1->text().trimmed().toInt(); + App::ListenPort2 = ui->txtListenPort2->text().trimmed().toInt(); App::writeConfig(); } diff --git a/videowidget/videowidget.cpp b/videowidget/videowidget.cpp index 62c27e4..4c460c7 100644 --- a/videowidget/videowidget.cpp +++ b/videowidget/videowidget.cpp @@ -374,9 +374,9 @@ QImage VideoWidget::getImage() const return this->image; } -QDateTime VideoWidget::getLastTime() const +QPixmap VideoWidget::getPixmap() const { - return QDateTime::currentDateTime(); + return QPixmap(); } QString VideoWidget::getUrl() const @@ -384,6 +384,31 @@ QString VideoWidget::getUrl() const return this->property("url").toString(); } +QDateTime VideoWidget::getLastTime() const +{ + return QDateTime::currentDateTime(); +} + +bool VideoWidget::getCallback() const +{ + return false; +} + +bool VideoWidget::getIsPlaying() const +{ + return false; +} + +bool VideoWidget::getIsRtsp() const +{ + return false; +} + +bool VideoWidget::getIsUsbCamera() const +{ + return false; +} + bool VideoWidget::getCopyImage() const { return this->copyImage; @@ -519,14 +544,19 @@ VideoWidget::OSDPosition VideoWidget::getOSD2Position() const return this->osd2Position; } -QSize VideoWidget::sizeHint() const +int VideoWidget::getFaceBorder() const { - return QSize(500, 350); + return this->faceBorder; } -QSize VideoWidget::minimumSizeHint() const +QColor VideoWidget::getFaceColor() const { - return QSize(50, 35); + return this->faceColor; +} + +QList VideoWidget::getFaceRects() const +{ + return this->faceRects; } void VideoWidget::updateImage(const QImage &image) @@ -553,6 +583,26 @@ void VideoWidget::btnClicked() emit btnClicked(btn->objectName()); } +void VideoWidget::setVideoWidth(int videoWidth) +{ + +} + +void VideoWidget::setVideoHeight(int videoHeight) +{ + +} + +void VideoWidget::setBufferWidth(int bufferWidth) +{ + +} + +void VideoWidget::setBufferHeight(int bufferHeight) +{ + +} + uint VideoWidget::getLength() { return 0; @@ -568,12 +618,12 @@ void VideoWidget::setPosition(int position) } -bool VideoWidget::getMute() +bool VideoWidget::getMuted() { return false; } -void VideoWidget::setMute(bool mute) +void VideoWidget::setMuted(bool muted) { } @@ -613,6 +663,11 @@ void VideoWidget::setUrl(const QString &url) this->setProperty("url", url); } +void VideoWidget::setCallback(bool callback) +{ + +} + void VideoWidget::setHardware(const QString &hardware) { @@ -628,6 +683,11 @@ void VideoWidget::setSaveInterval(int saveInterval) } +void VideoWidget::setFileFlag(const QString &fileFlag) +{ + +} + void VideoWidget::setSavePath(const QString &savePath) { //如果目录不存在则新建 @@ -635,8 +695,6 @@ void VideoWidget::setSavePath(const QString &savePath) if (!dir.exists()) { dir.mkdir(savePath); } - - } void VideoWidget::setFileName(const QString &fileName) @@ -785,6 +843,21 @@ void VideoWidget::setOSD2Position(const VideoWidget::OSDPosition &osdPosition) this->osd2Position = osdPosition; } +void VideoWidget::setFaceBorder(int faceBorder) +{ + this->faceBorder = faceBorder; +} + +void VideoWidget::setFaceColor(const QColor &faceColor) +{ + this->faceColor = faceColor; +} + +void VideoWidget::setFaceRects(const QList &faceRects) +{ + this->faceRects = faceRects; +} + void VideoWidget::open() { //qDebug() << TIMEMS << "open video" << objectName(); @@ -823,11 +896,15 @@ void VideoWidget::close() QTimer::singleShot(1, this, SLOT(clear())); } -void VideoWidget::restart() +void VideoWidget::restart(int delayOpen) { //qDebug() << TIMEMS << "restart video" << objectName(); close(); - QTimer::singleShot(10, this, SLOT(open())); + if (delayOpen > 0) { + QTimer::singleShot(delayOpen, this, SLOT(open())); + } else { + open(); + } } void VideoWidget::clear() @@ -836,3 +913,8 @@ void VideoWidget::clear() this->update(); } +void VideoWidget::snap(const QString &fileName) +{ + +} + diff --git a/videowidget/videowidget.h b/videowidget/videowidget.h index b99cc85..a1fd2aa 100644 --- a/videowidget/videowidget.h +++ b/videowidget/videowidget.h @@ -148,6 +148,10 @@ private: OSDFormat osd2Format; //标签2文本格式 OSDPosition osd2Position; //标签2位置 + int faceBorder; //人脸框粗细 + QColor faceColor; //人脸框颜色 + QList faceRects; //人脸框集合 + private: //初始化解码线程 void initThread(); @@ -158,8 +162,14 @@ private: public: QImage getImage() const; - QDateTime getLastTime() const; + QPixmap getPixmap() const; QString getUrl() const; + QDateTime getLastTime() const; + + bool getCallback() const; + bool getIsPlaying() const; + bool getIsRtsp() const; + bool getIsUsbCamera() const; bool getCopyImage() const; bool getCheckLive() const; @@ -193,8 +203,9 @@ public: OSDFormat getOSD2Format() const; OSDPosition getOSD2Position() const; - QSize sizeHint() const; - QSize minimumSizeHint() const; + int getFaceBorder() const; + QColor getFaceColor() const; + QList getFaceRects() const; private slots: //接收图像并绘制 @@ -222,6 +233,16 @@ signals: void btnClicked(const QString &objName); public slots: + //设置视频宽度 + void setVideoWidth(int videoWidth); + //设置视频高度 + void setVideoHeight(int videoHeight); + + //设置缓存图片宽度 + void setBufferWidth(int bufferWidth); + //设置缓存图片高度 + void setBufferHeight(int bufferHeight); + //获取长度 uint getLength(); //获取当前播放位置 @@ -230,9 +251,9 @@ public slots: void setPosition(int position); //获取静音状态 - bool getMute(); + bool getMuted(); //设置静音 - void setMute(bool mute); + void setMuted(bool muted); //获取音量 int getVolume(); @@ -247,8 +268,11 @@ public slots: void setCheckTime(int checkTime); //设置是否检测连接 void setCheckConn(bool checkConn); + //设置视频流地址 void setUrl(const QString &url); + //设置是否采用回调 + void setCallback(bool callback); //设置硬件解码器名称 void setHardware(const QString &hardware); @@ -256,6 +280,8 @@ public slots: void setSaveFile(bool saveFile); //设置保存间隔 void setSaveInterval(int saveInterval); + //设置定时保存文件唯一标识符 + void setFileFlag(const QString &fileFlag); //设置保存文件夹 void setSavePath(const QString &savePath); //设置保存文件名称 @@ -320,6 +346,13 @@ public slots: //设置标签2位置 void setOSD2Position(const OSDPosition &osdPosition); + //设置人脸框粗细 + void setFaceBorder(int faceBorder); + //设置人脸框颜色 + void setFaceColor(const QColor &faceColor); + //设置人脸框区域集合 + void setFaceRects(const QList &faceRects); + //打开设备 void open(); //暂停 @@ -329,10 +362,11 @@ public slots: //关闭设备 void close(); //重新加载 - void restart(); + void restart(int delayOpen = 500); //清空 void clear(); - + //快照 + void snap(const QString &fileName); }; #endif // VIDEOWIDGET_H diff --git a/zhtopy/zhtopy.cpp b/zhtopy/zhtopy.cpp index 262778d..06b27ee 100644 --- a/zhtopy/zhtopy.cpp +++ b/zhtopy/zhtopy.cpp @@ -175,7 +175,7 @@ ZhToPY::ZhToPY(QObject *parent) : QObject(parent) listJP << "WFLLBCYYJDYTDTHWZSFJMQQYJLMQXXLLDTTKHHYBFPWTYYSQQWNQWLGWDEBZWCMYGCULKJXTMXMYJSXHYBRWFYMWFRXYQMXYSZTZ"; listJP << "ZTFYKMLDHQDXWYYNLCRYJBLPSXCXYWLSPRRJWXHQYPHTYDNXHHMMYWYTZCSQMTSSCCDALWZTCPQPYJLLQZYJSWXMZZMMYLMXCLMX"; listJP << "CZMXMZSQTZPPQQBLPGXQZHFLJJHYTJSRXWZXSCCDLXTYJDCQJXSLQYCLZXLZZXMXQRJMHRHZJBHMFLJLMLCLQNLDXZLLLPYPSYJY"; - listJP << "SXCQQDCMQJZZXHNPNXZMEKMXHYKYQLXSXTXJYYHWDCWDZHQYYBGYBCYSCFGPSJNZDYZZJZXRZRQJJYMCANYRJTLDPPYZBSTJKXXZ"; + listJP << "SXCQQDCMQJZZXHNPNXZMEKMXXYKYQLXSXTXJYYHWDCWDZHQYYBGYBCYSCFGPSJNZDYZZJZXRZRQJJYMCANYRJTLDPPYZBSTJKXXZ"; listJP << "YPFDWFGZZRPYMTNGXZQBYXNBUFNQKRJQZMJEGRZGYCLKXZDSKKNSXKCLJSPJYYZLQQJYBZSSQLLLKJXTBKTYLCCDDBLSPPFYLGYD"; listJP << "TZJYQGGKQTTFZXBDKTYYHYBBFYTYYBCLPDYTGDHRYRNJSPTCSNYJQHKLLLZSLYDXXWBCJQSPXBPJZJCJDZFFXXBRMLAZHCSNDLBJ"; listJP << "DSZBLPRZTSWSBXBCLLXXLZDJZSJPYLYXXYFTFFFBHJJXGBYXJPMMMPSSJZJMTLYZJXSWXTYLEDQPJMYGQZJGDJLQJWJQLLSJGJGY";