Remove some macro, debug on qml image loads, order of headers

This commit is contained in:
Julien Wadel 2020-02-07 09:25:16 +01:00
parent d6efd66d20
commit 79ed60ff72
11 changed files with 84 additions and 41 deletions

View file

@ -36,6 +36,29 @@ set(ASSETS_DIR "assets")
option(ENABLE_UPDATE_CHECK "Enable update check." NO)
option(ENABLE_GPL_THIRD_PARTIES "" YES)
option(ENABLE_NON_FREE_CODECS "Allow inclusion of non-free codecs in the build." YES)
option(ENABLE_AMRNB "" YES)
option(ENABLE_AMRWB "" YES)
option(ENABLE_BV16 "Build mediastreamer2 with the BV16 codec." YES)
option(ENABLE_G729 "Build mediastreamer2 with the G726 codec." YES)
#option(ENABLE_G729B_CNG "Build mediastreamer2 with G729 annex B cng." NO)
option(ENABLE_GSM "Build mediastreamer2 with the GSM codec." YES)
option(ENABLE_ILBC "" YES)
option(ENABLE_ISAC "" YES)
option(ENABLE_OPUS "Build mediastreamer2 with the OPUS codec." YES)
option(ENABLE_SILK "" YES)
#option(ENABLE_SPEEX "" YES)
option(ENABLE_SPEEX_CODEC "Build mediastreamer2 with the SPEEX codec." YES)
option(ENABLE_SPEEX_DSP "Build mediastreamer2 with the SPEEX DSP support." YES)
option(ENABLE_FFMPEG "Build mediastreamer2 with ffmpeg video support." YES)
option(ENABLE_H263 "" YES)
option(ENABLE_H263P "" YES)
option(ENABLE_MPEG4 "" YES)
option(ENABLE_OPENH264 "Embedded OpenH264" YES)
option(ENABLE_VPX "Build mediastreamer2 with VPX codec." YES)
option(ENABLE_MKV "Enable support of MKV files reading and writing." YES)
include(GNUInstallDirs)
include(CheckCXXCompilerFlag)
@ -72,6 +95,8 @@ if (NOT WIN32)
if (SUGGEST_OVERRIDE)
set(CUSTOM_FLAGS "${CUSTOM_FLAGS} -Wsuggest-override -Werror=suggest-override")
endif ()
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CUSTOM_FLAGS "${CUSTOM_FLAGS} -Wno-switch")
endif ()
set(CUSTOM_FLAGS "${CUSTOM_FLAGS} -DQT_NO_EXCEPTIONS")
@ -327,6 +352,14 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/pre-commit"
)
set(_QML_IMPORT_PATHS "")
list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/modules")
list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/dev-modules")
list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/scripts")
list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/views")
set(QML_IMPORT_PATH ${_QML_IMPORT_PATHS} CACHE STRING "Path used to locate CMake modules by Qt Creator" FORCE)
# ------------------------------------------------------------------------------
# Create config.h file
# ------------------------------------------------------------------------------

View file

@ -8,24 +8,25 @@ IF NOT EXIST build-minizip mkdir build-minizip
cd ../../..
:: SDK Building
cd linphone-sdk/build-sdk
cmake .. -DLINPHONESDK_PLATFORM=Desktop -DENABLE_CSHARP_WRAPPER=YES -DCMAKE_BUILD_TYPE=Debug -DENABLE_VPX=ON -A Win32
cd linphone-sdk/build-sdk
cmake .. -DLINPHONESDK_PLATFORM=Desktop -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_VPX=YES -A Win32 -DENABLE_GPL_THIRD_PARTIES=YES -DENABLE_NON_FREE_CODECS=YES -DENABLE_AMRNB=YES -DENABLE_AMRWB=YES -DENABLE_G729=YES -DENABLE_GSM=YES -DENABLE_ILBC=YES -DENABLE_ISAC=YES -DENABLE_OPUS=YES -DENABLE_SILK=YES -DENABLE_SPEEX=YES -DENABLE_H263=YES -DENABLE_H263P=YES -DENABLE_MPEG4=YES -DENABLE_OPENH264=YES -DENABLE_FFMPEG=YES -DENABLE_VIDEO=YES -DENABLE_GL=YES
::cmake .. -DLINPHONESDK_PLATFORM=Desktop -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_VPX=YES -A Win32 -DENABLE_VIDEO=YES -DENABLE_GL=YES
if %errorlevel% neq 0 exit /b %errorlevel%
cmake --build . --target sdk --parallel 5
cmake --build . --target sdk --config RelWithDebInfo --parallel 5
if %errorlevel% neq 0 exit /b %errorlevel%
robocopy linphone-sdk\desktop ..\..\build-desktop\OUTPUT /e /njh /njs /ndl /nc /ns
cd ../..
:: Minizip Submodule Building
cd submodules/externals/minizip/build-minizip
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../build-desktop/OUTPUT -DCMAKE_PREFIX_PATH="../../../linphone-sdk/build-sdk/linphone-sdk/desktop" -A Win32
cmake --build . --target all_build --config Debug -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false
cmake --build . --target install --config Debug -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=../../../../build-desktop/OUTPUT -DCMAKE_PREFIX_PATH="../../../linphone-sdk/build-sdk/linphone-sdk/desktop" -A Win32
cmake --build . --target all_build --config RelWithDebInfo -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false
cmake --build . --target install --config RelWithDebInfo -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false
cd ../../../..
:: Desktop Building
cd build-desktop
cmake .. -DENABLE_CSHARP_WRAPPER=YES -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=OUTPUT -DCMAKE_PREFIX_PATH="linphone-sdk/build-sdk/linphone-sdk/desktop;submodules/externals/minizip/build-minizip/OUTPUT" -A Win32
cmake .. -DENABLE_CSHARP_WRAPPER=YES -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=OUTPUT -DCMAKE_PREFIX_PATH="linphone-sdk/build-sdk/linphone-sdk/desktop" -A Win32
if %errorlevel% neq 0 exit /b %errorlevel%
cmake --build . --target all_build --config Debug -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false
cmake --build . --target install --config Debug -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false
cmake --build . --target all_build --config RelWithDebInfo --parallel 5 -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false
cmake --build . --target install --config RelWithDebInfo -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false

