merged video and audio nodes into a single media node
They performed exactly the same function so I don't think we need the clutter. Also bumped the project version, but old projects are automatically converted.
This commit is contained in:
@@ -31,7 +31,7 @@ PreCacheTask::PreCacheTask(VideoStreamPtr footage, Sequence* sequence) :
|
||||
viewer()->set_video_params(sequence->video_params());
|
||||
viewer()->set_audio_params(sequence->audio_params());
|
||||
|
||||
video_node_ = new VideoInput();
|
||||
video_node_ = new MediaInput();
|
||||
video_node_->SetStream(footage);
|
||||
|
||||
NodeParam::ConnectEdge(video_node_->output(), viewer()->texture_input());
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef PRECACHETASK_H
|
||||
#define PRECACHETASK_H
|
||||
|
||||
#include "node/input/media/video/video.h"
|
||||
#include "node/input/media/media.h"
|
||||
#include "project/item/footage/footage.h"
|
||||
#include "project/item/sequence/sequence.h"
|
||||
#include "task/render/render.h"
|
||||
@@ -46,7 +46,7 @@ protected:
|
||||
private:
|
||||
VideoStreamPtr footage_;
|
||||
|
||||
VideoInput* video_node_;
|
||||
MediaInput* video_node_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ ProjectLoadTask::ProjectLoadTask(const QString &filename) :
|
||||
bool ProjectLoadTask::Run()
|
||||
{
|
||||
QFile project_file(GetFilename());
|
||||
uint project_version;
|
||||
|
||||
if (project_file.open(QFile::ReadOnly | QFile::Text)) {
|
||||
QXmlStreamReader reader(&project_file);
|
||||
@@ -45,7 +46,7 @@ bool ProjectLoadTask::Run()
|
||||
if (reader.name() == QStringLiteral("olive")) {
|
||||
while(XMLReadNextStartElement(&reader)) {
|
||||
if (reader.name() == QStringLiteral("version")) {
|
||||
uint project_version = reader.readElementText().toUInt();
|
||||
project_version = reader.readElementText().toUInt();
|
||||
|
||||
if (project_version > Core::kProjectVersion) {
|
||||
// Project is newer than we support
|
||||
@@ -63,7 +64,7 @@ bool ProjectLoadTask::Run()
|
||||
|
||||
project_->set_filename(GetFilename());
|
||||
|
||||
project_->Load(&reader, &layout_info_, &IsCancelled());
|
||||
project_->Load(&reader, &layout_info_, project_version, &IsCancelled());
|
||||
|
||||
// Ensure project is in main thread
|
||||
project_->moveToThread(qApp->thread());
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
|
||||
#include "node/block/clip/clip.h"
|
||||
#include "node/block/gap/gap.h"
|
||||
#include "node/input/media/audio/audio.h"
|
||||
#include "node/input/media/video/video.h"
|
||||
#include "node/input/media/media.h"
|
||||
#include "project/item/folder/folder.h"
|
||||
#include "project/item/sequence/sequence.h"
|
||||
|
||||
@@ -172,12 +171,10 @@ bool LoadOTIOTask::Run()
|
||||
}
|
||||
|
||||
if (probed_item && probed_item->type() == Item::kFootage) {
|
||||
MediaInput* media;
|
||||
MediaInput* media = new MediaInput();
|
||||
if (track->track_type() == Timeline::kTrackTypeVideo) {
|
||||
media = new VideoInput();
|
||||
media->SetStream(probed_item->get_first_stream_of_type(Stream::kVideo));
|
||||
} else {
|
||||
media = new AudioInput();
|
||||
media->SetStream(probed_item->get_first_stream_of_type(Stream::kAudio));
|
||||
}
|
||||
sequence->AddNode(media);
|
||||
|
||||
Reference in New Issue
Block a user