mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-04 14:48:37 +00:00
update:限制横屏手机最大宽度
This commit is contained in:
parent
f763755e7d
commit
f50c561f02
4 changed files with 11 additions and 2 deletions
|
@ -297,7 +297,9 @@ void Decoder::run()
|
||||||
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 37, 0)
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 37, 0)
|
||||||
int ret;
|
int ret;
|
||||||
if ((ret = avcodec_send_packet(codecCtx, &packet)) < 0) {
|
if ((ret = avcodec_send_packet(codecCtx, &packet)) < 0) {
|
||||||
qCritical("Could not send video packet: %d", ret);
|
char errorbuf[255] = { 0 };
|
||||||
|
av_strerror(ret, errorbuf, 254);
|
||||||
|
qCritical("Could not send video packet: %s", errorbuf);
|
||||||
goto runQuit;
|
goto runQuit;
|
||||||
}
|
}
|
||||||
if (decodingFrame) {
|
if (decodingFrame) {
|
||||||
|
|
|
@ -25,6 +25,11 @@ MagneticWidget::~MagneticWidget()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MagneticWidget::isAdsorbed()
|
||||||
|
{
|
||||||
|
return m_adsorbed;
|
||||||
|
}
|
||||||
|
|
||||||
bool MagneticWidget::eventFilter(QObject *watched, QEvent *event)
|
bool MagneticWidget::eventFilter(QObject *watched, QEvent *event)
|
||||||
{
|
{
|
||||||
if (watched != m_adsorbWidget || !event) {
|
if (watched != m_adsorbWidget || !event) {
|
||||||
|
|
|
@ -31,6 +31,8 @@ public:
|
||||||
explicit MagneticWidget(QWidget* adsorbWidget, AdsorbPositions adsorbPos = AP_ALL);
|
explicit MagneticWidget(QWidget* adsorbWidget, AdsorbPositions adsorbPos = AP_ALL);
|
||||||
~MagneticWidget();
|
~MagneticWidget();
|
||||||
|
|
||||||
|
bool isAdsorbed();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||||
void moveEvent(QMoveEvent *event) override;
|
void moveEvent(QMoveEvent *event) override;
|
||||||
|
|
|
@ -225,7 +225,7 @@ void VideoForm::updateShowSize(const QSize &newSize)
|
||||||
showSize.setHeight(qMin(newSize.height(), screenRect.height() - 200));
|
showSize.setHeight(qMin(newSize.height(), screenRect.height() - 200));
|
||||||
showSize.setWidth(showSize.height() * m_widthHeightRatio);
|
showSize.setWidth(showSize.height() * m_widthHeightRatio);
|
||||||
} else {
|
} else {
|
||||||
showSize.setWidth(qMin(newSize.width(), screenRect.width()));
|
showSize.setWidth(qMin(newSize.width(), screenRect.width()/2));
|
||||||
showSize.setHeight(showSize.width() * m_widthHeightRatio);
|
showSize.setHeight(showSize.width() * m_widthHeightRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue