Skip to content

Commit

Permalink
Experiments (#626)
Browse files Browse the repository at this point in the history
rock-platform detection
  • Loading branch information
raphaelscholle authored Dec 2, 2023
1 parent 428ff8f commit eec88db
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_package_Rock5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- "2.5-evo"
- "dev-release"
- "release"
- "experiments"
paths-ignore:
- '**.md'
- '**.asciidoc'
Expand Down
13 changes: 12 additions & 1 deletion app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,24 @@ int main(int argc, char *argv[]) {
QSettings settings;
qDebug()<<"Storing settings at ["<<settings.fileName()<<"]";
// RPI only - set a smaller default screen scale, for whatever reason thats needed
if(QOpenHD::instance().is_platform_rpi()){
if(QOpenHD::instance().is_platform_rpi() || QOpenHD::instance().is_platform_rock()){
if(!settings.value("qopenhd_custom_default_screen_has_been_set",false).toBool()){
qDebug()<<"Setting initial rpi screen scale";
settings.setValue("qopenhd_custom_default_screen_has_been_set",true);
settings.setValue("global_scale",0.7);
}
}
if(QOpenHD::instance().is_platform_rock()){
if(!settings.value("dev_rpi_use_external_omx_decode_service",true).toBool()){
qDebug()<<"Disabling RPI decode!";
settings.setValue("dev_rpi_use_external_omx_decode_service",false);
}
if(!settings.value("dev_always_use_generic_external_decode_service",false).toBool()){
qDebug()<<"Enable rockchip HW decoding!";
settings.setValue("dev_always_use_generic_external_decode_service",true);
}
}

const int screen_custom_font_dpi = settings.value("screen_custom_font_dpi").toInt();
if (screen_custom_font_dpi) {
QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
Expand Down
9 changes: 9 additions & 0 deletions app/util/qopenhd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <QTimer>

#include<iostream>
#include <sys/stat.h>
#include<fstream>
#include<string>

Expand Down Expand Up @@ -303,6 +304,14 @@ bool QOpenHD::is_platform_rpi()
#endif
}

bool QOpenHD::is_platform_rock()
{
#ifdef IS_PLATFORM_ROCK
return true;
#else
return false;
#endif
}

void QOpenHD::keep_screen_on(bool on)
{
Expand Down
1 change: 1 addition & 0 deletions app/util/qopenhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class QOpenHD : public QObject

Q_INVOKABLE bool is_valid_ip(QString ip);
Q_INVOKABLE bool is_platform_rpi();
Q_INVOKABLE bool is_platform_rock();
//
// Tries to mimic android toast as much as possible
//
Expand Down
7 changes: 7 additions & 0 deletions app/videostreaming/avcodec/avcodec_video.pri
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,12 @@ packagesExist(mmal) {
DEFINES += IS_PLATFORM_RPI
}

exists(/usr/local/share/openhd/platform/rock/) {
message(This is a Rock)
DEFINES += IS_PLATFORM_ROCK
} else {
message(This is not a Rock)
}

# can be used in c++, also set to be exposed in qml
DEFINES += QOPENHD_ENABLE_VIDEO_VIA_AVCODEC
2 changes: 2 additions & 0 deletions build_chroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
#This file is the install instruction for the CHROOT build
#We're using cloudsmith-cli to upload the file in CHROOT

echo "____________build like a rockSTAR___________"
sudo apt install -y python3-pip git
sudo pip3 install --upgrade cloudsmith-cli
bash install_build_dep.sh rock5
mkdir -p /usr/local/share/openhd/platform/rock/
sudo ./package.sh arm64 debian bullseye-rock5 || exit 1
mkdir -p /opt/out/
cp -v *.dep /opt/out/
Expand Down
1 change: 1 addition & 0 deletions install_build_dep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ PLATFORM_PACKAGES="qml-module-qt-labs-platform"
# Add OpenHD Repository platform-specific packages
apt install -y curl
curl -1sLf 'https://dl.cloudsmith.io/public/openhd/release/setup.deb.sh'| sudo -E bash
curl -1sLf 'https://dl.cloudsmith.io/public/openhd/dev-release/setup.deb.sh'| sudo -E bash
apt update

# Main function
Expand Down
2 changes: 1 addition & 1 deletion systemd/rock3_qopenhd.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ After=multi-user.target
[Service]
Type=simple
Environment="QT_QPA_EGLFS_KMS_ATOMIC=1"
Environment="QT_LOGGING_RULES=qt.qpa.egl*=true"
Environment="FONTCONFIG_PATH=/etc/fonts"
Environment="QT_QPA_EGLFS_KMS_PLANE_INDEX=1"
Environment="QT_QPA_EGLFS_FORCE888=1"
Environment="QT_QPA_EGLFS_SWAPINTERVAL=0"
Expand Down
2 changes: 1 addition & 1 deletion systemd/rock5_qopenhd.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ After=multi-user.target

[Service]
Type=simple
Environment="FONTCONFIG_PATH=/etc/fonts"
Environment="QT_QPA_EGLFS_KMS_ATOMIC=1"
Environment="QT_LOGGING_RULES=qt.qpa.egl*=true"
Environment="QT_QPA_EGLFS_KMS_PLANE_INDEX=5"
Environment="QT_QPA_EGLFS_FORCE888=1"
Environment="QT_QPA_EGLFS_SWAPINTERVAL=0"
Expand Down

0 comments on commit eec88db

Please sign in to comment.