developed beginnings of media node

This commit is contained in:
itsmattkc
2019-07-20 12:34:57 -07:00
parent 6c52c45aea
commit 3605a2f988
21 changed files with 298 additions and 24 deletions
+22
View File
@@ -0,0 +1,22 @@
# Olive - Non-Linear Video Editor
# Copyright (C) 2019 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/input/media/media.h
node/input/media/media.cpp
PARENT_SCOPE
)
+55
View File
@@ -0,0 +1,55 @@
#include "media.h"
MediaInput::MediaInput() :
texture_(nullptr)
{
footage_input_ = new NodeInput();
footage_input_->add_data_input(NodeInput::kFootage);
AddParameter(footage_input_);
texture_output_ = new NodeOutput();
texture_output_->set_data_type(NodeOutput::kTexture);
AddParameter(texture_output_);
}
QString MediaInput::Name()
{
return tr("Media");
}
QString MediaInput::id()
{
return "org.olivevideoeditor.Olive.mediainput";
}
QString MediaInput::Category()
{
return tr("Input");
}
QString MediaInput::Description()
{
return tr("Import a footage stream.");
}
NodeOutput *MediaInput::texture_output()
{
return texture_output_;
}
void MediaInput::Process(const rational &time)
{
// FIXME: Use OIIO and OCIO here
// FIXME: Test code
Q_UNUSED(time)
if (texture_ == nullptr) {
QImage img("/home/matt/Desktop/oof.png");
texture_ = new QOpenGLTexture(img);
}
texture_output_->set_value(texture_->textureId());
// End test code
}
+38
View File
@@ -0,0 +1,38 @@
#ifndef IMAGE_H
#define IMAGE_H
#include <QOpenGLTexture>
#include "node/node.h"
/**
* @brief A node that imports an image
*
* FIXME: This will likely be replaced by the Media node as the Media node will be set up to pull from various decoders
* from the beginning.
*/
class MediaInput : public Node
{
Q_OBJECT
public:
MediaInput();
virtual QString Name() override;
virtual QString id() override;
virtual QString Category() override;
virtual QString Description() override;
NodeOutput* texture_output();
public slots:
virtual void Process(const rational &time) override;
private:
NodeInput* footage_input_;
NodeOutput* texture_output_;
QOpenGLTexture* texture_;
};
#endif // IMAGE_H