View file

@ -19,7 +19,11 @@
* Created on: February 2, 2017
* Author: Ronan Abhamon
*/
#include "App.hpp"
#ifdef Q_OS_WIN
#include <QSettings>
#endif // ifdef Q_OS_WIN
#include <QCommandLineParser>
#include <QDir>
#include <QFileSelector>
@ -31,12 +35,7 @@
#include <QSystemTrayIcon>
#include <QTimer>
#ifdef Q_OS_WIN
#include <QSettings>
#endif // ifdef Q_OS_WIN
#include "config.h"
#include "cli/Cli.hpp"
#include "components/Components.hpp"
#include "logger/Logger.hpp"
@ -48,8 +47,6 @@
#include "utils/LinphoneUtils.hpp"
#include "utils/Utils.hpp"
#include "App.hpp"
// =============================================================================
using namespace std;

View file

@ -21,11 +21,14 @@
*/
#include "AppController.hpp"
#include <qloggingcategory.h>
// =============================================================================
int main (int argc, char *argv[]) {
QApplication::setOrganizationName("Belledonne-Communications");
QApplication::setOrganizationDomain("linphone.org");
AppController controller(argc, argv);
//QLoggingCategory::setFilterRules("*.debug=true;qml=false");
App *app = controller.getApp();
if (app->isSecondary())
{

View file

@ -247,8 +247,8 @@ ImageProvider::ImageProvider () : QQuickImageProvider(
QImage ImageProvider::requestImage (const QString &id, QSize *size, const QSize &requestedSize) {
const QString path = QStringLiteral(":%1").arg(id);
qDebug() << QStringLiteral("Image `%1` requested with size: (%2, %3).")
.arg(path).arg(requestedSize.width()).arg(requestedSize.height());
// qDebug() << QStringLiteral("Image `%1` requested with size: (%2, %3).")
// .arg(path).arg(requestedSize.width()).arg(requestedSize.height());
QElapsedTimer timer;
timer.start();
@ -298,7 +298,7 @@ QImage ImageProvider::requestImage (const QString &id, QSize *size, const QSize
QPainter painter(&image);
renderer.render(&painter);
qDebug() << QStringLiteral("Image `%1` loaded in %2 milliseconds.").arg(path).arg(timer.elapsed());
// qDebug() << QStringLiteral("Image `%1` loaded in %2 milliseconds.").arg(path).arg(timer.elapsed());
return image;
}

View file

@ -38,16 +38,16 @@
#include <signal.h>
#endif // ifdef Q_OS_UNIX
#ifdef Q_OS_WIN
#include <windows.h>
#include <lmcons.h>
#endif // ifdef Q_OS_WIN
#include "utils/Utils.hpp"
#include "SingleApplication.hpp"
#include "SingleApplicationPrivate.hpp"
#ifdef Q_OS_WIN
#include <lmcons.h>
#include <windows.h>
#endif // ifdef Q_OS_WIN
// =============================================================================
using namespace std;
@ -61,7 +61,7 @@ namespace {
// -----------------------------------------------------------------------------
SingleApplicationPrivate::SingleApplicationPrivate (SingleApplication *q_ptr) : q_ptr(q_ptr) {
SingleApplicationPrivate::SingleApplicationPrivate (SingleApplication *p_ptr) : q_ptr(p_ptr) {
server = nullptr;
socket = nullptr;
}
@ -104,7 +104,7 @@ void SingleApplicationPrivate::genBlockServerName (int timeout) {
// User level block requires a user specific data in the hash
if (options & SingleApplication::Mode::User) {
#ifdef Q_OS_WIN
Q_UNUSED(timeout);
Q_UNUSED(timeout)
wchar_t username[UNLEN + 1];
// Specifies size of the buffer on input
DWORD usernameLength = UNLEN + 1;
@ -265,7 +265,9 @@ void SingleApplicationPrivate::slotConnectionEstablished () {
tmp = nextConnSocket->read(checksum.length());
if (checksum == tmp)
break; // Otherwise set to invalid connection (next line)
} UTILS_NO_BREAK;
connectionType = InvalidConnection;
break;
}
default:
connectionType = InvalidConnection;
}

View file

@ -44,7 +44,7 @@
struct InstancesInfo {
bool primary;
quint32 secondary;
quint64 primaryId;
qint64 primaryId;
};
class SingleApplicationPrivate : public QObject {

View file

@ -19,6 +19,7 @@
* Created on: February 2, 2017
* Author: Ronan Abhamon
*/
#include "CallModel.hpp"
#include <QDateTime>
#include <QQuickWindow>
@ -36,7 +37,7 @@
#include "utils/MediastreamerUtils.hpp"
#include "utils/Utils.hpp"
#include "CallModel.hpp"
// =============================================================================
@ -282,11 +283,14 @@ void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call,
mPausedByRemote = false;
break;
case linphone::Call::State::StreamsRunning:
case linphone::Call::State::StreamsRunning: {
if (!mWasConnected && CoreManager::getInstance()->getSettingsModel()->getAutomaticallyRecordCalls()) {
startRecording();
mWasConnected = true;
} UTILS_NO_BREAK;
}
mPausedByRemote = false;
break;
}
case linphone::Call::State::Connected:
case linphone::Call::State::Referred:
case linphone::Call::State::Released:
@ -703,8 +707,8 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
statsList << createStat(tr("callStatsDownloadBandwidth"), QStringLiteral("%1 kbits/s").arg(int(callStats->getDownloadBandwidth())));
statsList << createStat(tr("callStatsIceState"), iceStateToString(callStats->getIceState()));
statsList << createStat(tr("callStatsIpFamily"), family);
statsList << createStat(tr("callStatsSenderLossRate"), QStringLiteral("%1 %").arg(callStats->getSenderLossRate()));
statsList << createStat(tr("callStatsReceiverLossRate"), QStringLiteral("%1 %").arg(callStats->getReceiverLossRate()));
statsList << createStat(tr("callStatsSenderLossRate"), QStringLiteral("%1 %").arg(static_cast<double>(callStats->getSenderLossRate())));
statsList << createStat(tr("callStatsReceiverLossRate"), QStringLiteral("%1 %").arg(static_cast<double>(callStats->getReceiverLossRate())));
switch (callStats->getType()) {
case linphone::StreamType::Audio:
@ -730,8 +734,8 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
? receivedVideoDefinition
: QString("%1 (%2)").arg(receivedVideoDefinition).arg(receivedVideoDefinitionName));
statsList << createStat(tr("callStatsReceivedFramerate"), QStringLiteral("%1 FPS").arg(params->getReceivedFramerate()));
statsList << createStat(tr("callStatsSentFramerate"), QStringLiteral("%1 FPS").arg(params->getSentFramerate()));
statsList << createStat(tr("callStatsReceivedFramerate"), QStringLiteral("%1 FPS").arg(static_cast<double>(params->getReceivedFramerate())));
statsList << createStat(tr("callStatsSentFramerate"), QStringLiteral("%1 FPS").arg(static_cast<double>(params->getSentFramerate())));
} break;
default:

View file

@ -23,8 +23,9 @@
#ifndef CALL_MODEL_H_
#define CALL_MODEL_H_
#include <linphone++/linphone.hh>
#include <QObject>
#include <linphone++/linphone.hh>
// =============================================================================

View file

@ -20,10 +20,11 @@
* Author: Ronan Abhamon
*/
#include <Windows.h>
#include "DesktopToolsWindows.hpp"
#include <Windows.h>
// =============================================================================
DesktopTools::DesktopTools (QObject *parent) : QObject(parent) {}

View file

@ -120,7 +120,7 @@ public:
QExifByteValuePrivate (const QVector<quint8> &v)
: QExifValuePrivate(QExifValue::Byte, v.size()), value(v)
{}
~QExifByteValuePrivate(){}
QVector<quint8> value;
};
@ -491,13 +491,15 @@ QString QExifValue::toString () const {
QTextCodec *codec = QTextCodec::codecForName("UTF-16");
if (codec)
return codec->toUnicode(string);
} UTILS_NO_BREAK;
return QString::fromLocal8Bit(string.constData(), string.length());
}
case UndefinedEncoding:
return QString::fromLocal8Bit(string.constData(), string.length());
default:
break;
}
} UTILS_NO_BREAK;
return QString();
}
default:
return QString();
}
@ -1391,7 +1393,6 @@ QExifValue QExifImageHeader::readIfdValue (QDataStream &stream, int startPos, co
}
return QExifValue(value);
}
break;
case QExifValue::Rational: {
QVector<QExifURational> value(int(header.count));