Several things are accomplished in this commit, including: - Use OIIO instead of our own functions for pixel format conversions (cleaner code/less for us to maintain) - Fold all PixelService functions into the PixelFormat class (cleaner code) - Moved OpenGL pixel definitions to OpenGL classes and out of the global classes. - Add support for RGB buffers as well as RGBA (optimization)
69 lines
1.2 KiB
C++
69 lines
1.2 KiB
C++
#include "video.h"
|
|
|
|
#include <QDebug>
|
|
#include <QMatrix4x4>
|
|
#include <QOpenGLPixelTransferOptions>
|
|
|
|
#include "codec/ffmpeg/ffmpegdecoder.h"
|
|
#include "core.h"
|
|
#include "project/item/footage/footage.h"
|
|
#include "render/pixelformat.h"
|
|
|
|
VideoInput::VideoInput()
|
|
{
|
|
matrix_input_ = new NodeInput("matrix_in", NodeInput::kMatrix);
|
|
AddInput(matrix_input_);
|
|
}
|
|
|
|
Node *VideoInput::copy() const
|
|
{
|
|
return new VideoInput();
|
|
}
|
|
|
|
QString VideoInput::Name() const
|
|
{
|
|
return tr("Video Input");
|
|
}
|
|
|
|
QString VideoInput::id() const
|
|
{
|
|
return "org.olivevideoeditor.Olive.videoinput";
|
|
}
|
|
|
|
QString VideoInput::Category() const
|
|
{
|
|
return tr("Input");
|
|
}
|
|
|
|
QString VideoInput::Description() const
|
|
{
|
|
return tr("Import a video footage stream.");
|
|
}
|
|
|
|
NodeInput *VideoInput::matrix_input() const
|
|
{
|
|
return matrix_input_;
|
|
}
|
|
|
|
bool VideoInput::IsAccelerated() const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
QString VideoInput::AcceleratedCodeVertex() const
|
|
{
|
|
return ReadFileAsString(":/shaders/videoinput.vert");
|
|
}
|
|
|
|
QString VideoInput::AcceleratedCodeFragment() const
|
|
{
|
|
return ReadFileAsString(":/shaders/videoinput.frag");
|
|
}
|
|
|
|
void VideoInput::Retranslate()
|
|
{
|
|
MediaInput::Retranslate();
|
|
|
|
matrix_input_->set_name(tr("Transform"));
|
|
}
|