moved sequence params into node graph too
Reduces code by reusing more of the existing node infrastructure to synchronize sequence parameters the render backend.
This commit is contained in:
@@ -147,7 +147,7 @@ void ProjectImportTask::ValidateImageSequence(Footage *footage, QFileInfoList& i
|
||||
// see if it ends with numbers.
|
||||
if (Decoder::GetImageSequenceDigitCount(footage->filename()) > 0
|
||||
&& !image_sequence_ignore_files_.contains(footage->filename())) {
|
||||
Stream video_stream = footage->GetStreamAt(Stream::kVideo, 0);
|
||||
VideoParams video_stream = footage->GetVideoParams(0);
|
||||
QSize dim(video_stream.width(), video_stream.height());
|
||||
|
||||
int64_t ind = Decoder::GetImageSequenceIndex(footage->filename());
|
||||
@@ -205,16 +205,16 @@ void ProjectImportTask::ValidateImageSequence(Footage *footage, QFileInfoList& i
|
||||
|
||||
if (is_sequence) {
|
||||
// User has confirmed it is a still image, let's set it accordingly.
|
||||
video_stream.set_video_type(Stream::kVideoTypeImageSequence);
|
||||
video_stream.set_video_type(VideoParams::kVideoTypeImageSequence);
|
||||
|
||||
rational default_timebase = Config::Current()[QStringLiteral("DefaultSequenceFrameRate")].value<rational>();
|
||||
video_stream.set_timebase(default_timebase);
|
||||
video_stream.set_time_base(default_timebase);
|
||||
video_stream.set_frame_rate(default_timebase.flipped());
|
||||
|
||||
video_stream.set_start_time(start_index);
|
||||
video_stream.set_duration(end_index - start_index + 1);
|
||||
|
||||
footage->SetStreamAt(Stream::kVideo, 0, video_stream);
|
||||
footage->SetVideoParams(0, video_stream);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,22 +225,15 @@ void ProjectImportTask::ValidateImageSequence(Footage *footage, QFileInfoList& i
|
||||
|
||||
bool ProjectImportTask::ItemIsStillImageFootageOnly(Footage* footage)
|
||||
{
|
||||
if (footage->GetStreamCount() != 1) {
|
||||
if (footage->GetTotalStreamCount() != 1) {
|
||||
// Footage with more than one stream (usually video+audio) most likely isn't an image sequence
|
||||
return false;
|
||||
}
|
||||
|
||||
if (footage->GetStreamAt(0).type() != Stream::kVideo) {
|
||||
// Footage with no video stream definitely isn't an image sequence
|
||||
return false;
|
||||
}
|
||||
VideoParams vp = footage->GetVideoParams(0);
|
||||
|
||||
if (footage->GetStreamAt(0).video_type() != Stream::kVideoTypeStill) {
|
||||
// If video type is not a still, this definitely isn't a video stream
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
// Footage must be valid and video stream must be a still image to be an image sequence
|
||||
return vp.is_valid() && vp.video_type() == VideoParams::kVideoTypeStill;
|
||||
}
|
||||
|
||||
bool ProjectImportTask::CompareStillImageSize(Footage* footage, const QSize &sz)
|
||||
@@ -249,7 +242,7 @@ bool ProjectImportTask::CompareStillImageSize(Footage* footage, const QSize &sz)
|
||||
return false;
|
||||
}
|
||||
|
||||
Stream stream = footage->GetStreamAt(Stream::kVideo, 0);
|
||||
VideoParams stream = footage->GetVideoParams(0);
|
||||
|
||||
return stream.width() == sz.width() && stream.height() == sz.height();
|
||||
}
|
||||
|
||||
@@ -41,26 +41,29 @@ bool ProjectLoadTask::Run()
|
||||
if (project_file.open(QFile::ReadOnly | QFile::Text)) {
|
||||
QXmlStreamReader reader(&project_file);
|
||||
|
||||
bool ok;
|
||||
uint project_version = reader.documentVersion().toUInt(&ok);
|
||||
|
||||
if (!ok) {
|
||||
SetError(tr("Failed to determine project's version identifier."));
|
||||
return false;
|
||||
} else if (project_version > Core::kProjectVersion) {
|
||||
// Project is newer than we support
|
||||
SetError(tr("This project is newer than this version of Olive and cannot be opened."));
|
||||
return false;
|
||||
} else if (project_version < 210122) { // Change this if we drop support for a project version
|
||||
// Project is older than we support
|
||||
SetError(tr("This project is from a version of Olive that is no longer supported in this version."));
|
||||
return false;
|
||||
}
|
||||
uint project_version;
|
||||
|
||||
while (XMLReadNextStartElement(&reader)) {
|
||||
if (reader.name() == QStringLiteral("olive")) {
|
||||
while(XMLReadNextStartElement(&reader)) {
|
||||
if (reader.name() == QStringLiteral("url")) {
|
||||
if (reader.name() == QStringLiteral("version")) {
|
||||
bool ok;
|
||||
|
||||
project_version = reader.readElementText().toUInt(&ok);
|
||||
|
||||
if (!ok) {
|
||||
SetError(tr("Failed to determine project's version identifier."));
|
||||
return false;
|
||||
} else if (project_version > Core::kProjectVersion) {
|
||||
// Project is newer than we support
|
||||
SetError(tr("This project is newer than this version of Olive and cannot be opened."));
|
||||
return false;
|
||||
} else if (project_version < 210122) { // Change this if we drop support for a project version
|
||||
// Project is older than we support
|
||||
SetError(tr("This project is from a version of Olive that is no longer supported in this version."));
|
||||
return false;
|
||||
}
|
||||
} else if (reader.name() == QStringLiteral("url")) {
|
||||
project_saved_url_ = reader.readElementText();
|
||||
} else if (reader.name() == QStringLiteral("project")) {
|
||||
project_ = new Project();
|
||||
|
||||
@@ -46,12 +46,14 @@ bool ProjectSaveTask::Run()
|
||||
QXmlStreamWriter writer(&project_file);
|
||||
writer.setAutoFormatting(true);
|
||||
|
||||
// Version is stored in YYMMDD from whenever the project format was last changed
|
||||
// Allows easy integer math for checking project versions.
|
||||
writer.writeStartDocument(QString::number(Core::kProjectVersion));
|
||||
writer.writeStartDocument();
|
||||
|
||||
writer.writeStartElement("olive");
|
||||
|
||||
// Version is stored in YYMMDD from whenever the project format was last changed
|
||||
// Allows easy integer math for checking project versions.
|
||||
writer.writeTextElement(QStringLiteral("version"), QString::number(Core::kProjectVersion));
|
||||
|
||||
writer.writeTextElement("url", project_->filename());
|
||||
|
||||
writer.writeStartElement(QStringLiteral("project"));
|
||||
|
||||
Reference in New Issue
Block a user