Using mipmap can crash on Mac : add an option to deactivate it with 'mipmap_enabled' in [ui] section.

This commit is contained in:
Julien Wadel 2021-11-02 15:18:19 +01:00
parent ca849bcac8
commit 9cb23adcfe
24 changed files with 274 additions and 5 deletions

View file

@ -128,6 +128,8 @@ Usually, if it is about VPX or Decaf, this could come from your Perl installatio
* If the application doesn't start and create an empty file with a random name, it could be come from a bad configuration between your application and others sub-modules. Check your configurations and force them with `-DCMAKE_BUILD_TYPE=<your_config>` or `--config <your_config>`.
* On Mac, the application can crash at the start from QOpenGLContext. A workaround is to deactivate the mipmap mode on images by adding into your configuration file (linphonerc): `mipmap_enabled=0` in `[ui]` section.
## Specific instructions for the Mac Os X platform

View file

@ -2526,6 +2526,21 @@ Klik her: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2526,6 +2526,21 @@ Klicken Sie hier: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2548,6 +2548,21 @@ Click here: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<source>checkForUpdateLabel</source>
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation>Check for updates</translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation>Enable Mipmap</translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation>This property holds whether the image uses mipmap filtering when scaled or transformed.</translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation>Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).</translation>
</message>
</context>
<context>

View file

@ -2524,6 +2524,21 @@ Haga clic aquí: &lt;a href=&quot;%1&quot;&gt;%1 &lt;/a&gt;
<message>
<source>checkForUpdateLabel</source>
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>

View file

@ -2526,6 +2526,21 @@ Cliquez ici : &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2516,6 +2516,21 @@ Kattintson ide: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2526,6 +2526,21 @@ Clicca: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2516,6 +2516,21 @@
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2536,6 +2536,21 @@ Spustelėkite čia: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2526,6 +2526,21 @@ Clique aqui: &lt;a href=&quot;%1&quot;&gt;%1 &lt;/a&gt;
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2536,6 +2536,21 @@
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2526,6 +2526,21 @@ Klicka här: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2516,6 +2516,21 @@ Buraya tıklayın: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2536,6 +2536,21 @@
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2516,6 +2516,21 @@
<extracomment>&apos;Check for updates&apos; : Label switch for enabling check for updates</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapLabel</source>
<extracomment>&apos;Enable Mipmap&apos;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip1</source>
<extracomment>&apos;This property holds whether the image uses mipmap filtering when scaled or transformed.&apos; : first line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>mipmapTooltip2</source>
<extracomment>&apos;Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).&apos; : Second line of a tooltip about Mipmap mode.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -1283,6 +1283,19 @@ bool SettingsModel::getShowStartVideoCallButton ()const{
return !!mConfig->getInt(UiSection, "show_start_video_button", 1);
}
bool SettingsModel::isMipmapEnabled() const{
#ifdef __APPLE__
return !!mConfig->getInt(UiSection, "mipmap_enabled", 1);
#else
return !!mConfig->getInt(UiSection, "mipmap_enabled", 0);
#endif
}
void SettingsModel::setMipmapEnabled(const bool& enabled){
mConfig->setInt(UiSection, "mipmap_enabled", enabled);
emit mipmapEnabledChanged();
}
// =============================================================================
// Advanced.
// =============================================================================

View file

@ -184,6 +184,8 @@ class SettingsModel : public QObject {
Q_PROPERTY(bool showStartChatButton READ getShowStartChatButton CONSTANT)
Q_PROPERTY(bool showStartVideoCallButton READ getShowStartVideoCallButton CONSTANT)
Q_PROPERTY(bool mipmapEnabled READ isMipmapEnabled WRITE setMipmapEnabled NOTIFY mipmapEnabledChanged)
// Advanced. -----------------------------------------------------------------
Q_PROPERTY(QString logsFolder READ getLogsFolder WRITE setLogsFolder NOTIFY logsFolderChanged)
@ -465,6 +467,9 @@ public:
Q_INVOKABLE bool getShowStartChatButton () const;
Q_INVOKABLE bool getShowStartVideoCallButton () const;
bool isMipmapEnabled() const;
void setMipmapEnabled(const bool& enabled);
// Advanced. ---------------------------------------------------------------------------
@ -632,6 +637,7 @@ signals:
void remoteProvisioningNotChanged (const QString &remoteProvisioning);
void exitOnCloseChanged (bool value);
void mipmapEnabledChanged();
void checkForUpdateEnabledChanged();

View file

@ -2,6 +2,7 @@ import QtQuick 2.7
import QtGraphicalEffects 1.12
import Common 1.0
import Linphone 1.0
import Utils 1.0
// =============================================================================
@ -24,7 +25,7 @@ Item {
Image {
id:image
property bool colorOverwriteEnabled : false
mipmap: Qt.platform.os === 'osx'
mipmap: SettingsModel.mipmapEnabled
cache: Images.areReadOnlyImages
function getIconSize () {
Utils.assert(

View file

@ -1,5 +1,7 @@
import QtQuick 2.7
import Linphone 1.0
// =============================================================================
Item {
@ -19,7 +21,7 @@ Item {
Image {
id: image
mipmap: Qt.platform.os === 'osx'
mipmap: SettingsModel.mipmapEnabled
anchors.fill: parent
fillMode: Image.PreserveAspectCrop
sourceSize.width: parent.width

View file

@ -3,6 +3,7 @@ import QtQuick.Controls 2.2 as Core
import QtGraphicalEffects 1.12
import Common 1.0
import Linphone 1.0
import Common.Styles 1.0
import Utils 1.0
@ -100,7 +101,7 @@ Core.ToolTip {
// and `implicitWidth`.
Core.Image {
id: icon
mipmap: Qt.platform.os === 'osx'
mipmap: SettingsModel.mipmapEnabled
fillMode: Core.Image.PreserveAspectFit
height: TooltipStyle.arrowSize
source: _edge

View file

@ -109,7 +109,7 @@ Row {
id: thumbnailImage
Image {
mipmap: Qt.platform.os === 'osx'
mipmap: SettingsModel.mipmapEnabled
source: rectangle.contentModel.thumbnail
}
}

View file

@ -2,6 +2,7 @@ import QtQuick 2.7
import QtQuick.Layouts 1.3
import Common 1.0
import Linphone 1.0
import Linphone.Styles 1.0
import Utils 1.0
@ -44,7 +45,7 @@ Notification {
}
Image{
id:image
mipmap: Qt.platform.os === 'osx'
mipmap: SettingsModel.mipmapEnabled
Layout.fillHeight: true
Layout.fillWidth: true
fillMode: Image.PreserveAspectFit

View file

@ -215,6 +215,24 @@ TabContainer {
}
}
}
FormLine {
FormGroup {
//: 'Enable Mipmap'
label: qsTr('mipmapLabel')
Switch {
checked: SettingsModel.mipmapEnabled
onClicked: SettingsModel.mipmapEnabled = !checked
TooltipArea{
//: 'This property holds whether the image uses mipmap filtering when scaled or transformed.' : first line of a tooltip about Mipmap mode.
text: qsTr('mipmapTooltip1')+'\n'
//: 'Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering).' : Second line of a tooltip about Mipmap mode.
+qsTr('mipmapTooltip2')
}
}
}
}
}
}
}