]> git.sesse.net Git - kdenlive/blobdiff - src/mltdevicecapture.cpp
Const'ify. Use QLatin1String
[kdenlive] / src / mltdevicecapture.cpp
index 6a23773d9f3cd06500eb9f60f0a73ae71856440f..32b8529e27091c3ce38cad01bda2e5262be2c2ff 100644 (file)
@@ -33,6 +33,7 @@
 #include <QString>
 #include <QApplication>
 #include <QThread>
+#include <QTimer>
 
 #include <cstdlib>
 #include <cstdarg>
@@ -252,13 +253,14 @@ void MltDeviceCapture::emitFrameUpdated(Mlt::Frame& frame)
     }
     */
 
-    mlt_image_format format = mlt_image_rgb24a;
+    mlt_image_format format = mlt_image_rgb24;
     int width = 0;
     int height = 0;
     const uchar* image = frame.get_image(format, width, height);
-    QImage qimage(width, height, QImage::Format_ARGB32_Premultiplied);
-    memcpy(qimage.bits(), image, width * height * 4);
-    emit frameUpdated(qimage.rgbSwapped());
+    QImage qimage(width, height, QImage::Format_RGB888);
+    //QImage qimage(width, height, QImage::Format_ARGB32_Premultiplied);
+    memcpy(qimage.bits(), image, width * height * 3);
+    emit frameUpdated(qimage);
 }
 
 void MltDeviceCapture::showFrame(Mlt::Frame& frame)
@@ -456,7 +458,7 @@ bool MltDeviceCapture::slotStartCapture(const QString &params, const QString &pa
 
     QStringList paramList = params.split(' ', QString::SkipEmptyParts);
     char *tmp2;
-    for (int i = 0; i < paramList.count(); i++) {
+    for (int i = 0; i < paramList.count(); ++i) {
         tmp = qstrdup(paramList.at(i).section('=', 0, 0).toUtf8().constData());
         QString value = paramList.at(i).section('=', 1, 1);
         if (value == "%threads") value = QString::number(QThread::idealThreadCount());
@@ -770,3 +772,5 @@ void MltDeviceCapture::slotAllowPreview()
 }
 
 
+
+#include "mltdevicecapture.moc"