mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-19 19:15:26 +00:00
Qt: use image_change_callback function to ensure the member is valid
This commit is contained in:
parent
0d7a8b31b6
commit
10196a6c3c
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)
|
||||
{
|
||||
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;
|
||||
});
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue