renderer: mutex colorspace and premultiplied fields of video footage
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user