renderer: mutex colorspace and premultiplied fields of video footage

This commit is contained in:
itsmattkc
2020-11-27 12:49:40 +11:00
parent 8a869d0393
commit d02a1aa41b
5 changed files with 17 additions and 13 deletions
-5
View File
@@ -176,11 +176,6 @@ QIcon Stream::icon() const
return QIcon();
}
QMutex *Stream::proxy_access_lock()
{
return &proxy_access_lock_;
}
void Stream::LoadCustomParameters(QXmlStreamReader* reader)
{
reader->skipCurrentElement();
+5 -2
View File
@@ -95,7 +95,10 @@ public:
virtual QIcon icon() const;
QMutex* proxy_access_lock();
QMutex* mutex()
{
return &mutex_;
}
protected:
virtual void LoadCustomParameters(QXmlStreamReader *reader);
@@ -118,7 +121,7 @@ private:
bool enabled_;
QMutex proxy_access_lock_;
QMutex mutex_;
};
+10 -2
View File
@@ -134,20 +134,26 @@ void VideoStream::SaveCustomParameters(QXmlStreamWriter *writer) const
writer->writeTextElement(QStringLiteral("starttime"), QString::number(start_time_));
}
bool VideoStream::premultiplied_alpha() const
bool VideoStream::premultiplied_alpha()
{
QMutexLocker locker(mutex());
return premultiplied_alpha_;
}
void VideoStream::set_premultiplied_alpha(bool e)
{
mutex()->lock();
premultiplied_alpha_ = e;
mutex()->unlock();
emit ParametersChanged();
}
const QString &VideoStream::colorspace(bool default_if_empty) const
const QString &VideoStream::colorspace(bool default_if_empty)
{
QMutexLocker locker(mutex());
if (colorspace_.isEmpty() && default_if_empty) {
return footage()->project()->color_manager()->GetDefaultInputColorSpace();
} else {
@@ -157,7 +163,9 @@ const QString &VideoStream::colorspace(bool default_if_empty) const
void VideoStream::set_colorspace(const QString &color)
{
mutex()->lock();
colorspace_ = color;
mutex()->unlock();
emit ParametersChanged();
}
+2 -2
View File
@@ -93,10 +93,10 @@ public:
channel_count_ = c;
}
bool premultiplied_alpha() const;
bool premultiplied_alpha();
void set_premultiplied_alpha(bool e);
const QString& colorspace(bool default_if_empty = true) const;
const QString& colorspace(bool default_if_empty = true);
void set_colorspace(const QString& color);
VideoParams::Interlacing interlacing() const
-2
View File
@@ -339,8 +339,6 @@ QVariant RenderProcessor::ProcessVideoFootage(StreamPtr stream, const rational &
managed_params.set_format(video_params.format());
value = render_ctx_->CreateTexture(managed_params);
//qDebug() << "FIXME: Accessing video_stream->colorspace() and video_stream->premultiplied_alpha() may cause race conditions";
ColorProcessorPtr processor = ColorProcessor::Create(color_manager,
video_stream->colorspace(),
color_manager->GetReferenceColorSpace());