mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-07-29 12:18:39 +00:00
update: VideoForm成员变量m_vb改为堆上创建
This commit is contained in:
parent
e61a09f477
commit
f401f2dcf2
4 changed files with 12 additions and 10 deletions
|
@ -363,5 +363,5 @@ runQuit:
|
|||
avcodec_free_context(&codecCtx);
|
||||
}
|
||||
|
||||
emit onDecodeStop();
|
||||
emit onStreamStop();
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
ReceiverState* getReceiverState();
|
||||
|
||||
signals:
|
||||
void onDecodeStop();
|
||||
void onStreamStop();
|
||||
|
||||
protected:
|
||||
void run();
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include "videoform.h"
|
||||
#include "recorder.h"
|
||||
#include "videobuffer.h"
|
||||
#include "ui_videoform.h"
|
||||
#include "iconhelper.h"
|
||||
#include "toolform.h"
|
||||
|
@ -31,8 +32,9 @@ VideoForm::VideoForm(const QString& serial, quint16 maxSize, quint32 bitRate, co
|
|||
initUI();
|
||||
|
||||
m_server = new Server();
|
||||
m_vb.init();
|
||||
m_decoder.setVideoBuffer(&m_vb);
|
||||
m_vb = new VideoBuffer();
|
||||
m_vb->init();
|
||||
m_decoder.setVideoBuffer(m_vb);
|
||||
m_stream.setDecoder(&m_decoder);
|
||||
if (!fileName.trimmed().isEmpty()) {
|
||||
m_recorder = new Recorder(fileName.trimmed());
|
||||
|
@ -69,7 +71,7 @@ VideoForm::~VideoForm()
|
|||
if (m_recorder) {
|
||||
delete m_recorder;
|
||||
}
|
||||
m_vb.deInit();
|
||||
m_vb->deInit();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
@ -194,13 +196,13 @@ void VideoForm::initSignals()
|
|||
}
|
||||
ui->videoWidget->show();
|
||||
}
|
||||
m_vb.lock();
|
||||
const AVFrame *frame = m_vb.consumeRenderedFrame();
|
||||
m_vb->lock();
|
||||
const AVFrame *frame = m_vb->consumeRenderedFrame();
|
||||
//qDebug() << "widthxheight:" << frame->width << "x" << frame->height;
|
||||
updateShowSize(QSize(frame->width, frame->height));
|
||||
ui->videoWidget->setFrameSize(QSize(frame->width, frame->height));
|
||||
ui->videoWidget->updateTextures(frame->data[0], frame->data[1], frame->data[2], frame->linesize[0], frame->linesize[1], frame->linesize[2]);
|
||||
m_vb.unLock();
|
||||
m_vb->unLock();
|
||||
},Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
#include "server.h"
|
||||
#include "stream.h"
|
||||
#include "videobuffer.h"
|
||||
#include "decoder.h"
|
||||
#include "inputconvertnormal.h"
|
||||
#include "inputconvertgame.h"
|
||||
|
@ -19,6 +18,7 @@ class videoForm;
|
|||
|
||||
class ToolForm;
|
||||
class Recorder;
|
||||
class VideoBuffer;
|
||||
class VideoForm : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -72,7 +72,7 @@ private:
|
|||
QSize frameSize;
|
||||
Server* m_server = Q_NULLPTR;
|
||||
Stream m_stream;
|
||||
VideoBuffer m_vb;
|
||||
VideoBuffer* m_vb;
|
||||
//InputConvertNormal m_inputConvert;
|
||||
InputConvertGame m_inputConvert;
|
||||
FileHandler m_fileHandler;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue