]> git.sesse.net Git - kdenlive/blobdiff - src/renderer.cpp
Add an fps counter for debugging.
[kdenlive] / src / renderer.cpp
index 19067517d83c19d6adc93d3f30b1aa62653e231a..fb61b814e43d2f711e0aadc790a0106f60fa101f 100644 (file)
@@ -22,7 +22,6 @@
  *                                                                         *
  ***************************************************************************/
 
-
 #include "renderer.h"
 #include "kdenlivesettings.h"
 #include "kthumb.h"
@@ -281,7 +280,7 @@ void Render::buildConsumer(const QString &profileName)
                 m_mltConsumer->set("terminate_on_pause", 0);
                 m_mltConsumer->set("deinterlace_method", KdenliveSettings::mltdeinterlacer().toUtf8().constData());
                 m_mltConsumer->set("rescale", KdenliveSettings::mltinterpolation().toUtf8().constData());
-                m_mltConsumer->set("buffer", "1");
+                m_mltConsumer->set("buffer", "25");
                 m_mltConsumer->set("real_time", KdenliveSettings::mltthreads());
             }
             if (m_mltConsumer && m_mltConsumer->is_valid()) {
@@ -328,7 +327,7 @@ void Render::buildConsumer(const QString &profileName)
                 m_consumerThreadStartedEvent = m_mltConsumer->listen("consumer-thread-started", this, (mlt_listener) consumer_thread_started);
                 m_consumerThreadStoppedEvent = m_mltConsumer->listen("consumer-thread-stopped", this, (mlt_listener) consumer_thread_stopped);
             }
-            m_mltConsumer->set("buffer", "1");
+            m_mltConsumer->set("buffer", "25");
             m_showFrameEvent = m_mltConsumer->listen("consumer-frame-show", this, (mlt_listener) consumer_gl_frame_show);
         }
     } else {
@@ -1954,8 +1953,7 @@ void Render::showFrame(Mlt::Frame* frame)
         const uint8_t* image = frame->get_image(format, width, height);
         const GLuint* texnum = (GLuint *)image;
         if (format == mlt_image_glsl_texture) {
-          emit showImageSignal(*texnum);
-          delete frame;
+          emit showImageSignal(frame, *texnum);
         } else {
           QImage qimage(width, height, QImage::Format_ARGB32_Premultiplied);
           memcpy(qimage.scanLine(0), image, width * height * 4);
@@ -2965,8 +2963,8 @@ bool Render::addFilterToService(Mlt::Service service, EffectsParameterList param
             Mlt::Filter *filter = new Mlt::Filter(*m_mltProfile, qstrdup(tag.toUtf8().constData()));
             if (filter && filter->is_valid()) {
                 filter->set("kdenlive_id", qstrdup(params.paramValue("id").toUtf8().constData()));
-                int x1 = keyFrames.at(0).section(':', 0, 0).toInt();
-                double y1 = keyFrames.at(0).section(':', 1, 1).toDouble();
+                int x1 = keyFrames.at(0).section('=', 0, 0).toInt();
+                double y1 = keyFrames.at(0).section('=', 1, 1).toDouble();
                 for (int j = 0; j < params.count(); j++) {
                     filter->set(params.at(j).name().toUtf8().constData(), params.at(j).value().toUtf8().constData());
                 }
@@ -2985,10 +2983,10 @@ bool Render::addFilterToService(Mlt::Service service, EffectsParameterList param
             Mlt::Filter *filter = new Mlt::Filter(*m_mltProfile, qstrdup(tag.toUtf8().constData()));
             if (filter && filter->is_valid()) {
                 filter->set("kdenlive_id", qstrdup(params.paramValue("id").toUtf8().constData()));
-                int x1 = keyFrames.at(i).section(':', 0, 0).toInt() + offset;
-                double y1 = keyFrames.at(i).section(':', 1, 1).toDouble();
-                int x2 = keyFrames.at(i + 1).section(':', 0, 0).toInt();
-                double y2 = keyFrames.at(i + 1).section(':', 1, 1).toDouble();
+                int x1 = keyFrames.at(i).section('=', 0, 0).toInt() + offset;
+                double y1 = keyFrames.at(i).section('=', 1, 1).toDouble();
+                int x2 = keyFrames.at(i + 1).section('=', 0, 0).toInt();
+                double y2 = keyFrames.at(i + 1).section('=', 1, 1).toDouble();
                 if (x2 == -1) x2 = duration;
 
                 for (int j = 0; j < params.count(); j++) {