diff --git a/include/f1x/openauto/autoapp/Configuration/Configuration.hpp b/include/f1x/openauto/autoapp/Configuration/Configuration.hpp index eb489c7..59c60b0 100644 --- a/include/f1x/openauto/autoapp/Configuration/Configuration.hpp +++ b/include/f1x/openauto/autoapp/Configuration/Configuration.hpp @@ -50,6 +50,8 @@ public: void setVideoResolution(aasdk::proto::enums::VideoResolution::Enum value) override; size_t getScreenDPI() const override; void setScreenDPI(size_t value) override; + void setOMXLayerIndex(int32_t value) override; + int32_t getOMXLayerIndex() const override; bool getTouchscreenEnabled() const override; void setTouchscreenEnabled(bool value) override; @@ -71,6 +73,7 @@ private: aasdk::proto::enums::VideoFPS::Enum videoFPS_; aasdk::proto::enums::VideoResolution::Enum videoResolution_; size_t screenDPI_; + int32_t omxLayerIndex_; bool enableTouchscreen_; ButtonCodes buttonCodes_; BluetoothAdapterType bluetoothAdapterType_; @@ -84,6 +87,7 @@ private: static const std::string cVideoFPSKey; static const std::string cVideoResolutionKey; static const std::string cVideoScreenDPIKey; + static const std::string cVideoOMXLayerIndexKey; static const std::string cBluetoothAdapterTypeKey; static const std::string cBluetoothRemoteAdapterAddressKey; diff --git a/include/f1x/openauto/autoapp/Configuration/IConfiguration.hpp b/include/f1x/openauto/autoapp/Configuration/IConfiguration.hpp index 666ae56..e3bd23f 100644 --- a/include/f1x/openauto/autoapp/Configuration/IConfiguration.hpp +++ b/include/f1x/openauto/autoapp/Configuration/IConfiguration.hpp @@ -57,6 +57,8 @@ public: virtual void setVideoResolution(aasdk::proto::enums::VideoResolution::Enum value) = 0; virtual size_t getScreenDPI() const = 0; virtual void setScreenDPI(size_t value) = 0; + virtual void setOMXLayerIndex(int32_t value) = 0; + virtual int32_t getOMXLayerIndex() const = 0; virtual bool getTouchscreenEnabled() const = 0; virtual void setTouchscreenEnabled(bool value) = 0; diff --git a/include/f1x/openauto/autoapp/Projection/OMXVideoOutput.hpp b/include/f1x/openauto/autoapp/Projection/OMXVideoOutput.hpp index a6b7d6c..4c88900 100644 --- a/include/f1x/openauto/autoapp/Projection/OMXVideoOutput.hpp +++ b/include/f1x/openauto/autoapp/Projection/OMXVideoOutput.hpp @@ -54,7 +54,7 @@ private: bool initClock(); bool setupTunnels(); bool enablePortBuffers(); - bool setFullscreen(); + bool setupDisplayRegion(); std::mutex mutex_; bool isActive_; diff --git a/src/autoapp/Configuration/Configuration.cpp b/src/autoapp/Configuration/Configuration.cpp index 71210fd..1d14954 100644 --- a/src/autoapp/Configuration/Configuration.cpp +++ b/src/autoapp/Configuration/Configuration.cpp @@ -36,6 +36,7 @@ const std::string Configuration::cGeneralHandednessOfTrafficTypeKey = "General.H const std::string Configuration::cVideoFPSKey = "Video.FPS"; const std::string Configuration::cVideoResolutionKey = "Video.Resolution"; const std::string Configuration::cVideoScreenDPIKey = "Video.ScreenDPI"; +const std::string Configuration::cVideoOMXLayerIndexKey = "Video.OMXLayerIndex"; const std::string Configuration::cBluetoothAdapterTypeKey = "Bluetooth.AdapterType"; const std::string Configuration::cBluetoothRemoteAdapterAddressKey = "Bluetooth.RemoteAdapterAddress"; @@ -82,6 +83,8 @@ void Configuration::load() aasdk::proto::enums::VideoResolution::_480p)); screenDPI_ = iniConfig.get(cVideoScreenDPIKey, 140); + omxLayerIndex_ = iniConfig.get(cVideoOMXLayerIndexKey, 1); + enableTouchscreen_ = iniConfig.get(cInputEnableTouchscreenKey, true); this->readButtonCodes(iniConfig); @@ -105,6 +108,7 @@ void Configuration::reset() videoFPS_ = aasdk::proto::enums::VideoFPS::_60; videoResolution_ = aasdk::proto::enums::VideoResolution::_480p; screenDPI_ = 140; + omxLayerIndex_ = 1; enableTouchscreen_ = true; buttonCodes_.clear(); bluetoothAdapterType_ = BluetoothAdapterType::NONE; @@ -120,6 +124,7 @@ void Configuration::save() iniConfig.put(cVideoFPSKey, static_cast(videoFPS_)); iniConfig.put(cVideoResolutionKey, static_cast(videoResolution_)); iniConfig.put(cVideoScreenDPIKey, screenDPI_); + iniConfig.put(cVideoOMXLayerIndexKey, omxLayerIndex_); iniConfig.put(cInputEnableTouchscreenKey, enableTouchscreen_); this->writeButtonCodes(iniConfig); @@ -179,6 +184,16 @@ void Configuration::setScreenDPI(size_t value) screenDPI_ = value; } +void Configuration::setOMXLayerIndex(int32_t value) +{ + omxLayerIndex_ = value; +} + +int32_t Configuration::getOMXLayerIndex() const +{ + return omxLayerIndex_; +} + bool Configuration::getTouchscreenEnabled() const { return enableTouchscreen_; diff --git a/src/autoapp/Projection/OMXVideoOutput.cpp b/src/autoapp/Projection/OMXVideoOutput.cpp index 8f2e6d4..12f5960 100644 --- a/src/autoapp/Projection/OMXVideoOutput.cpp +++ b/src/autoapp/Projection/OMXVideoOutput.cpp @@ -105,24 +105,20 @@ bool OMXVideoOutput::init() OPENAUTO_LOG(info) << "[OMXVideoOutput] init, state: " << isActive_; ilclient_change_component_state(components_[VideoComponent::DECODER], OMX_StateExecuting); - return this->setFullscreen(); + return this->setupDisplayRegion(); } -bool OMXVideoOutput::setFullscreen() +bool OMXVideoOutput::setupDisplayRegion() { OMX_CONFIG_DISPLAYREGIONTYPE displayRegion; displayRegion.nSize = sizeof(OMX_CONFIG_DISPLAYREGIONTYPE); displayRegion.nVersion.nVersion = OMX_VERSION; displayRegion.nPortIndex = 90; - - //EGL surface needs the OMX layer to be 2 - //Otherwise the Qt UI will draw on top of it - displayRegion.layer = 2; - - displayRegion.set = static_cast(OMX_DISPLAY_SET_FULLSCREEN | OMX_DISPLAY_SET_NOASPECT | OMX_DISPLAY_SET_LAYER); + displayRegion.layer = static_cast(configuration_->getOMXLayerIndex()); displayRegion.fullscreen = OMX_TRUE; displayRegion.noaspect = OMX_TRUE; - + displayRegion.set = static_cast(OMX_DISPLAY_SET_FULLSCREEN | OMX_DISPLAY_SET_NOASPECT | OMX_DISPLAY_SET_LAYER); + return OMX_SetConfig(ilclient_get_handle(components_[VideoComponent::RENDERER]), OMX_IndexConfigDisplayRegion, &displayRegion) == OMX_ErrorNone; } diff --git a/src/autoapp/UI/SettingsWindow.cpp b/src/autoapp/UI/SettingsWindow.cpp index 06777b1..a8fe541 100644 --- a/src/autoapp/UI/SettingsWindow.cpp +++ b/src/autoapp/UI/SettingsWindow.cpp @@ -72,6 +72,7 @@ void SettingsWindow::onSave() } configuration_->setScreenDPI(static_cast(ui_->horizontalSliderScreenDPI->value())); + configuration_->setOMXLayerIndex(ui_->spinBoxOmxLayerIndex->value()); configuration_->setTouchscreenEnabled(ui_->checkBoxEnableTouchscreen->isChecked()); this->saveButtonCheckBoxes(); @@ -124,6 +125,7 @@ void SettingsWindow::load() ui_->radioButton720p->setChecked(configuration_->getVideoResolution() == aasdk::proto::enums::VideoResolution::_720p); ui_->radioButton1080p->setChecked(configuration_->getVideoResolution() == aasdk::proto::enums::VideoResolution::_1080p); ui_->horizontalSliderScreenDPI->setValue(static_cast(configuration_->getScreenDPI())); + ui_->spinBoxOmxLayerIndex->setValue(configuration_->getOMXLayerIndex()); ui_->checkBoxEnableTouchscreen->setChecked(configuration_->getTouchscreenEnabled()); this->loadButtonCheckBoxes(); diff --git a/src/autoapp/UI/settingswindow.ui b/src/autoapp/UI/settingswindow.ui index 909a925..c678f3d 100644 --- a/src/autoapp/UI/settingswindow.ui +++ b/src/autoapp/UI/settingswindow.ui @@ -141,9 +141,9 @@ color: rgb(238, 238, 236); 0 - 130 + 80 621 - 211 + 141 @@ -154,7 +154,7 @@ color: rgb(238, 238, 236); 10 30 - 112 + 71 23 @@ -165,9 +165,9 @@ color: rgb(238, 238, 236); - 10 - 70 - 112 + 120 + 30 + 71 23 @@ -178,9 +178,9 @@ color: rgb(238, 238, 236); - 10 - 110 - 112 + 230 + 30 + 81 23 @@ -192,9 +192,9 @@ color: rgb(238, 238, 236); 50 - 150 - 551 - 51 + 60 + 561 + 71 @@ -203,14 +203,17 @@ color: rgb(238, 238, 236); true + + 10 + - 10 - 150 - 41 - 51 + 20 + 60 + 31 + 71 @@ -224,7 +227,7 @@ color: rgb(238, 238, 236); 0 10 621 - 101 + 61 @@ -233,9 +236,9 @@ color: rgb(238, 238, 236); - 10 - 70 - 112 + 120 + 30 + 81 23 @@ -248,7 +251,7 @@ color: rgb(238, 238, 236); 10 30 - 112 + 81 23 @@ -267,7 +270,7 @@ color: rgb(238, 238, 236); - 999 + 400 Qt::Horizontal @@ -296,9 +299,71 @@ color: rgb(238, 238, 236); - 999 + 400 + + + + 0 + 230 + 621 + 121 + + + + OMX Layer index + + + + + 10 + 40 + 91 + 21 + + + + Layer index: + + + + + + 60 + 80 + 311 + 31 + + + + <html><head/><body><p><span style=" font-size:10pt; font-style:italic;">OMX Layer is used only in case of OMX video output.</span></p></body></html> + + + + + + 30 + 80 + 21 + 31 + + + + <html><head/><body><p><img src=":/ico_info.png"/></p></body></html> + + + + + + 100 + 30 + 71 + 41 + + + +