本文整理汇总了C++中mlt::Producer::get方法的典型用法代码示例。如果您正苦于以下问题:C++ Producer::get方法的具体用法?C++ Producer::get怎么用?C++ Producer::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mlt::Producer
的用法示例。
在下文中一共展示了Producer::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cacheKey
QString ThumbnailProvider::cacheKey(Mlt::Producer& producer, int frameNumber)
{
QString time = producer.frames_to_time(frameNumber, mlt_time_clock);
// Reduce the precision to centiseconds to increase chance for cache hit
// without much loss of accuracy.
time = time.left(time.size() - 1);
QString key = QString("%1 %2")
.arg(producer.get("resource"))
.arg(time);
QCryptographicHash hash(QCryptographicHash::Sha1);
hash.addData(key.toUtf8());
return hash.result().toHex();
}
示例2: resource
QString Controller::resource() const
{
QString resource;
if (!m_producer)
return resource;
resource = QString(m_producer->get("resource"));
if (m_producer->type() == tractor_type) {
Mlt::Tractor tractor((mlt_tractor) m_producer->get_service());
Mlt::Multitrack* multitrack = tractor.multitrack();
if (multitrack->is_valid()) {
Mlt::Producer* producer = multitrack->track(0);
if (producer->is_valid())
resource = QString(producer->get("resource"));
delete producer;
}
delete multitrack;
}
return resource;
}
示例3: ntscProfile
Mlt::Producer *DirectShowVideoWidget::producer(Mlt::Profile& profile)
{
#if 0
if (!profile.is_explicit()) {
Mlt::Profile ntscProfile("dv_ntsc");
Mlt::Profile palProfile("dv_pal");
if (ui->v4lWidthSpinBox->value() == ntscProfile.width() && ui->v4lHeightSpinBox->value() == ntscProfile.height()) {
profile.set_sample_aspect(ntscProfile.sample_aspect_num(), ntscProfile.sample_aspect_den());
profile.set_progressive(ntscProfile.progressive());
profile.set_colorspace(ntscProfile.colorspace());
profile.set_frame_rate(ntscProfile.frame_rate_num(), ntscProfile.frame_rate_den());
} else if (ui->v4lWidthSpinBox->value() == palProfile.width() && ui->v4lHeightSpinBox->value() == palProfile.height()) {
profile.set_sample_aspect(palProfile.sample_aspect_num(), palProfile.sample_aspect_den());
profile.set_progressive(palProfile.progressive());
profile.set_colorspace(palProfile.colorspace());
profile.set_frame_rate(palProfile.frame_rate_num(), palProfile.frame_rate_den());
} else {
profile.set_width(ui->v4lWidthSpinBox->value());
profile.set_height(ui->v4lHeightSpinBox->value());
profile.set_sample_aspect(1, 1);
profile.set_progressive(1);
profile.set_colorspace(601);
profile.set_frame_rate(ui->v4lFramerateSpinBox->value() * 10000, 10000);
}
}
#endif
Mlt::Producer* p = 0;
if (ui->videoCombo->currentIndex() > 0) {
p = new Mlt::Producer(profile, QString("dshow:video=%1")
.arg(ui->videoCombo->currentText())
.toLatin1().constData());
}
if (ui->audioCombo->currentIndex() > 0) {
Mlt::Producer* audio = new Mlt::Producer(profile,
QString("dshow:audio=%1").arg(ui->audioCombo->currentText())
.toLatin1().constData());
if (p && p->is_valid() && audio->is_valid()) {
Mlt::Tractor* tractor = new Mlt::Tractor;
tractor->set("_profile", profile.get_profile(), 0);
tractor->set("resource", p->get("resource"));
tractor->set("resource2", audio->get("resource"));
tractor->set_track(*p, 0);
delete p;
tractor->set_track(*audio, 1);
delete audio;
p = tractor;
} else {
p = audio;
}
}
if (!p || !p->is_valid()) {
delete p;
p = new Mlt::Producer(profile, "color:");
if (ui->videoCombo->currentIndex() > 0) {
p->set("resource", QString("dshow:video=%1")
.arg(ui->videoCombo->currentText())
.toLatin1().constData());
}
if (ui->audioCombo->currentIndex() > 0) {
QString resource = QString("dshow:audio=%1").arg(ui->audioCombo->currentText());
if (ui->videoCombo->currentIndex() > 0) {
p->set("resource2", resource.toLatin1().constData());
} else {
p->set("resource", resource.toLatin1().constData());
}
}
p->set("error", 1);
}
p->set("force_seekable", 0);
return p;
}