started frontend for effect keyframes

This commit is contained in:
itsmattkc
2018-08-18 20:35:19 +10:00
parent 2dde8bde77
commit 2b3d9636db
44 changed files with 1541 additions and 1203 deletions
+24 -9
View File
@@ -15,6 +15,7 @@
#include <QDebug>
#include <QPainter>
#include <QAudioOutput>
#include <QOpenGLShaderProgram>
#include <QtMath>
extern "C" {
@@ -171,18 +172,34 @@ void ViewerWidget::compose_sequence(QVector<Clip*>& nests, bool render_audio) {
if (flip) half_height = -half_height;
glOrtho(-half_width, half_width, half_height, -half_height, -1, 1);
int anchor_x = ms->video_width/2;
int anchor_y = ms->video_height/2;
int anchor_y = ms->video_height/2;
// perform all transform effects
c->run_video_pre_effect_stack(playhead, &anchor_x, &anchor_y);
QOpenGLShaderProgram shader;
for (int i=nests.size()-1;i>=0;i--) {
nests.at(i)->run_video_pre_effect_stack(playhead, &anchor_x, &anchor_y);
for (int j=0;j<c->effects.size();j++) {
if (c->effects.at(j)->enable_opengl && c->effects.at(j)->is_enabled()) c->effects.at(j)->process_gl(shader, &anchor_x, &anchor_y);
}
if (c->opening_transition != NULL) {
int transition_progress = playhead - c->timeline_in;
if (transition_progress < c->opening_transition->length) {
c->opening_transition->process_transition((double)transition_progress/(double)c->opening_transition->length);
}
}
if (c->closing_transition != NULL) {
int transition_progress = c->closing_transition->length - (playhead - c->timeline_in - c->getLength() + c->closing_transition->length);
if (transition_progress < c->closing_transition->length) {
c->closing_transition->process_transition((double)transition_progress/(double)c->closing_transition->length);
}
}
int anchor_right = ms->video_width - anchor_x;
int anchor_bottom = ms->video_height - anchor_y;
bool use_gl_shaders = shader.link();
if (use_gl_shaders) shader.bind();
c->texture->bind();
glBegin(GL_QUADS);
@@ -196,10 +213,9 @@ void ViewerWidget::compose_sequence(QVector<Clip*>& nests, bool render_audio) {
glVertex2f(-anchor_x, anchor_bottom);
glEnd();
c->texture->release();
c->texture->release();
// perform all transform effects
c->run_video_post_effect_stack();
if (use_gl_shaders) shader.release();
}
} else if (render_audio &&
c->stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
@@ -212,7 +228,6 @@ void ViewerWidget::compose_sequence(QVector<Clip*>& nests, bool render_audio) {
case MEDIA_TYPE_SEQUENCE:
nests.append(c);
compose_sequence(nests, render_audio);
c->run_video_post_effect_stack();
break;
}
}