Implement configuration for OMX Layer index
This commit is contained in:
parent
88aeb591b4
commit
5984108d20
@ -50,6 +50,8 @@ public:
|
|||||||
void setVideoResolution(aasdk::proto::enums::VideoResolution::Enum value) override;
|
void setVideoResolution(aasdk::proto::enums::VideoResolution::Enum value) override;
|
||||||
size_t getScreenDPI() const override;
|
size_t getScreenDPI() const override;
|
||||||
void setScreenDPI(size_t value) override;
|
void setScreenDPI(size_t value) override;
|
||||||
|
void setOMXLayerIndex(int32_t value) override;
|
||||||
|
int32_t getOMXLayerIndex() const override;
|
||||||
|
|
||||||
bool getTouchscreenEnabled() const override;
|
bool getTouchscreenEnabled() const override;
|
||||||
void setTouchscreenEnabled(bool value) override;
|
void setTouchscreenEnabled(bool value) override;
|
||||||
@ -71,6 +73,7 @@ private:
|
|||||||
aasdk::proto::enums::VideoFPS::Enum videoFPS_;
|
aasdk::proto::enums::VideoFPS::Enum videoFPS_;
|
||||||
aasdk::proto::enums::VideoResolution::Enum videoResolution_;
|
aasdk::proto::enums::VideoResolution::Enum videoResolution_;
|
||||||
size_t screenDPI_;
|
size_t screenDPI_;
|
||||||
|
int32_t omxLayerIndex_;
|
||||||
bool enableTouchscreen_;
|
bool enableTouchscreen_;
|
||||||
ButtonCodes buttonCodes_;
|
ButtonCodes buttonCodes_;
|
||||||
BluetoothAdapterType bluetoothAdapterType_;
|
BluetoothAdapterType bluetoothAdapterType_;
|
||||||
@ -84,6 +87,7 @@ private:
|
|||||||
static const std::string cVideoFPSKey;
|
static const std::string cVideoFPSKey;
|
||||||
static const std::string cVideoResolutionKey;
|
static const std::string cVideoResolutionKey;
|
||||||
static const std::string cVideoScreenDPIKey;
|
static const std::string cVideoScreenDPIKey;
|
||||||
|
static const std::string cVideoOMXLayerIndexKey;
|
||||||
|
|
||||||
static const std::string cBluetoothAdapterTypeKey;
|
static const std::string cBluetoothAdapterTypeKey;
|
||||||
static const std::string cBluetoothRemoteAdapterAddressKey;
|
static const std::string cBluetoothRemoteAdapterAddressKey;
|
||||||
|
@ -57,6 +57,8 @@ public:
|
|||||||
virtual void setVideoResolution(aasdk::proto::enums::VideoResolution::Enum value) = 0;
|
virtual void setVideoResolution(aasdk::proto::enums::VideoResolution::Enum value) = 0;
|
||||||
virtual size_t getScreenDPI() const = 0;
|
virtual size_t getScreenDPI() const = 0;
|
||||||
virtual void setScreenDPI(size_t value) = 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 bool getTouchscreenEnabled() const = 0;
|
||||||
virtual void setTouchscreenEnabled(bool value) = 0;
|
virtual void setTouchscreenEnabled(bool value) = 0;
|
||||||
|
@ -54,7 +54,7 @@ private:
|
|||||||
bool initClock();
|
bool initClock();
|
||||||
bool setupTunnels();
|
bool setupTunnels();
|
||||||
bool enablePortBuffers();
|
bool enablePortBuffers();
|
||||||
bool setFullscreen();
|
bool setupDisplayRegion();
|
||||||
|
|
||||||
std::mutex mutex_;
|
std::mutex mutex_;
|
||||||
bool isActive_;
|
bool isActive_;
|
||||||
|
@ -36,6 +36,7 @@ const std::string Configuration::cGeneralHandednessOfTrafficTypeKey = "General.H
|
|||||||
const std::string Configuration::cVideoFPSKey = "Video.FPS";
|
const std::string Configuration::cVideoFPSKey = "Video.FPS";
|
||||||
const std::string Configuration::cVideoResolutionKey = "Video.Resolution";
|
const std::string Configuration::cVideoResolutionKey = "Video.Resolution";
|
||||||
const std::string Configuration::cVideoScreenDPIKey = "Video.ScreenDPI";
|
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::cBluetoothAdapterTypeKey = "Bluetooth.AdapterType";
|
||||||
const std::string Configuration::cBluetoothRemoteAdapterAddressKey = "Bluetooth.RemoteAdapterAddress";
|
const std::string Configuration::cBluetoothRemoteAdapterAddressKey = "Bluetooth.RemoteAdapterAddress";
|
||||||
@ -82,6 +83,8 @@ void Configuration::load()
|
|||||||
aasdk::proto::enums::VideoResolution::_480p));
|
aasdk::proto::enums::VideoResolution::_480p));
|
||||||
screenDPI_ = iniConfig.get<size_t>(cVideoScreenDPIKey, 140);
|
screenDPI_ = iniConfig.get<size_t>(cVideoScreenDPIKey, 140);
|
||||||
|
|
||||||
|
omxLayerIndex_ = iniConfig.get<int32_t>(cVideoOMXLayerIndexKey, 1);
|
||||||
|
|
||||||
enableTouchscreen_ = iniConfig.get<bool>(cInputEnableTouchscreenKey, true);
|
enableTouchscreen_ = iniConfig.get<bool>(cInputEnableTouchscreenKey, true);
|
||||||
this->readButtonCodes(iniConfig);
|
this->readButtonCodes(iniConfig);
|
||||||
|
|
||||||
@ -105,6 +108,7 @@ void Configuration::reset()
|
|||||||
videoFPS_ = aasdk::proto::enums::VideoFPS::_60;
|
videoFPS_ = aasdk::proto::enums::VideoFPS::_60;
|
||||||
videoResolution_ = aasdk::proto::enums::VideoResolution::_480p;
|
videoResolution_ = aasdk::proto::enums::VideoResolution::_480p;
|
||||||
screenDPI_ = 140;
|
screenDPI_ = 140;
|
||||||
|
omxLayerIndex_ = 1;
|
||||||
enableTouchscreen_ = true;
|
enableTouchscreen_ = true;
|
||||||
buttonCodes_.clear();
|
buttonCodes_.clear();
|
||||||
bluetoothAdapterType_ = BluetoothAdapterType::NONE;
|
bluetoothAdapterType_ = BluetoothAdapterType::NONE;
|
||||||
@ -120,6 +124,7 @@ void Configuration::save()
|
|||||||
iniConfig.put<uint32_t>(cVideoFPSKey, static_cast<uint32_t>(videoFPS_));
|
iniConfig.put<uint32_t>(cVideoFPSKey, static_cast<uint32_t>(videoFPS_));
|
||||||
iniConfig.put<uint32_t>(cVideoResolutionKey, static_cast<uint32_t>(videoResolution_));
|
iniConfig.put<uint32_t>(cVideoResolutionKey, static_cast<uint32_t>(videoResolution_));
|
||||||
iniConfig.put<size_t>(cVideoScreenDPIKey, screenDPI_);
|
iniConfig.put<size_t>(cVideoScreenDPIKey, screenDPI_);
|
||||||
|
iniConfig.put<int32_t>(cVideoOMXLayerIndexKey, omxLayerIndex_);
|
||||||
|
|
||||||
iniConfig.put<bool>(cInputEnableTouchscreenKey, enableTouchscreen_);
|
iniConfig.put<bool>(cInputEnableTouchscreenKey, enableTouchscreen_);
|
||||||
this->writeButtonCodes(iniConfig);
|
this->writeButtonCodes(iniConfig);
|
||||||
@ -179,6 +184,16 @@ void Configuration::setScreenDPI(size_t value)
|
|||||||
screenDPI_ = value;
|
screenDPI_ = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Configuration::setOMXLayerIndex(int32_t value)
|
||||||
|
{
|
||||||
|
omxLayerIndex_ = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Configuration::getOMXLayerIndex() const
|
||||||
|
{
|
||||||
|
return omxLayerIndex_;
|
||||||
|
}
|
||||||
|
|
||||||
bool Configuration::getTouchscreenEnabled() const
|
bool Configuration::getTouchscreenEnabled() const
|
||||||
{
|
{
|
||||||
return enableTouchscreen_;
|
return enableTouchscreen_;
|
||||||
|
@ -105,24 +105,20 @@ bool OMXVideoOutput::init()
|
|||||||
OPENAUTO_LOG(info) << "[OMXVideoOutput] init, state: " << isActive_;
|
OPENAUTO_LOG(info) << "[OMXVideoOutput] init, state: " << isActive_;
|
||||||
ilclient_change_component_state(components_[VideoComponent::DECODER], OMX_StateExecuting);
|
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;
|
OMX_CONFIG_DISPLAYREGIONTYPE displayRegion;
|
||||||
displayRegion.nSize = sizeof(OMX_CONFIG_DISPLAYREGIONTYPE);
|
displayRegion.nSize = sizeof(OMX_CONFIG_DISPLAYREGIONTYPE);
|
||||||
displayRegion.nVersion.nVersion = OMX_VERSION;
|
displayRegion.nVersion.nVersion = OMX_VERSION;
|
||||||
displayRegion.nPortIndex = 90;
|
displayRegion.nPortIndex = 90;
|
||||||
|
displayRegion.layer = static_cast<OMX_S32>(configuration_->getOMXLayerIndex());
|
||||||
//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_DISPLAYSETTYPE >(OMX_DISPLAY_SET_FULLSCREEN | OMX_DISPLAY_SET_NOASPECT | OMX_DISPLAY_SET_LAYER);
|
|
||||||
displayRegion.fullscreen = OMX_TRUE;
|
displayRegion.fullscreen = OMX_TRUE;
|
||||||
displayRegion.noaspect = OMX_TRUE;
|
displayRegion.noaspect = OMX_TRUE;
|
||||||
|
displayRegion.set = static_cast<OMX_DISPLAYSETTYPE >(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;
|
return OMX_SetConfig(ilclient_get_handle(components_[VideoComponent::RENDERER]), OMX_IndexConfigDisplayRegion, &displayRegion) == OMX_ErrorNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ void SettingsWindow::onSave()
|
|||||||
}
|
}
|
||||||
|
|
||||||
configuration_->setScreenDPI(static_cast<size_t>(ui_->horizontalSliderScreenDPI->value()));
|
configuration_->setScreenDPI(static_cast<size_t>(ui_->horizontalSliderScreenDPI->value()));
|
||||||
|
configuration_->setOMXLayerIndex(ui_->spinBoxOmxLayerIndex->value());
|
||||||
configuration_->setTouchscreenEnabled(ui_->checkBoxEnableTouchscreen->isChecked());
|
configuration_->setTouchscreenEnabled(ui_->checkBoxEnableTouchscreen->isChecked());
|
||||||
this->saveButtonCheckBoxes();
|
this->saveButtonCheckBoxes();
|
||||||
|
|
||||||
@ -124,6 +125,7 @@ void SettingsWindow::load()
|
|||||||
ui_->radioButton720p->setChecked(configuration_->getVideoResolution() == aasdk::proto::enums::VideoResolution::_720p);
|
ui_->radioButton720p->setChecked(configuration_->getVideoResolution() == aasdk::proto::enums::VideoResolution::_720p);
|
||||||
ui_->radioButton1080p->setChecked(configuration_->getVideoResolution() == aasdk::proto::enums::VideoResolution::_1080p);
|
ui_->radioButton1080p->setChecked(configuration_->getVideoResolution() == aasdk::proto::enums::VideoResolution::_1080p);
|
||||||
ui_->horizontalSliderScreenDPI->setValue(static_cast<int>(configuration_->getScreenDPI()));
|
ui_->horizontalSliderScreenDPI->setValue(static_cast<int>(configuration_->getScreenDPI()));
|
||||||
|
ui_->spinBoxOmxLayerIndex->setValue(configuration_->getOMXLayerIndex());
|
||||||
|
|
||||||
ui_->checkBoxEnableTouchscreen->setChecked(configuration_->getTouchscreenEnabled());
|
ui_->checkBoxEnableTouchscreen->setChecked(configuration_->getTouchscreenEnabled());
|
||||||
this->loadButtonCheckBoxes();
|
this->loadButtonCheckBoxes();
|
||||||
|
@ -141,9 +141,9 @@ color: rgb(238, 238, 236);</string>
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>130</y>
|
<y>80</y>
|
||||||
<width>621</width>
|
<width>621</width>
|
||||||
<height>211</height>
|
<height>141</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@ -154,7 +154,7 @@ color: rgb(238, 238, 236);</string>
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>30</y>
|
<y>30</y>
|
||||||
<width>112</width>
|
<width>71</width>
|
||||||
<height>23</height>
|
<height>23</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -165,9 +165,9 @@ color: rgb(238, 238, 236);</string>
|
|||||||
<widget class="QRadioButton" name="radioButton720p">
|
<widget class="QRadioButton" name="radioButton720p">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>120</x>
|
||||||
<y>70</y>
|
<y>30</y>
|
||||||
<width>112</width>
|
<width>71</width>
|
||||||
<height>23</height>
|
<height>23</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -178,9 +178,9 @@ color: rgb(238, 238, 236);</string>
|
|||||||
<widget class="QRadioButton" name="radioButton1080p">
|
<widget class="QRadioButton" name="radioButton1080p">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>230</x>
|
||||||
<y>110</y>
|
<y>30</y>
|
||||||
<width>112</width>
|
<width>81</width>
|
||||||
<height>23</height>
|
<height>23</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -192,9 +192,9 @@ color: rgb(238, 238, 236);</string>
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>50</x>
|
<x>50</x>
|
||||||
<y>150</y>
|
<y>60</y>
|
||||||
<width>551</width>
|
<width>561</width>
|
||||||
<height>51</height>
|
<height>71</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -203,14 +203,17 @@ color: rgb(238, 238, 236);</string>
|
|||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QLabel" name="labelResolutionWarningIcon">
|
<widget class="QLabel" name="labelResolutionWarningIcon">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>20</x>
|
||||||
<y>150</y>
|
<y>60</y>
|
||||||
<width>41</width>
|
<width>31</width>
|
||||||
<height>51</height>
|
<height>71</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -224,7 +227,7 @@ color: rgb(238, 238, 236);</string>
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>10</y>
|
<y>10</y>
|
||||||
<width>621</width>
|
<width>621</width>
|
||||||
<height>101</height>
|
<height>61</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@ -233,9 +236,9 @@ color: rgb(238, 238, 236);</string>
|
|||||||
<widget class="QRadioButton" name="radioButton60FPS">
|
<widget class="QRadioButton" name="radioButton60FPS">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>120</x>
|
||||||
<y>70</y>
|
<y>30</y>
|
||||||
<width>112</width>
|
<width>81</width>
|
||||||
<height>23</height>
|
<height>23</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -248,7 +251,7 @@ color: rgb(238, 238, 236);</string>
|
|||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>30</y>
|
<y>30</y>
|
||||||
<width>112</width>
|
<width>81</width>
|
||||||
<height>23</height>
|
<height>23</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -267,7 +270,7 @@ color: rgb(238, 238, 236);</string>
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>999</number>
|
<number>400</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
@ -296,9 +299,71 @@ color: rgb(238, 238, 236);</string>
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>999</string>
|
<string>400</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>230</y>
|
||||||
|
<width>621</width>
|
||||||
|
<height>121</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>OMX Layer index</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QLabel" name="labelOmxLayerIndex">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>40</y>
|
||||||
|
<width>91</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Layer index:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="labelBluetoothAddressFormatInfo_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>60</x>
|
||||||
|
<y>80</y>
|
||||||
|
<width>311</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><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></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="labelBluetoothAddressFormatInfoIcon_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>30</x>
|
||||||
|
<y>80</y>
|
||||||
|
<width>21</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><img src=":/ico_info.png"/></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QSpinBox" name="spinBoxOmxLayerIndex">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>100</x>
|
||||||
|
<y>30</y>
|
||||||
|
<width>71</width>
|
||||||
|
<height>41</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tabInput">
|
<widget class="QWidget" name="tabInput">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user