mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-21 03:55:04 +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)
|
||||
int ret;
|
||||
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;
|
||||
}
|
||||
if (decodingFrame) {
|
||||
|
|
|
@ -25,6 +25,11 @@ MagneticWidget::~MagneticWidget()
|
|||
}
|
||||
}
|
||||
|
||||
bool MagneticWidget::isAdsorbed()
|
||||
{
|
||||
return m_adsorbed;
|
||||
}
|
||||
|
||||
bool MagneticWidget::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if (watched != m_adsorbWidget || !event) {
|
||||
|
|
|
@ -31,6 +31,8 @@ public:
|
|||
explicit MagneticWidget(QWidget* adsorbWidget, AdsorbPositions adsorbPos = AP_ALL);
|
||||
~MagneticWidget();
|
||||
|
||||
bool isAdsorbed();
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *watched, QEvent *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.setWidth(showSize.height() * m_widthHeightRatio);
|
||||
} else {
|
||||
showSize.setWidth(qMin(newSize.width(), screenRect.width()));
|
||||
showSize.setWidth(qMin(newSize.width(), screenRect.width()/2));
|
||||
showSize.setHeight(showSize.width() * m_widthHeightRatio);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue