Commit 4d3b2399 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

don't use proxy when exporting frame:

http://www.kdenlive.org/mantis/view.php?id=2096

svn path=/trunk/kdenlive/; revision=5549
parent 690108f5
......@@ -566,7 +566,13 @@ void Monitor::slotSetThumbFrame()
void Monitor::slotExtractCurrentFrame()
{
QImage frame = render->extractFrame(render->seekFramePosition());
QImage frame;
// check if we are using a proxy
if (m_currentClip && !m_currentClip->getProperty("proxy").isEmpty() && m_currentClip->getProperty("proxy") != "-") {
// using proxy, use original clip url to get frame
frame = render->extractFrame(render->seekFramePosition(), m_currentClip->fileURL().path());
}
else frame = render->extractFrame(render->seekFramePosition());
KFileDialog *fs = new KFileDialog(KUrl(), "image/png", this);
fs->setOperationMode(KFileDialog::Saving);
fs->setMode(KFile::File);
......
......@@ -406,14 +406,26 @@ int Render::renderHeight() const
return m_mltProfile->height();
}
QImage Render::extractFrame(int frame_position, int width, int height)
QImage Render::extractFrame(int frame_position, QString path, int width, int height)
{
if (width == -1) {
width = renderWidth();
height = renderHeight();
} else if (width % 2 == 1) width++;
if (!m_mltProducer) {
if (!path.isEmpty()) {
Mlt::Producer *producer = new Mlt::Producer(*m_mltProfile, path.toUtf8().constData());
if (producer) {
if (producer->is_valid()) {
QImage img = KThumb::getFrame(producer, frame_position, width, height);
delete producer;
return img;
}
else delete producer;
}
}
if (!m_mltProducer || !path.isEmpty()) {
QImage pix(width, height, QImage::Format_RGB32);
pix.fill(Qt::black);
return pix;
......
......@@ -131,7 +131,7 @@ Q_OBJECT public:
void stop(const GenTime & startTime);
int volume() const;
QImage extractFrame(int frame_position, int width = -1, int height = -1);
QImage extractFrame(int frame_position, QString path = QString(), int width = -1, int height = -1);
/** @brief Plays the scene starting from a specific time.
* @param startTime time to start playing the scene from */
......
......@@ -782,7 +782,7 @@ void TitleWidget::displayBackgroundFrame()
p.end();
m_frameImage->setPixmap(bg);
} else {
m_frameImage->setPixmap(QPixmap::fromImage(m_render->extractFrame((int) m_render->seekPosition().frames(m_render->fps()), m_frameWidth / 2, m_frameHeight / 2)));
m_frameImage->setPixmap(QPixmap::fromImage(m_render->extractFrame((int) m_render->seekPosition().frames(m_render->fps()), QString(), m_frameWidth / 2, m_frameHeight / 2)));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment