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();
+6 -4
View File
@@ -65,7 +65,8 @@ struct FootageStream {
QVector<char> audio_preview;
};
struct Footage {
class Footage {
public:
Footage();
~Footage();
@@ -82,10 +83,9 @@ struct Footage {
bool alpha_is_associated;
int start_number;
#ifndef NO_OCIO
// color management
QString colorspace;
#endif
QString Colorspace();
void SetColorspace(const QString& cs);
// proxy config
bool proxy;
@@ -107,6 +107,8 @@ struct Footage {
long get_length_in_frames(double frame_rate);
FootageStream *get_stream_from_file_index(bool video, int index);
void reset();
private:
QString colorspace_;
};
using FootagePtr = std::shared_ptr<Footage>;
+3
View File
@@ -34,6 +34,9 @@
#include <QFile>
#include <QTreeWidgetItem>
const int LOAD_TYPE_VERSION = 100;
const int LOAD_TYPE_URL = 101;
LoadThread::LoadThread(const QString& filename, bool autorecovery) :
filename_(filename),
autorecovery_(autorecovery),
+1 -1
View File
@@ -33,11 +33,11 @@ extern "C" {
#include "undo/undo.h"
#include "undo/undostack.h"
#include "global/config.h"
#include "panels/viewer.h"
#include "panels/project.h"
#include "ui/icons.h"
#include "projectmodel.h"
#include "global/debug.h"
#include "global/timing.h"
QString get_interlacing_name(int interlacing) {
switch (interlacing) {
+2 -2
View File
@@ -432,7 +432,7 @@ void SourcesCommon::clear_proxies_from_selected() {
if (olive::ActiveSequence != nullptr) {
// close all clips so we can delete any proxies requested to be deleted
close_active_clips(olive::ActiveSequence.get());
olive::ActiveSequence->Close();
}
// delete proxies requested to be deleted
@@ -442,7 +442,7 @@ void SourcesCommon::clear_proxies_from_selected() {
if (olive::ActiveSequence != nullptr) {
// update viewer (will re-open active clips with original media)
panel_sequence_viewer->viewer_widget->frame_update();
panel_sequence_viewer->viewer_widget()->frame_update();
}
olive::Global->set_modified(true);