svn path=/trunk/kdenlive/; revision=5980
-void DocClipBase::setId(const QString &newId)
-{
- m_id = newId;
-}
-
const CLIPTYPE & DocClipBase::clipType() const
{
return m_clipType;
const CLIPTYPE & DocClipBase::clipType() const
{
return m_clipType;
prod = cloneProducer(source);
}
if (prod) {
prod = cloneProducer(source);
}
if (prod) {
- adjustProducerProperties(prod, getId() + "_monitor", false, false);
+ adjustProducerProperties(prod, getId() + "_", false, false);
/** Returns the internal unique id of the clip. */
const QString &getId() const;
/** Returns the internal unique id of the clip. */
const QString &getId() const;
- void setId(const QString &newId);
//KThumb *thumbCreator;
bool audioThumbCreated() const;
//KThumb *thumbCreator;
bool audioThumbCreated() const;
m_requestedThumbs.clear();
m_requestedThumbs.clear();
m_intraFramesQueue.clear();
if (m_audioThumbProducer.isRunning()) {
m_stopAudioThumbs = true;
m_intraFramesQueue.clear();
if (m_audioThumbProducer.isRunning()) {
m_stopAudioThumbs = true;
void KThumb::setProducer(Mlt::Producer *producer)
{
void KThumb::setProducer(Mlt::Producer *producer)
{
m_requestedThumbs.clear();
m_requestedThumbs.clear();
m_intraFramesQueue.clear();
m_future.waitForFinished();
m_intra.waitForFinished();
m_intraFramesQueue.clear();
m_future.waitForFinished();
m_intra.waitForFinished();
void KThumb::extractImage(int frame, int frame2)
{
if (!KdenliveSettings::videothumbnails() || m_producer == NULL) return;
void KThumb::extractImage(int frame, int frame2)
{
if (!KdenliveSettings::videothumbnails() || m_producer == NULL) return;
if (frame != -1 && !m_requestedThumbs.contains(frame)) m_requestedThumbs.append(frame);
if (frame2 != -1 && !m_requestedThumbs.contains(frame2)) m_requestedThumbs.append(frame2);
qSort(m_requestedThumbs);
if (frame != -1 && !m_requestedThumbs.contains(frame)) m_requestedThumbs.append(frame);
if (frame2 != -1 && !m_requestedThumbs.contains(frame2)) m_requestedThumbs.append(frame2);
qSort(m_requestedThumbs);
if (!m_future.isRunning()) {
m_future = QtConcurrent::run(this, &KThumb::doGetThumbs);
}
if (!m_future.isRunning()) {
m_future = QtConcurrent::run(this, &KThumb::doGetThumbs);
}
const int dwidth = (int)(theight * m_dar + 0.5);
while (!m_requestedThumbs.isEmpty()) {
const int dwidth = (int)(theight * m_dar + 0.5);
while (!m_requestedThumbs.isEmpty()) {
int frame = m_requestedThumbs.takeFirst();
int frame = m_requestedThumbs.takeFirst();
if (frame != -1) {
QImage img = getProducerFrame(frame, swidth, dwidth, theight);
emit thumbReady(frame, img);
if (frame != -1) {
QImage img = getProducerFrame(frame, swidth, dwidth, theight);
emit thumbReady(frame, img);
/** @brief List of frame numbers from which we want to extract thumbnails. */
QList <int> m_intraFramesQueue;
QMutex m_mutex;
/** @brief List of frame numbers from which we want to extract thumbnails. */
QList <int> m_intraFramesQueue;
QMutex m_mutex;
void doGetThumbs();
QImage getProducerFrame(int framepos, int frameWidth, int displayWidth, int height);
void doGetThumbs();
QImage getProducerFrame(int framepos, int frameWidth, int displayWidth, int height);
e.setAttribute("length", length);
}
}
e.setAttribute("length", length);
}
}
- m_render->getFileProperties(e, item->clipId(), m_listView->iconSize().height(), true);
resetThumbsProducer(clip);
resetThumbsProducer(clip);
+ m_render->getFileProperties(e, item->clipId(), m_listView->iconSize().height(), true);
m_listView->processLayout();
QDomElement e = clip->toXML().cloneNode().toElement();
e.removeAttribute("file_hash");
m_listView->processLayout();
QDomElement e = clip->toXML().cloneNode().toElement();
e.removeAttribute("file_hash");
- m_render->getFileProperties(e, clip->getId(), m_listView->iconSize().height(), true);
resetThumbsProducer(clip);
resetThumbsProducer(clip);
+ m_render->getFileProperties(e, clip->getId(), m_listView->iconSize().height(), true);
}
else if (item->hasProxy() && !item->isProxyRunning()) {
slotCreateProxy(clip->getId());
}
else if (item->hasProxy() && !item->isProxyRunning()) {
slotCreateProxy(clip->getId());
e.setAttribute("length", length);
}
}
e.setAttribute("length", length);
}
}
+ resetThumbsProducer(clip);
m_render->getFileProperties(e, clip->getId(), m_listView->iconSize().height(), true);
}
m_render->getFileProperties(e, clip->getId(), m_listView->iconSize().height(), true);
}
xml.removeAttribute("proxy_out");
}
bool replace = xml.attribute("replace") == "1";
xml.removeAttribute("proxy_out");
}
bool replace = xml.attribute("replace") == "1";
- m_render->getFileProperties(xml, clip->getId(), m_listView->iconSize().height(), replace);
if (replace) resetThumbsProducer(clip);
if (replace) resetThumbsProducer(clip);
+ m_render->getFileProperties(xml, clip->getId(), m_listView->iconSize().height(), replace);
}
else {
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDropEnabled);
}
else {
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDropEnabled);
{
if (!clip) return;
clip->clearThumbProducer();
{
if (!clip) return;
clip->clearThumbProducer();
- m_thumbnailQueue.removeAll(clip->getId());
+ QString id = clip->getId();
+ m_thumbnailQueue.removeAll(id);
}
void ProjectList::slotProcessNextThumbnail()
}
void ProjectList::slotProcessNextThumbnail()
QString currentId;
int consumerPosition = 0;
if (m_winid == -1) return -1;
QString currentId;
int consumerPosition = 0;
if (m_winid == -1) return -1;
+ if (m_mltProducer) m_mltProducer->set_speed(0);
+ m_mltConsumer->set("refresh", 0);
+ m_mltConsumer->purge();
consumerPosition = m_mltConsumer->position();
if (!m_mltConsumer->is_stopped()) {
m_mltConsumer->stop();
consumerPosition = m_mltConsumer->position();
if (!m_mltConsumer->is_stopped()) {
m_mltConsumer->stop();
- m_mltConsumer->purge();
- m_mltConsumer->set("refresh", 0);
if (m_mltProducer) {
currentId = m_mltProducer->get("id");
if (m_mltProducer) {
currentId = m_mltProducer->get("id");
- m_mltProducer->set_speed(0);
delete m_mltProducer;
m_mltProducer = NULL;
emit stopped();
delete m_mltProducer;
m_mltProducer = NULL;
emit stopped();