fix: OFX param instance lifecycle and thread-safety fixes
- Fix SIGSEGV in PluginMisc.Keyer by linking Param::SetInstance to instances.
Olive's custom param instances (IntegerInstance, DoubleInstance, etc.) were
not passing the SetInstance pointer to the OpenFX HostSupport base class,
leaving _paramSetInstance as nullptr. When Keyer called paramSetValue during
createInstanceAction, the suite function dereferenced the null pointer in
paramChangedByPlugin(). Now newParam() passes 'this' to every constructor.
- Fix render-thread crash when OFX plugins set params during rendering.
MinOFX calls paramSetValue inside createInstanceAction from the render
thread. SubmitUndoCommand() used to push undo commands directly to
UndoStack, which modifies QAction state (GUI-only). Added IsGuiThread()
check: non-GUI threads execute redo_now() and discard the command without
touching the undo stack.
- Enable PluginMisc.MergeOver and PluginMisc.Keyer integration tests.
MergeOver now supplies both Source and Bg textures; Keyer uses U16 format.
Both pass in the full test suite.
- Make ViewerQueue thread-safe with QMutex around AppendTimewise/PurgeBefore.
Adds copy ctor and assignment to support mutex-per-instance semantics.
This commit is contained in:
@@ -23,6 +23,8 @@
|
||||
#define VIEWERQUEUE_H
|
||||
|
||||
#include <QVariant>
|
||||
#include <QMutex>
|
||||
#include <QMutexLocker>
|
||||
|
||||
#include "codec/frame.h"
|
||||
|
||||
@@ -36,10 +38,19 @@ struct ViewerPlaybackFrame {
|
||||
|
||||
class ViewerQueue : public std::list<ViewerPlaybackFrame> {
|
||||
public:
|
||||
ViewerQueue() = default;
|
||||
ViewerQueue() : mutex_(new QMutex()) {}
|
||||
ViewerQueue(const ViewerQueue &other)
|
||||
: std::list<ViewerPlaybackFrame>(other), mutex_(new QMutex()) {}
|
||||
~ViewerQueue() { delete mutex_; }
|
||||
ViewerQueue &operator=(const ViewerQueue &other)
|
||||
{
|
||||
std::list<ViewerPlaybackFrame>::operator=(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void AppendTimewise(const ViewerPlaybackFrame &f, int playback_speed)
|
||||
{
|
||||
QMutexLocker locker(mutex_);
|
||||
if (this->empty() ||
|
||||
(this->back().timestamp < f.timestamp) == (playback_speed > 0)) {
|
||||
this->push_back(f);
|
||||
@@ -55,12 +66,16 @@ public:
|
||||
|
||||
void PurgeBefore(const rational &time, int playback_speed)
|
||||
{
|
||||
QMutexLocker locker(mutex_);
|
||||
while (!this->empty() &&
|
||||
((playback_speed > 0 && this->front().timestamp < time) ||
|
||||
(playback_speed < 0 && this->front().timestamp > time))) {
|
||||
this->pop_front();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
QMutex *mutex_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user