Commit 2bda800f authored by Vincent Pinon's avatar Vincent Pinon

Gardening: fix GCC warnings (6)

parent 34213565
......@@ -223,7 +223,7 @@ void MltDeviceCapture::showFrame(Mlt::Frame &frame)
int height = 0;
const uchar *image = frame.get_image(format, width, height);
QImage qimage(width, height, QImage::Format_RGB888);
memcpy(qimage.scanLine(0), image, width * height * 3);
memcpy(qimage.scanLine(0), image, static_cast<size_t>(width * height * 3));
emit showImageSignal(qimage);
if (sendFrameForAnalysis && frame.get_frame()->convert_image) {
......@@ -249,7 +249,7 @@ void MltDeviceCapture::showAudio(Mlt::Frame &frame)
// Data format: [ c00 c10 c01 c11 c02 c12 c03 c13 ... c0{samples-1} c1{samples-1} for 2 channels.
// So the vector is of size samples*channels.
audioShortVector sampleVector(samples * num_channels);
memcpy(sampleVector.data(), data, samples * num_channels * sizeof(qint16));
memcpy(sampleVector.data(), data, static_cast<size_t>(samples * num_channels * sizeof(qint16)));
if (samples > 0) {
emit audioSamplesSignal(sampleVector, freq, num_channels, samples);
}
......@@ -307,7 +307,7 @@ void MltDeviceCapture::saveFrame(Mlt::Frame &frame)
int height = 0;
const uchar *image = frame.get_image(format, width, height);
QImage qimage(width, height, QImage::Format_RGB888);
memcpy(qimage.bits(), image, width * height * 3);
memcpy(qimage.bits(), image, static_cast<size_t>(width * height * 3));
// Re-enable overlay
Mlt::Service service(m_mltProducer->parent().get_service());
......@@ -638,9 +638,9 @@ void MltDeviceCapture::uyvy2rgb(unsigned char *yuv_buffer, int width, int height
b = 0;
}
rgb_buffer[rgb_ptr] = r;
rgb_buffer[rgb_ptr + 1] = g;
rgb_buffer[rgb_ptr + 2] = b;
rgb_buffer[rgb_ptr] = static_cast<uchar>(r);
rgb_buffer[rgb_ptr + 1] = static_cast<uchar>(g);
rgb_buffer[rgb_ptr + 2] = static_cast<uchar>(b);
rgb_ptr += 3;
r = ((298 * (Y2 - 16) + 409 * (V - 128) + 128) >> 8);
......@@ -667,9 +667,9 @@ void MltDeviceCapture::uyvy2rgb(unsigned char *yuv_buffer, int width, int height
b = 0;
}
rgb_buffer[rgb_ptr] = r;
rgb_buffer[rgb_ptr + 1] = g;
rgb_buffer[rgb_ptr + 2] = b;
rgb_buffer[rgb_ptr] = static_cast<uchar>(r);
rgb_buffer[rgb_ptr + 1] = static_cast<uchar>(g);
rgb_buffer[rgb_ptr + 2] = static_cast<uchar>(b);
rgb_ptr += 3;
}
//emit imageReady(image);
......
......@@ -354,11 +354,11 @@ void DvdWizard::processSpumux()
++i;
}
QFile data(m_menuFile.fileName());
if (data.open(QFile::WriteOnly)) {
data.write(doc.toString().toUtf8());
QFile menuFile(m_menuFile.fileName());
if (menuFile.open(QFile::WriteOnly)) {
menuFile.write(doc.toString().toUtf8());
}
data.close();
menuFile.close();
//qCDebug(KDENLIVE_LOG) << " SPUMUX DATA: " << doc.toString();
......@@ -461,10 +461,10 @@ void DvdWizard::processSpumux()
////qCDebug(KDENLIVE_LOG) << " SPUMUX DATA: " << doc.toString();
if (data.open(QFile::WriteOnly)) {
data.write(docLetter.toString().toUtf8());
if (menuFile.open(QFile::WriteOnly)) {
menuFile.write(docLetter.toString().toUtf8());
}
data.close();
menuFile.close();
spumux.setStandardInputFile(m_menuVobFile.fileName());
spumux.setStandardOutputFile(m_letterboxMovie.fileName());
args.clear();
......
......@@ -176,8 +176,8 @@ void DvdWizardVob::slotShowTranscodeInfo()
QString log = QString(m_transcodeProcess.readAll());
if (m_duration == 0) {
if (log.contains(QStringLiteral("Duration:"))) {
QString data = log.section(QStringLiteral("Duration:"), 1, 1).section(QLatin1Char(','), 0, 0).simplified();
QStringList numbers = data.split(QLatin1Char(':'));
QString durationstr = log.section(QStringLiteral("Duration:"), 1, 1).section(QLatin1Char(','), 0, 0).simplified();
QStringList numbers = durationstr.split(QLatin1Char(':'));
if (numbers.size() < 3) {
return;
}
......@@ -287,7 +287,7 @@ void DvdWizardVob::slotAddVobFile(const QUrl &url, const QString &chapters, bool
Mlt::Profile profile;
profile.set_explicit(false);
QTreeWidgetItem *item = new QTreeWidgetItem(m_vobList, QStringList() << url.toLocalFile() << QString() << KIO::convertSize(fileSize));
QTreeWidgetItem *item = new QTreeWidgetItem(m_vobList, QStringList() << url.toLocalFile() << QString() << KIO::convertSize(static_cast<KIO::filesize_t>(fileSize)));
item->setData(2, Qt::UserRole, fileSize);
item->setData(0, Qt::DecorationRole, QIcon::fromTheme(QStringLiteral("video-x-generic")).pixmap(60, 45));
item->setToolTip(0, url.toLocalFile());
......@@ -377,10 +377,10 @@ void DvdWizardVob::slotAddVobFile(const QUrl &url, const QString &chapters, bool
return;
}
file.close();
QDomNodeList chapters = doc.elementsByTagName(QStringLiteral("chapter"));
QDomNodeList chapterNodes = doc.elementsByTagName(QStringLiteral("chapter"));
QStringList chaptersList;
for (int j = 0; j < chapters.count(); ++j) {
chaptersList.append(QString::number(chapters.at(j).toElement().attribute(QStringLiteral("time")).toInt()));
for (int j = 0; j < chapterNodes.count(); ++j) {
chaptersList.append(QString::number(chapterNodes.at(j).toElement().attribute(QStringLiteral("time")).toInt()));
}
item->setData(1, Qt::UserRole + 1, chaptersList.join(QLatin1Char(';')));
}
......@@ -534,8 +534,8 @@ void DvdWizardVob::slotCheckVobList()
}
qint64 maxSize = (qint64) 47000 * 100000;
m_capacityBar->setValue(100 * totalSize / maxSize);
m_capacityBar->setText(KIO::convertSize(totalSize));
m_capacityBar->setValue(static_cast<int>(100 * totalSize / maxSize));
m_capacityBar->setText(KIO::convertSize(static_cast<KIO::filesize_t>(totalSize)));
}
void DvdWizardVob::slotItemUp()
......@@ -760,7 +760,7 @@ void DvdWizardVob::slotTranscodedClip(const QString &src, const QString &transco
Mlt::Profile profile;
profile.set_explicit(false);
item->setText(2, KIO::convertSize(fileSize));
item->setText(2, KIO::convertSize(static_cast<KIO::filesize_t>(fileSize)));
item->setData(2, Qt::UserRole, fileSize);
item->setData(0, Qt::DecorationRole, QIcon::fromTheme(QStringLiteral("video-x-generic")).pixmap(60, 45));
item->setToolTip(0, transcoded);
......
......@@ -156,7 +156,7 @@
<default></default>
</entry>
<entry name="proxy_profile" type="UInt">
<entry name="proxy_profile" type="Int">
<label>default proxy encoding profile.</label>
<default>0</default>
</entry>
......@@ -171,7 +171,7 @@
<default></default>
</entry>
<entry name="preview_profile" type="UInt">
<entry name="preview_profile" type="Int">
<label>default preview encoding profile.</label>
<default>0</default>
</entry>
......@@ -308,7 +308,7 @@
<default></default>
</entry>
<entry name="audio_device" type="UInt">
<entry name="audio_device" type="Int">
<label>Audio device for SDL output.</label>
<default></default>
</entry>
......@@ -433,12 +433,12 @@
<group name="capture">
<entry name="defaultcapture" type="UInt">
<entry name="defaultcapture" type="Int">
<label>Default video capture system.</label>
<default>0</default>
</entry>
<entry name="firewireformat" type="UInt">
<entry name="firewireformat" type="Int">
<label>Default firewire capture format.</label>
<default>0</default>
</entry>
......@@ -463,7 +463,7 @@
<default>/dev/video0</default>
</entry>
<entry name="v4l_alsadevice" type="UInt">
<entry name="v4l_alsadevice" type="Int">
<label>Audio device for v4l capture.</label>
<default></default>
</entry>
......@@ -503,12 +503,12 @@
<default>false</default>
</entry>
<entry name="v4l_profile" type="UInt">
<entry name="v4l_profile" type="Int">
<label>default v4l encoding profile.</label>
<default>0</default>
</entry>
<entry name="grab_profile" type="UInt">
<entry name="grab_profile" type="Int">
<label>default screen grab encoding profile.</label>
<default>0</default>
</entry>
......@@ -523,7 +523,7 @@
<default></default>
</entry>
<entry name="grab_capture_type" type="UInt">
<entry name="grab_capture_type" type="Int">
<label>capture type.</label>
<default>0</default>
</entry>
......@@ -593,7 +593,7 @@
<default>0</default>
</entry>
<entry name="decklink_profile" type="UInt">
<entry name="decklink_profile" type="Int">
<label>default HDMI encoding profile.</label>
<default>0</default>
</entry>
......
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