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

This commit is contained in:
Megamouse 2025-04-16 02:48:12 +02:00
parent b96e41285c
commit b51d6e9d92
2 changed files with 5 additions and 5 deletions

View file

@ -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)
{
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)
{
m_image_change_callback({});
image_change_callback();
m_has_new = true;
});
return;
@ -105,7 +105,7 @@ void qt_video_source::init_movie()
m_video_sink = std::make_unique<QVideoSink>();
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;
});

View file

@ -31,7 +31,7 @@ public:
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);
protected: