Commit b199b115 authored by Nicolas Carion's avatar Nicolas Carion

More clean-up related to profiles

parent dd12da0b
......@@ -320,24 +320,6 @@ void ProfilesDialog::slotDeleteProfile()
}
}
// static
MltVideoProfile ProfilesDialog::getVideoProfileFromXml(const QDomElement &element)
{
MltVideoProfile result;
result.description = element.attribute(QStringLiteral("description"));
result.frame_rate_num = element.attribute(QStringLiteral("frame_rate_num")).toInt();
result.frame_rate_den = element.attribute(QStringLiteral("frame_rate_den")).toInt();
result.width = element.attribute(QStringLiteral("width")).toInt();
result.height = element.attribute(QStringLiteral("height")).toInt();
result.progressive = (element.attribute(QStringLiteral("progressive")).toInt() != 0);
result.sample_aspect_num = element.attribute(QStringLiteral("sample_aspect_num")).toInt();
result.sample_aspect_den = element.attribute(QStringLiteral("sample_aspect_den")).toInt();
result.display_aspect_num = element.attribute(QStringLiteral("display_aspect_num")).toInt();
result.display_aspect_den = element.attribute(QStringLiteral("display_aspect_den")).toInt();
result.colorspace = element.attribute(QStringLiteral("colorspace")).toInt();
result.path = existingProfile(result);
return result;
}
// static
MltVideoProfile ProfilesDialog::getVideoProfile(const QString &name)
......@@ -446,44 +428,7 @@ bool ProfilesDialog::existingProfileDescription(const QString &desc)
return false;
}
// static
QString ProfilesDialog::existingProfile(const MltVideoProfile &profile)
{
// Check if the profile has a matching entry in existing ones
QStringList profilesFilter;
profilesFilter << QStringLiteral("*");
// Check the Mlt profiles
QDir mltDir(KdenliveSettings::mltpath());
QStringList profilesFiles = mltDir.entryList(profilesFilter, QDir::Files);
for (int i = 0; i < profilesFiles.size(); ++i) {
MltVideoProfile test = getProfileFromPath(mltDir.absoluteFilePath(profilesFiles.at(i)), profilesFiles.at(i));
if (!test.isValid()) {
continue;
}
if (test == profile) {
return profilesFiles.at(i);
}
}
// Check custom profiles
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("profiles/"), QStandardPaths::LocateDirectory);
for (int i = 0; i < customProfiles.size(); ++i) {
QDir customDir(customProfiles.at(i));
profilesFiles = customDir.entryList(profilesFilter, QDir::Files);
for (int j = 0; j < profilesFiles.size(); ++j) {
QString path = customDir.absoluteFilePath(profilesFiles.at(j));
MltVideoProfile test = getProfileFromPath(path, path);
if (!test.isValid()) {
continue;
}
if (test == profile) {
return path;
}
}
}
return QString();
}
// static
QList<MltVideoProfile> ProfilesDialog::profilesList()
......@@ -613,6 +558,7 @@ QMap<QString, QString> ProfilesDialog::getProfilesFromProperties(int width, int
}
// static
// TODO refac : delete this and replace by ProfileRepository::saveProfile
void ProfilesDialog::saveProfile(MltVideoProfile &profile, QString profilePath)
{
if (profilePath.isEmpty()) {
......
......@@ -37,13 +37,9 @@ public:
void fillList(const QString &selectedProfile = QString());
static QMap<QString, QString> getSettingsFromFile(const QString &path);
/** @brief Create profile from xml in MLT project file */
static MltVideoProfile getVideoProfileFromXml(const QDomElement &element);
static MltVideoProfile getVideoProfile(const QString &name);
static MltVideoProfile getVideoProfile(Mlt::Profile &profile);
static void saveProfile(MltVideoProfile &profile, QString profilePath = QString());
/** @brief Check if a given profile has a profile file describing it */
static QString existingProfile(const MltVideoProfile &profile);
static bool existingProfileDescription(const QString &desc);
static QList<MltVideoProfile> profilesList();
......
......@@ -1353,8 +1353,8 @@ void KdenliveDoc::loadDocumentProperties()
// try to find matching profile from MLT profile properties
list = m_document.elementsByTagName(QStringLiteral("profile"));
if (!list.isEmpty()) {
MltVideoProfile prof = ProfilesDialog::getVideoProfileFromXml(list.at(0).toElement());
profileFound = pCore->setCurrentProfile(prof.path);
std::unique_ptr<ProfileInfo> xmlProfile(new ProfileParam(list.at(0).toElement()));
profileFound = pCore->setCurrentProfile(ProfileRepository::get()->findMatchingProfile(xmlProfile.get()));
}
}
if (!profileFound) {
......@@ -1386,38 +1386,26 @@ void KdenliveDoc::resetProfile()
emit docModified(true);
}
void KdenliveDoc::slotSwitchProfile()
void KdenliveDoc::slotSwitchProfile(const QString &profile_path)
{
QAction *action = qobject_cast<QAction *>(sender());
if (!action) {
return;
}
QVariantList data = action->data().toList();
if (!data.isEmpty()) {
// we want a profile switch
MltVideoProfile profile = MltVideoProfile(data);
if (profile.isValid()) {
pCore->setCurrentProfile(profile.path);
updateProjectProfile(true);
emit docModified(true);
}
}
pCore->setCurrentProfile(profile_path);
updateProjectProfile(true);
emit docModified(true);
}
void KdenliveDoc::switchProfile(MltVideoProfile profile, const QString &id, const QDomElement &xml)
void KdenliveDoc::switchProfile(std::unique_ptr<ProfileParam> &profile, const QString &id, const QDomElement &xml)
{
// Request profile update
QString matchingProfile = ProfilesDialog::existingProfile(profile);
if (matchingProfile.isEmpty() && (profile.width % 8 != 0)) {
QString matchingProfile = ProfileRepository::get()->findMatchingProfile(profile.get());
if (matchingProfile.isEmpty() && (profile->width() % 8 != 0)) {
// Make sure profile width is a multiple of 8, required by some parts of mlt
profile.adjustWidth();
matchingProfile = ProfilesDialog::existingProfile(profile);
profile->adjustWidth();
matchingProfile = ProfileRepository::get()->findMatchingProfile(profile.get());
}
if (!matchingProfile.isEmpty()) {
// We found a known matching profile, switch and inform user
QMap<QString, QString> profileProperties = ProfilesDialog::getSettingsFromFile(matchingProfile);
profile.path = matchingProfile;
profile.description = profileProperties.value(QStringLiteral("description"));
profile->m_path = matchingProfile;
profile->m_description = ProfileRepository::get()->getProfile(matchingProfile)->description();
if (KdenliveSettings::default_profile().isEmpty()) {
// Default project format not yet confirmed, propose
......@@ -1425,14 +1413,14 @@ void KdenliveDoc::switchProfile(MltVideoProfile profile, const QString &id, cons
KMessageBox::ButtonCode answer = KMessageBox::questionYesNoCancel(
QApplication::activeWindow(),
i18n("Your default project profile is %1, but your clip's profile is %2.\nDo you want to change default profile for future projects ?",
currentProfileDesc, profile.description),
i18n("Change default project profile"), KGuiItem(i18n("Change default to %1", profile.description)),
currentProfileDesc, profile->description()),
i18n("Change default project profile"), KGuiItem(i18n("Change default to %1", profile->description())),
KGuiItem(i18n("Keep current default %1", currentProfileDesc)), KGuiItem(i18n("Ask me later")));
switch (answer) {
case KMessageBox::Yes:
KdenliveSettings::setDefault_profile(profile.path);
pCore->setCurrentProfile(profile.path);
KdenliveSettings::setDefault_profile(profile->path());
pCore->setCurrentProfile(profile->path());
updateProjectProfile(true);
emit docModified(true);
pCore->producerQueue()->getFileProperties(xml, id, 150, true);
......@@ -1449,61 +1437,57 @@ void KdenliveDoc::switchProfile(MltVideoProfile profile, const QString &id, cons
// Build actions for the info message (switch / cancel)
QList<QAction *> list;
QAction *ac = new QAction(KoIconUtils::themedIcon(QStringLiteral("dialog-ok")), i18n("Switch"), this);
QVariantList params;
connect(ac, &QAction::triggered, this, &KdenliveDoc::slotSwitchProfile);
params << profile.toList();
ac->setData(params);
connect(ac, &QAction::triggered, [this, &profile]() {
this->slotSwitchProfile(profile->path());
});
QAction *ac2 = new QAction(KoIconUtils::themedIcon(QStringLiteral("dialog-cancel")), i18n("Cancel"), this);
connect(ac2, &QAction::triggered, this, &KdenliveDoc::slotSwitchProfile);
list << ac << ac2;
pCore->bin()->doDisplayMessage(i18n("Switch to clip profile %1?", profile.descriptiveString()), KMessageWidget::Information, list);
pCore->bin()->doDisplayMessage(i18n("Switch to clip profile %1?", profile->descriptiveString()), KMessageWidget::Information, list);
} else {
// No known profile, ask user if he wants to use clip profile anyway
// Check profile fps so that we don't end up with an fps = 30.003 which would mess things up
QString adjustMessage;
double fps = (double)profile.frame_rate_num / profile.frame_rate_den;
double fps = (double)profile->frame_rate_num() / profile->frame_rate_den();
double fps_int;
double fps_frac = std::modf(fps, &fps_int);
if (fps_frac < 0.4) {
profile.frame_rate_num = (int)fps_int;
profile.frame_rate_den = 1;
profile->m_frame_rate_num = (int)fps_int;
profile->m_frame_rate_den = 1;
} else {
// Check for 23.98, 29.97, 59.94
if (qAbs(fps_int - 23.0) < 1e-5) {
if (qAbs(fps - 23.98) < 0.01) {
profile.frame_rate_num = 24000;
profile.frame_rate_den = 1001;
profile->m_frame_rate_num = 24000;
profile->m_frame_rate_den = 1001;
}
} else if (qAbs(fps_int - 29.0) < 1e-5) {
if (qAbs(fps - 29.97) < 0.01) {
profile.frame_rate_num = 30000;
profile.frame_rate_den = 1001;
profile->m_frame_rate_num = 30000;
profile->m_frame_rate_den = 1001;
}
} else if (qAbs(fps_int - 59.0) < 1e-5) {
if (qAbs(fps - 59.94) < 0.01) {
profile.frame_rate_num = 60000;
profile.frame_rate_den = 1001;
profile->m_frame_rate_num = 60000;
profile->m_frame_rate_den = 1001;
}
} else {
// Unknown profile fps, warn user
adjustMessage = i18n("\nWarning: unknown non integer fps, might cause incorrect duration display.");
}
}
if (qAbs((double)profile.frame_rate_num / profile.frame_rate_den - fps) < 1e-4) {
if (qAbs((double)profile->m_frame_rate_num / profile->m_frame_rate_den - fps) < 1e-4) {
adjustMessage = i18n("\nProfile fps adjusted from original %1", QString::number(fps, 'f', 4));
}
if (KMessageBox::warningContinueCancel(QApplication::activeWindow(),
i18n("No profile found for your clip.\nCreate and switch to new profile (%1x%2, %3fps)?%4", profile.width,
profile.height, QString::number((double)profile.frame_rate_num / profile.frame_rate_den, 'f', 2),
i18n("No profile found for your clip.\nCreate and switch to new profile (%1x%2, %3fps)?%4", profile->m_width,
profile->m_height, QString::number((double)profile->m_frame_rate_num / profile->m_frame_rate_den, 'f', 2),
adjustMessage)) == KMessageBox::Continue) {
profile.description = QStringLiteral("%1x%2 %3fps")
.arg(profile.width)
.arg(profile.height)
.arg(QString::number((double)profile.frame_rate_num / profile.frame_rate_den, 'f', 2));
ProfilesDialog::saveProfile(profile);
// reload profiles from disk
ProfileRepository::get()->refresh();
pCore->setCurrentProfile(profile.path);
profile->m_description = QStringLiteral("%1x%2 %3fps")
.arg(profile->m_width)
.arg(profile->m_height)
.arg(QString::number((double)profile->m_frame_rate_num / profile->m_frame_rate_den, 'f', 2));
ProfileRepository::get()->saveProfile(profile.get());
pCore->setCurrentProfile(profile->m_path);
updateProjectProfile(true);
emit docModified(true);
pCore->producerQueue()->getFileProperties(xml, id, 150, true);
......
......@@ -48,6 +48,7 @@ class ProjectClip;
class ClipController;
class MarkerListModel;
class Render;
class ProfileParam;
class QTextEdit;
class QUndoGroup;
......@@ -235,8 +236,8 @@ private slots:
void slotClipMissing(const QString &path);
void slotProcessModifiedClips();
void slotModified();
void switchProfile(MltVideoProfile profile, const QString &id, const QDomElement &xml);
void slotSwitchProfile();
void switchProfile(std::unique_ptr<ProfileParam> &profile, const QString &id, const QDomElement &xml);
void slotSwitchProfile(const QString &profile_path);
/** @brief Check if we did a new action invalidating more recent undo items. */
void checkPreviewStack();
/** @brief Guides were changed, save to MLT. */
......
......@@ -280,14 +280,14 @@ void ProducerQueue::processFileProperties()
int width = producer->get_int("meta.media.width");
int height = producer->get_int("meta.media.height");
if (width > 100 && height > 100) {
MltVideoProfile projectProfile = ProfilesDialog::getVideoProfile(pCore->getCurrentProfile()->profile());
projectProfile.width = width;
projectProfile.height = height;
projectProfile.sample_aspect_num = 1;
projectProfile.sample_aspect_den = 1;
projectProfile.display_aspect_num = width;
projectProfile.display_aspect_den = height;
projectProfile.description.clear();
std::unique_ptr<ProfileParam> projectProfile(new ProfileParam(pCore->getCurrentProfile().get()));
projectProfile->m_width = width;
projectProfile->m_height = height;
projectProfile->m_sample_aspect_num = 1;
projectProfile->m_sample_aspect_den = 1;
projectProfile->m_display_aspect_num = width;
projectProfile->m_display_aspect_den = height;
projectProfile->m_description.clear();
// delete producer;
// m_processingClipId.removeAll(info.clipId);
info.xml.removeAttribute(QStringLiteral("checkProfile"));
......@@ -310,9 +310,9 @@ void ProducerQueue::processFileProperties()
} else {
blankProfile->from_producer(*producer);
}
MltVideoProfile clipProfile = ProfilesDialog::getVideoProfile(*blankProfile);
MltVideoProfile projectProfile = ProfilesDialog::getVideoProfile(pCore->getCurrentProfile()->profile());
clipProfile.adjustWidth();
std::unique_ptr<ProfileParam> clipProfile(new ProfileParam(blankProfile));
std::unique_ptr<ProfileParam> projectProfile(new ProfileParam(pCore->getCurrentProfile().get()));
clipProfile->adjustWidth();
if (clipProfile != projectProfile) {
// Profiles do not match, propose profile adjustment
// delete producer;
......
......@@ -31,6 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class ClipController;
class BinController;
class ProfileParam;
namespace Mlt {
class Producer;
......@@ -96,7 +97,7 @@ signals:
void requestProxy(const QString &);
void infoProcessingFinished();
/** @brief First clip does not match profect profile, switch. */
void switchProfile(MltVideoProfile profile, const QString &id, const QDomElement &xml);
void switchProfile(std::unique_ptr<ProfileParam> &profile, const QString &id, const QDomElement &xml);
/** @brief The clip is not valid, should be removed from project. */
void removeInvalidClip(const QString &, bool replaceProducer, const QString &message = QString());
/** @brief The proxy is not valid, should be deleted.
......
set(kdenlive_SRCS
${kdenlive_SRCS}
profiles/profileinfo.cpp
profiles/profilerepository.cpp
profiles/profilemodel.cpp
profiles/tree/profiletreemodel.cpp
......
/***************************************************************************
* Copyright (C) 2017 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
#include "profileinfo.hpp"
#include "profileinfo.hpp"
#include <klocalizedstring.h>
#include <mlt++/MltProfile.h>
bool ProfileInfo::operator==(const ProfileInfo &other) const
{
if (!description().isEmpty() && other.description() == description()) {
return true;
}
int fps = frame_rate_num() * 100 / frame_rate_den();
int sar = sample_aspect_num() * 100 / sample_aspect_den();
int dar = display_aspect_num() * 100 / display_aspect_den();
return other.frame_rate_num() * 100 / other.frame_rate_den() == fps && other.width() == width() && other.height() == height() &&
other.progressive() == progressive() && other.sample_aspect_num() * 100 / other.sample_aspect_den() == sar &&
other.display_aspect_num() * 100 / other.display_aspect_den() == dar && other.colorspace() == colorspace();
}
bool ProfileInfo::isCompatible(std::unique_ptr<ProfileInfo> &other) const
{
return frame_rate_num() * 100 / frame_rate_den() == other->frame_rate_num() * 100 / other->frame_rate_den();
}
bool ProfileInfo::isCompatible(Mlt::Profile *other) const
{
return frame_rate_num() * 100 / frame_rate_den() == other->frame_rate_num() * 100 / other->frame_rate_den();
}
QString ProfileInfo::colorspaceDescription() const
{
// TODO: should the descriptions be translated?
switch (colorspace()) {
case 601:
return QStringLiteral("ITU-R 601");
case 709:
return QStringLiteral("ITU-R 709");
case 240:
return QStringLiteral("SMPTE240M");
default:
return i18n("Unknown");
}
}
const QString ProfileInfo::descriptiveString() const
{
QString data = description();
if (!data.isEmpty()) {
data.append(QLatin1Char(' '));
}
QString fps_str;
if (frame_rate_num() % frame_rate_den() == 0) {
fps_str = QString::number(frame_rate_num() / frame_rate_den());
} else {
fps_str = QString::number((double)frame_rate_num() / frame_rate_den(), 'f', 2);
}
data.append(QStringLiteral("(%1x%2, %3fps)").arg(width()).arg(height()).arg(fps_str));
return data;
}
const QString ProfileInfo::dialogDescriptiveString() const
{
QString text;
if (frame_rate_num() % frame_rate_den() == 0) {
text = QString::number(frame_rate_num() / frame_rate_den());
} else {
text = QString::number((double)frame_rate_num() / frame_rate_den(), 'f', 2);
}
text.append(i18nc("frames per second", "fps"));
if (!progressive()) {
text.append(i18n(" interlaced"));
}
return text;
}
/***************************************************************************
* Copyright (C) 2017 by Nicolas Carion *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef PROFILEINFO_H
#define PROFILEINFO_H
#include <QString>
#include <memory>
namespace Mlt{
class Profile;
}
/* @brief This is a virtual class that represents any profile that we can get info from
*/
class ProfileInfo
{
public:
ProfileInfo() = default;
virtual ~ProfileInfo() = default;
virtual bool is_valid() const = 0;
virtual QString description() const = 0;
virtual int frame_rate_num() const = 0;
virtual int frame_rate_den() const = 0;
virtual double fps() const = 0;
virtual int width() const = 0;
virtual int height() const = 0;
virtual bool progressive() const = 0;
virtual int sample_aspect_num() const = 0;
virtual int sample_aspect_den() const = 0;
virtual double sar() const = 0;
virtual int display_aspect_num() const = 0;
virtual int display_aspect_den() const = 0;
virtual double dar() const = 0;
virtual int colorspace() const = 0;
QString colorspaceDescription() const;
virtual QString path() const = 0;
/* @brief overload of comparison operators */
bool operator==(const ProfileInfo &other) const;
bool operator!=(const ProfileInfo &other) const;
/** @brief Returns true if both profiles have same fps, and can be mixed with the xml producer */
bool isCompatible(std::unique_ptr<ProfileInfo> &other) const;
bool isCompatible(Mlt::Profile *other) const;
virtual void adjustWidth() = 0;
const QString descriptiveString() const;
const QString dialogDescriptiveString() const;
};
#endif
......@@ -127,50 +127,135 @@ int ProfileModel::colorspace() const
return m_profile->colorspace();
}
bool ProfileInfo::operator==(const ProfileInfo &other) const
{
if (!description().isEmpty() && other.description() == description()) {
return true;
}
int fps = frame_rate_num() * 100 / frame_rate_den();
int sar = sample_aspect_num() * 100 / sample_aspect_den();
int dar = display_aspect_num() * 100 / display_aspect_den();
return other.frame_rate_num() * 100 / other.frame_rate_den() == fps && other.width() == width() && other.height() == height() &&
other.progressive() == progressive() && other.sample_aspect_num() * 100 / other.sample_aspect_den() == sar &&
other.display_aspect_num() * 100 / other.display_aspect_den() == dar && other.colorspace() == colorspace();
}
QString ProfileModel::path() const
{
return m_path;
}
QString ProfileInfo::colorspaceDescription() const
void ProfileModel::set_explicit(int b)
{
// TODO: should the descriptions be translated?
switch (colorspace()) {
case 601:
return QStringLiteral("ITU-R 601");
case 709:
return QStringLiteral("ITU-R 709");
case 240:
return QStringLiteral("SMPTE240M");
default:
return i18n("Unknown");
}
m_profile->set_explicit(b);
}
void ProfileModel::set_explicit(int b)
ProfileParam::ProfileParam(const QDomElement &element)
: m_description(element.attribute(QStringLiteral("description")))
, m_frame_rate_num(element.attribute(QStringLiteral("frame_rate_num")).toInt())
, m_frame_rate_den(element.attribute(QStringLiteral("frame_rate_den")).toInt())
, m_width(element.attribute(QStringLiteral("width")).toInt())
, m_height(element.attribute(QStringLiteral("height")).toInt())
, m_progressive((element.attribute(QStringLiteral("progressive")).toInt() != 0))
, m_sample_aspect_num(element.attribute(QStringLiteral("sample_aspect_num")).toInt())
, m_sample_aspect_den(element.attribute(QStringLiteral("sample_aspect_den")).toInt())
, m_display_aspect_num(element.attribute(QStringLiteral("display_aspect_num")).toInt())
, m_display_aspect_den(element.attribute(QStringLiteral("display_aspect_den")).toInt())
, m_colorspace(element.attribute(QStringLiteral("colorspace")).toInt())
{
m_fps = m_frame_rate_num / m_frame_rate_den;
m_sar = m_sample_aspect_num / m_sample_aspect_den;
m_dar = m_display_aspect_num / m_display_aspect_den;
}
ProfileParam::ProfileParam(ProfileInfo *p)
: m_frame_rate_num(p->frame_rate_num())
, m_frame_rate_den(p->frame_rate_den())
, m_width(p->width())
, m_height(p->height())
, m_progressive(p-> progressive())
, m_sample_aspect_num(p->sample_aspect_num())
, m_sample_aspect_den(p->sample_aspect_den())
, m_display_aspect_num(p->display_aspect_num())
, m_display_aspect_den(p->display_aspect_den())
, m_colorspace(p->colorspace())
, m_fps(p->fps())
, m_sar(p->sar())
, m_dar(p->dar())
{
m_profile->set_explicit(b);
}
bool ProfileInfo::isCompatible(std::unique_ptr<ProfileInfo> &other) const
ProfileParam::ProfileParam(Mlt::Profile *p)
: m_frame_rate_num(p->frame_rate_num())
, m_frame_rate_den(p->frame_rate_den())
, m_width(p->width())
, m_height(p->height())
, m_progressive(p-> progressive())
, m_sample_aspect_num(p->sample_aspect_num())
, m_sample_aspect_den(p->sample_aspect_den())
, m_display_aspect_num(p->display_aspect_num())
, m_display_aspect_den(p->display_aspect_den())
, m_colorspace(p->colorspace())
, m_fps(p->fps())
, m_sar(p->sar())
, m_dar(p->dar())
{
}
QString ProfileParam::path() const
{
return m_path;
}
QString ProfileParam::description() const
{
return m_description;
}
int ProfileParam::frame_rate_num() const
{
return m_frame_rate_num;
}
int ProfileParam::frame_rate_den() const
{
return m_frame_rate_den;
}
int ProfileParam::width() const
{
return m_width;
}
int ProfileParam::height() const
{
return m_height;
}
bool ProfileParam::progressive() const
{
return m_progressive;
}
int ProfileParam::sample_aspect_num() const
{
return m_sample_aspect_num;
}
int ProfileParam::sample_aspect_den() const
{
return m_sample_aspect_den;
}
int ProfileParam::display_aspect_num() const
{
return m_display_aspect_num;
}
int ProfileParam::display_aspect_den() const
{
return m_display_aspect_den;
}
int ProfileParam::colorspace() const
{
return m_colorspace;
}
double ProfileParam::fps() const
{