本文整理汇总了C++中mlt::Producer::is_blank方法的典型用法代码示例。如果您正苦于以下问题:C++ Producer::is_blank方法的具体用法?C++ Producer::is_blank怎么用?C++ Producer::is_blank使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mlt::Producer
的用法示例。
在下文中一共展示了Producer::is_blank方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create
bool MltPreview::create(const QString &path, int width, int height, QImage &img)
{
Mlt::Profile *profile = new Mlt::Profile("dv_pal");
Mlt::Producer *producer = new Mlt::Producer(*profile, path.toUtf8().data());
if (producer->is_blank()) {
delete producer;
return false;
}
int frame = 75;
uint variance = 10;
int ct = 1;
//img = getFrame(producer, frame, width, height);
while (variance <= 40 && ct < 4) {
img = getFrame(producer, frame, width, height);
variance = imageVariance(img);
frame += 100 * ct;
ct++;
}
delete producer;
delete profile;
return (img.isNull() == false);
}
示例2: initializeBin
void BinController::initializeBin(Mlt::Playlist playlist)
{
// Load folders
Mlt::Properties folderProperties;
Mlt::Properties playlistProps(playlist.get_properties());
folderProperties.pass_values(playlistProps, "kdenlive:folder.");
QMap <QString,QString> foldersData;
for (int i = 0; i < folderProperties.count(); i++) {
foldersData.insert(folderProperties.get_name(i), folderProperties.get(i));
}
emit loadFolders(foldersData);
// Read notes
QString notes = playlistProps.get("kdenlive:documentnotes");
emit setDocumentNotes(notes);
// Fill Controller's list
m_binPlaylist = new Mlt::Playlist(playlist);
m_binPlaylist->set("id", kPlaylistTrackId);
int max = m_binPlaylist->count();
for (int i = 0; i < max; i++) {
Mlt::Producer *producer = m_binPlaylist->get_clip(i);
if (producer->is_blank() || !producer->is_valid()) continue;
QString id = producer->parent().get("id");
if (id.contains(QStringLiteral("_"))) {
// This is a track producer
QString mainId = id.section(QStringLiteral("_"), 0, 0);
QString track = id.section(QStringLiteral("_"), 1, 1);
if (m_clipList.contains(mainId)) {
// The controller for this track producer already exists
}
else {
// Create empty controller for this track
ClipController *controller = new ClipController(this);
m_clipList.insert(mainId, controller);
}
delete producer;
}
else {
if (m_clipList.contains(id) && m_clipList.value(id)) {
//Controller was already added by a track producer, add master now
m_clipList.value(id)->addMasterProducer(producer->parent());
}
else {
// Controller has not been created yet
ClipController *controller = new ClipController(this, producer->parent());
// fix MLT somehow adding root to color producer's resource (report upstream)
if (strcmp(producer->parent().get("mlt_service"), "color") == 0) {
QString color = producer->parent().get("resource");
if (color.contains(QStringLiteral("/"))) {
color = color.section(QStringLiteral("/"), -1, -1);
producer->parent().set("resource", color.toUtf8().constData());
}
}
m_clipList.insert(id, controller);
}
}
emit loadingBin(i + 1);
}
// Load markers
Mlt::Properties markerProperties;
markerProperties.pass_values(playlistProps, "kdenlive:marker.");
QMap <QString,QString> markersData;
for (int i = 0; i < markerProperties.count(); i++) {
QString markerId = markerProperties.get_name(i);
QString controllerId = markerId.section(QStringLiteral(":"), 0, 0);
ClipController *ctrl = m_clipList.value(controllerId);
if (!ctrl) continue;
ctrl->loadSnapMarker(markerId.section(QStringLiteral(":"), 1), markerProperties.get(i));
}
}