better support for various bit rates

This commit is contained in:
itsmattkc
2019-03-26 21:42:45 +11:00
parent 3083e3920b
commit d8acef21a8
51 changed files with 812 additions and 712 deletions
+24
View File
@@ -23,6 +23,8 @@
#include <QDebug>
#include <QtMath>
#include <QPainter>
#include <OpenColorIO/OpenColorIO.h>
namespace OCIO = OCIO_NAMESPACE::v1;
#include "project/previewgenerator.h"
#include "timeline/clip.h"
@@ -45,6 +47,28 @@ Footage::~Footage() {
reset();
}
QString Footage::Colorspace()
{
if (!colorspace_.isEmpty()) {
return colorspace_;
}
// If this footage has no color space set, try to guess the color space from the filename
OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
QString guess_colorspace = config->parseColorSpaceFromString(url.toUtf8());
if (!guess_colorspace.isEmpty()) {
return guess_colorspace;
}
return OCIO::ROLE_SCENE_LINEAR;
}
void Footage::SetColorspace(const QString &cs)
{
colorspace_ = cs;
}
void Footage::reset() {
if (preview_gen != nullptr) {
preview_gen->cancel();