static void kdenlive_callback(void* /*ptr*/, int level, const char* fmt, va_list vl)
{
+// kDebug() << "log level" << level << QString().vsprintf(fmt, vl).simplified();
if (level > MLT_LOG_ERROR) return;
QString error;
QApplication::postEvent(qApp->activeWindow(), new MltErrorEvent(error.vsprintf(fmt, vl).simplified()));
if (m_mltConsumer) m_mltConsumer->set("full_screen", 1);
}
-void Render::buildConsumer(const QString profileName)
+void Render::buildConsumer(const QString &profileName)
{
delete m_blackClip;
m_blackClip = NULL;
return clip;
}
-int Render::resetProfile(const QString profileName, bool dropSceneList)
+int Render::resetProfile(const QString &profileName, bool dropSceneList)
{
QString scene;
if (!dropSceneList) scene = sceneList();
}
}
-void Render::getFileProperties(const QDomElement xml, const QString &clipId, int imageHeight, bool replaceProducer, bool selectClip)
+void Render::getFileProperties(const QDomElement &xml, const QString &clipId, int imageHeight, bool replaceProducer, bool selectClip)
{
QString path;
QLocale locale;
}
blockSignals(true);
- // WARNING: disabled because it caused crashes (see Kdenlive bug #2205 and #2206) - jbm
- /*if (KdenliveSettings::projectloading_avformatnovalidate())
- playlist.replace(">avformat</property>", ">avformat-novalidate</property>");
- else
- playlist.replace(">avformat-novalidate</property>", ">avformat</property>");*/
+
+ m_locale = QLocale();
+
m_mltProducer = new Mlt::Producer(*m_mltProfile, "xml-string", playlist.toUtf8().constData());
if (!m_mltProducer || !m_mltProducer->is_valid()) {
kDebug() << " WARNING - - - - -INVALID PLAYLIST: " << playlist.toUtf8().constData();
void Render::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);
- memcpy(qimage.bits(), image, width * height * 4);
- emit frameUpdated(qimage.rgbSwapped());
+ QImage qimage(width, height, QImage::Format_RGB888);
+ memcpy(qimage.bits(), image, width * height * 3);
+ emit frameUpdated(qimage);
}
void Render::emitFrameNumber(double position)
return true;
}
-int Render::mltGetSpaceLength(const GenTime pos, int track, bool fromBlankStart)
+int Render::mltGetSpaceLength(const GenTime &pos, int track, bool fromBlankStart)
{
if (!m_mltProducer) {
kDebug() << "PLAYLIST NOT INITIALISED //////";
return trackProducer.get_playtime() - 1;
}
-void Render::mltInsertSpace(QMap <int, int> trackClipStartList, QMap <int, int> trackTransitionStartList, int track, const GenTime duration, const GenTime timeOffset)
+void Render::mltInsertSpace(QMap <int, int> trackClipStartList, QMap <int, int> trackTransitionStartList, int track, const GenTime &duration, const GenTime &timeOffset)
{
if (!m_mltProducer) {
kDebug() << "PLAYLIST NOT INITIALISED //////";
kWarning() << "// TRACTOR PROBLEM";
return -1;
}
-
+
//kDebug() << "Changing clip speed, set in and out: " << info.cropStart.frames(m_fps) << " to " << (info.endPos - info.startPos).frames(m_fps) - 1;
Mlt::Tractor tractor(service);
Mlt::Producer trackProducer(tractor.track(info.track));
return newLength;
}
-bool Render::mltRemoveTrackEffect(int track, QString index, bool updateIndex)
+bool Render::mltRemoveTrackEffect(int track, int index, bool updateIndex)
{
Mlt::Service service(m_mltProducer->parent().get_service());
bool success = false;
int ct = 0;
Mlt::Filter *filter = clipService.filter(ct);
while (filter) {
- if ((index == "-1" && strcmp(filter->get("kdenlive_id"), "")) || filter->get_int("kdenlive_ix") == index.toInt()) {
+ if ((index == -1 && strcmp(filter->get("kdenlive_id"), "")) || filter->get_int("kdenlive_ix") == index) {
if (clipService.detach(*filter) == 0) success = true;
} else if (updateIndex) {
// Adjust the other effects index
- if (filter->get_int("kdenlive_ix") > index.toInt()) filter->set("kdenlive_ix", filter->get_int("kdenlive_ix") - 1);
+ if (filter->get_int("kdenlive_ix") > index) filter->set("kdenlive_ix", filter->get_int("kdenlive_ix") - 1);
ct++;
} else ct++;
filter = clipService.filter(ct);
return success;
}
-bool Render::mltRemoveEffect(int track, GenTime position, QString index, bool updateIndex, bool doRefresh)
+bool Render::mltRemoveEffect(int track, GenTime position, int index, bool updateIndex, bool doRefresh)
{
if (position < GenTime()) {
// Remove track effect
}
delete clip;
-// if (tag.startsWith("ladspa")) tag = "ladspa";
m_isBlocked = true;
mlt_service_lock(service.get_service());
int ct = 0;
Mlt::Filter *filter = clipService.filter(ct);
while (filter) {
- if ((index == "-1" && strcmp(filter->get("kdenlive_id"), "")) || filter->get_int("kdenlive_ix") == index.toInt()) {// && filter->get("kdenlive_id") == id) {
+ if ((index == -1 && strcmp(filter->get("kdenlive_id"), "")) || filter->get_int("kdenlive_ix") == index) {// && filter->get("kdenlive_id") == id) {
if (clipService.detach(*filter) == 0) success = true;
//kDebug()<<"Deleted filter id:"<<filter->get("kdenlive_id")<<", ix:"<<filter->get("kdenlive_ix")<<", SERVICE:"<<filter->get("mlt_service");
} else if (updateIndex) {
// Adjust the other effects index
- if (filter->get_int("kdenlive_ix") > index.toInt()) filter->set("kdenlive_ix", filter->get_int("kdenlive_ix") - 1);
+ if (filter->get_int("kdenlive_ix") > index) filter->set("kdenlive_ix", filter->get_int("kdenlive_ix") - 1);
ct++;
} else ct++;
filter = clipService.filter(ct);
bool Render::mltEditEffect(int track, GenTime position, EffectsParameterList params)
{
- QString index = params.paramValue("kdenlive_ix");
+ int index = params.paramValue("kdenlive_ix").toInt();
QString tag = params.paramValue("tag");
if (!params.paramValue("keyframes").isEmpty() || /*it.key().startsWith("#") || */tag.startsWith("ladspa") || tag == "sox" || tag == "autotrack_rectangle" || params.hasParam("region")) {
Mlt::Filter *filter = clip->filter(ct);
while (filter) {
- if (filter->get_int("kdenlive_ix") == index.toInt()) {
+ if (filter->get_int("kdenlive_ix") == index) {
break;
}
ct++;