mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
Qt: use image_change_callback function to ensure the member is valid
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
This commit is contained in:
parent
b96e41285c
commit
b51d6e9d92
2 changed files with 5 additions and 5 deletions
|
@ -34,11 +34,11 @@ void qt_video_source::set_active(bool active)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void qt_video_source::image_change_callback() const
|
void qt_video_source::image_change_callback(const QVideoFrame& frame) const
|
||||||
{
|
{
|
||||||
if (m_image_change_callback)
|
if (m_image_change_callback)
|
||||||
{
|
{
|
||||||
m_image_change_callback({});
|
m_image_change_callback(frame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ void qt_video_source::init_movie()
|
||||||
|
|
||||||
QObject::connect(m_movie.get(), &QMovie::frameChanged, m_movie.get(), [this](int)
|
QObject::connect(m_movie.get(), &QMovie::frameChanged, m_movie.get(), [this](int)
|
||||||
{
|
{
|
||||||
m_image_change_callback({});
|
image_change_callback();
|
||||||
m_has_new = true;
|
m_has_new = true;
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
@ -105,7 +105,7 @@ void qt_video_source::init_movie()
|
||||||
m_video_sink = std::make_unique<QVideoSink>();
|
m_video_sink = std::make_unique<QVideoSink>();
|
||||||
QObject::connect(m_video_sink.get(), &QVideoSink::videoFrameChanged, m_video_sink.get(), [this](const QVideoFrame& frame)
|
QObject::connect(m_video_sink.get(), &QVideoSink::videoFrameChanged, m_video_sink.get(), [this](const QVideoFrame& frame)
|
||||||
{
|
{
|
||||||
m_image_change_callback(frame);
|
image_change_callback(frame);
|
||||||
m_has_new = true;
|
m_has_new = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ public:
|
||||||
|
|
||||||
QPixmap get_movie_image(const QVideoFrame& frame) const;
|
QPixmap get_movie_image(const QVideoFrame& frame) const;
|
||||||
|
|
||||||
void image_change_callback() const;
|
void image_change_callback(const QVideoFrame& frame = {}) const;
|
||||||
void set_image_change_callback(const std::function<void(const QVideoFrame&)>& func);
|
void set_image_change_callback(const std::function<void(const QVideoFrame&)>& func);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue