diff --git a/effects/effect.cpp b/effects/effect.cpp index c1f5c01d1..0541823c8 100644 --- a/effects/effect.cpp +++ b/effects/effect.cpp @@ -150,6 +150,10 @@ void Effect::process_audio(uint8_t*, int) {} EffectRow::EffectRow(Effect *parent, QGridLayout *uilayout, const QString &n, int row) : parent_effect(parent), ui(uilayout), name(n), ui_row(row) { ui->addWidget(new QLabel(name), row, 0); + + /*keyframe_enable = new CheckboxEx(); + keyframe_enable->setToolTip("Enable Keyframes"); + ui->addWidget(keyframe_enable, row, 5);*/ } EffectField* EffectRow::add_field(int type, int colspan) { diff --git a/effects/effect.h b/effects/effect.h index a7a023958..182cdfabc 100644 --- a/effects/effect.h +++ b/effects/effect.h @@ -13,6 +13,7 @@ struct Clip; class QXmlStreamReader; class QXmlStreamWriter; class Effect; +class CheckboxEx; #define EFFECT_TYPE_INVALID 0 #define EFFECT_TYPE_VIDEO 1 @@ -98,6 +99,8 @@ private: QString name; int ui_row; QVector fields; + + CheckboxEx* keyframe_enable; }; class Effect : public QObject { @@ -128,6 +131,8 @@ public: bool enable_pre_gl; bool enable_post_gl; + const char* ffmpeg_filter; + virtual void process_gl(int* anchor_x, int* anchor_y); virtual void post_gl(); virtual void process_audio(quint8* samples, int nb_bytes); diff --git a/effects/inverteffect.cpp b/effects/inverteffect.cpp index 6c4153295..25a8fe86d 100644 --- a/effects/inverteffect.cpp +++ b/effects/inverteffect.cpp @@ -9,6 +9,8 @@ #include InvertEffect::InvertEffect(Clip* c) : Effect(c, EFFECT_TYPE_VIDEO, VIDEO_INVERT_EFFECT) { + enable_ffmpeg = true; + ffmpeg_filter = "negate"; EffectRow* amount_row = add_row("Amount:"); amount_val = amount_row->add_field(EFFECT_FIELD_DOUBLE); diff --git a/playback/cacher.cpp b/playback/cacher.cpp index ee3ce6398..d43d4f0e3 100644 --- a/playback/cacher.cpp +++ b/playback/cacher.cpp @@ -414,14 +414,24 @@ void open_clip_worker(Clip* clip) { inputs->pad_idx = 0; inputs->next = 0; - ret = avfilter_graph_parse_ptr(clip->filter_graph, "null", &inputs, &outputs, NULL); + /*ret = avfilter_graph_config(clip->filter_graph, NULL); if (ret < 0) { - qDebug() << "[ERROR] Couldn't set NEGATE filter"; + qDebug() << "[ERROR] AVFilter config failed"; + }*/ + + ret = avfilter_graph_parse_ptr(clip->filter_graph, "gblur=sigma=20:steps=4", &inputs, &outputs, NULL); + if (ret < 0) { + qDebug() << "[ERROR] Couldn't parse filters." << ret; } else { ret = avfilter_graph_config(clip->filter_graph, NULL); if (ret < 0) { - qDebug() << "[ERROR] AVFilter config failed"; + qDebug() << "[ERROR] AVFilter config failed." << ret; } + + /*ret = avfilter_graph_send_command(clip->filter_graph, "gblur", "enable", "2", NULL, 0, 0); + if (ret < 0) { + qDebug() << "[ERROR] Failed to send graph command." << ret << AVERROR(ENOSYS); + }*/ } } } diff --git a/project/undo.cpp b/project/undo.cpp index 905887ffe..d8757f32e 100644 --- a/project/undo.cpp +++ b/project/undo.cpp @@ -34,6 +34,10 @@ QUndoStack undo_stack; #define TA_MODIFY_TRANSITION 11 #define TA_DELETE_TRANSITION 12 +extern "C" { + #include "libavfilter/avfilter.h" +} + TimelineAction::TimelineAction() : done(false), change_seq(false), @@ -423,7 +427,8 @@ void TimelineAction::redo() { { Clip* c = sequences.at(i)->get_clip(clips.at(i)); old_values[i] = c->effects.size(); - c->effects.append(create_effect(new_values.at(i), c)); + Effect* e = create_effect(new_values.at(i), c); + c->effects.append(e); } break; case TA_ADD_TRANSITION: