Merge branch 'master' into ocio_node
This commit is contained in:
@@ -21,6 +21,10 @@
|
||||
#ifndef AUDIOPARAMS_H
|
||||
#define AUDIOPARAMS_H
|
||||
|
||||
extern "C" {
|
||||
#include <libavutil/channel_layout.h>
|
||||
}
|
||||
|
||||
#include <QtMath>
|
||||
#include <QXmlStreamReader>
|
||||
#include <QXmlStreamWriter>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#define SHADERJOB_H
|
||||
|
||||
#include <QMatrix4x4>
|
||||
#include <QVector>
|
||||
|
||||
#include "generatejob.h"
|
||||
#include "render/colorprocessor.h"
|
||||
@@ -119,7 +120,15 @@ public:
|
||||
shader_desc_ = shader_desc;
|
||||
}
|
||||
|
||||
void SetVertexCoordinates(const QVector<float> &vertex_coords)
|
||||
{
|
||||
vertex_overrides_ = vertex_coords;
|
||||
}
|
||||
|
||||
const QVector<float>& GetVertexCoordinates()
|
||||
{
|
||||
return vertex_overrides_;
|
||||
}
|
||||
|
||||
private:
|
||||
QString shader_id_;
|
||||
@@ -133,7 +142,10 @@ private:
|
||||
bool use_ocio_;
|
||||
|
||||
ColorProcessorPtr color_processor_;
|
||||
|
||||
OCIO::GpuShaderDescRcPtr shader_desc_;
|
||||
|
||||
QVector<float> vertex_overrides_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -569,7 +569,13 @@ void OpenGLRenderer::Blit(QVariant s, ShaderJob job, Texture *destination, Video
|
||||
QOpenGLBuffer vert_vbo_;
|
||||
vert_vbo_.create();
|
||||
vert_vbo_.bind();
|
||||
vert_vbo_.allocate(blit_vertices.constData(), blit_vertices.size() * sizeof(GLfloat));
|
||||
// If the job has vertex coordinate overrides use them instead of the defaults.
|
||||
if (!job.GetVertexCoordinates().isEmpty()) {
|
||||
Q_ASSERT(job.GetVertexCoordinates().size() == 18);
|
||||
vert_vbo_.allocate(job.GetVertexCoordinates().constData(), job.GetVertexCoordinates().size() * sizeof(float));
|
||||
} else {
|
||||
vert_vbo_.allocate(blit_vertices.constData(), blit_vertices.size() * sizeof(GLfloat));
|
||||
}
|
||||
vert_vbo_.release();
|
||||
|
||||
QOpenGLBuffer frag_vbo_;
|
||||
@@ -886,7 +892,11 @@ GLuint OpenGLRenderer::CompileShader(GLenum type, const QString &code)
|
||||
QStringLiteral("#version 120\n\n");
|
||||
#endif
|
||||
|
||||
QString complete_code = shader_preamble;
|
||||
QString complete_code;
|
||||
|
||||
if (!code.startsWith(QStringLiteral("#version"))) {
|
||||
complete_code = shader_preamble;
|
||||
}
|
||||
|
||||
if (code.isEmpty()) {
|
||||
// Use default code
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
#include <QVector3D>
|
||||
#include <QVector4D>
|
||||
|
||||
#include "audio/packedprocessor.h"
|
||||
#include "audio/planarprocessor.h"
|
||||
#include "audio/tempoprocessor.h"
|
||||
#include "node/block/clip/clip.h"
|
||||
#include "node/block/transition/transition.h"
|
||||
#include "node/project/project.h"
|
||||
@@ -288,8 +291,35 @@ NodeValueTable RenderProcessor::GenerateBlockTable(const Track *track, const Tim
|
||||
// Just silence, don't think there's any other practical application of 0 speed audio
|
||||
samples_from_this_block->silence();
|
||||
} else if (!qFuzzyCompare(speed_value, 1.0)) {
|
||||
// Multiply time
|
||||
samples_from_this_block->speed(speed_value);
|
||||
if (clip_cast->maintain_audio_pitch()) {
|
||||
PackedProcessor packer;
|
||||
packer.Open(samples_from_this_block->audio_params());
|
||||
|
||||
QByteArray packed = packer.Convert(samples_from_this_block);
|
||||
|
||||
if (!packed.isEmpty()) {
|
||||
TempoProcessor tp;
|
||||
tp.Open(samples_from_this_block->audio_params(), speed_value);
|
||||
|
||||
// FIXME: This is not the best way to do this, the TempoProcessor works best
|
||||
// when it's given a continuous stream of audio, which is challenging
|
||||
// in our current "modular" audio system. This should still work reasonably
|
||||
// well on export (assuming audio is all generated at once on export), but
|
||||
// users may hear clicks and pops in the audio during preview due to this
|
||||
// approach.
|
||||
tp.Push(packed);
|
||||
tp.Flush();
|
||||
packed = tp.Pull();
|
||||
tp.Close();
|
||||
|
||||
PlanarProcessor planar;
|
||||
planar.Open(samples_from_this_block->audio_params());
|
||||
samples_from_this_block = planar.Convert(packed);
|
||||
}
|
||||
} else {
|
||||
// Multiply time
|
||||
samples_from_this_block->speed(speed_value);
|
||||
}
|
||||
}
|
||||
|
||||
if (reversed) {
|
||||
|
||||
Reference in New Issue
Block a user