uint8_t* data;
int frame_width = 0;
int frame_height = 0;
+ //frame->set("rescale.interp", "nearest");
+ frame->set("normalised_height", height);
+ frame->set("normalised_width", width);
mlt_frame_get_image(frame->get_frame(), &data, &format, &frame_width, &frame_height, 0);
QPixmap pix(width, height);
uint8_t *new_image = (uint8_t *)mlt_pool_alloc(frame_width * (frame_height + 1) * 4);
QImage image((uchar *)new_image, frame_width, frame_height, QImage::Format_ARGB32);
if (!image.isNull()) {
- QImage scale = image.scaled(width, height, Qt::KeepAspectRatio, Qt::SmoothTransformation).rgbSwapped();
- pix = pix.fromImage(scale);
+ //QImage scale = image.scaled(width, height, Qt::KeepAspectRatio, Qt::SmoothTransformation).rgbSwapped();
+ image = image.rgbSwapped();
+ pix = pix.fromImage(image);
} else pix.fill(Qt::black);
mlt_pool_release(new_image);
if (frame) delete frame;
void ProjectList::slotRefreshClipThumbnail(ProjectItem *item) {
if (item) {
- int height = 40;
- int width = (int)(height * (double) m_render->renderWidth() / m_render->renderHeight());
+ int height = 50;
+ int width = (int)(height * m_render->dar());
QPixmap pix = KThumb::getImage(item->toXml(), item->referencedClip()->getProjectThumbFrame(), width, height);
//QPixmap pix = KThumb::getFrame(item->toXml()), 0, width, height);
item->setIcon(0, pix);
return true;
}
+const double Render::dar() const {
+ return m_mltProfile->dar();
+}
+
void Render::getFileProperties(const QDomElement &xml, int clipId) {
int height = 50;
int width = (int)(height * m_mltProfile->dar());
Mlt::Producer producer(*m_mltProfile, "westley-xml", tmp);
delete[] tmp;
+/* Mlt::Filter filter(*m_mltProfile, "rescale");
+ producer.attach(filter);*/
+ //mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "_fezzik", 1 );
+
if (producer.is_blank()) {
return;
}
//kDebug() << "/////// PRODUCER: " << url.path() << " IS: " << producer.get_playtime();
Mlt::Frame * frame = producer.get_frame();
- //frame->set("rescale", "nearest");
- //filePropertyMap["fps"] = QString::number(mlt_producer_get_fps(producer.get_producer()));
filePropertyMap["fps"] = producer.get("source_fps");
if (frame && frame->is_valid()) {
uint8_t* data;
int frame_width = 0;
int frame_height = 0;
+ //frame->set("rescale.interp", "hyper");
+ frame->set("normalised_height", height);
+ frame->set("normalised_width", width);
mlt_frame_get_image(frame->get_frame(), &data, &format, &frame_width, &frame_height, 0);
-
+ //kDebug()<<"/// GOT TUMB, SIZE: "<<frame_width<<"x"<<frame_height;
QPixmap pix(width, height);
uint8_t *new_image = (uint8_t *)mlt_pool_alloc(frame_width * (frame_height + 1) * 4);
mlt_convert_yuv422_to_rgb24a((uint8_t *)data, new_image, frame_width * frame_height);
QImage image((uchar *)new_image, frame_width, frame_height, QImage::Format_ARGB32);
if (!image.isNull()) {
- QImage scale = image.scaled(width, height, Qt::KeepAspectRatio, Qt::SmoothTransformation).rgbSwapped();
- pix = pix.fromImage(scale);
+ image = image.rgbSwapped();// = image.scaled(width, height, Qt::KeepAspectRatio, Qt::SmoothTransformation).rgbSwapped();
+ pix = pix.fromImage(image);
} else pix.fill(Qt::black);
mlt_pool_release(new_image);
emit replyGetImage(clipId, 0, pix, width, height);