Skip to content

Commit

Permalink
update (#689)
Browse files Browse the repository at this point in the history
* add infiray T2

* add audio test mode param

* audio playback on by default

* remove releative include path and change include path order (#678)

* improve/export decoding pipelines (#680)

* Revert "remove releative include path and change include path order (#678)"

This reverts commit e5ece70.

* fix h264 service

* mkae services more sensable

* move drop down select list(s) for camera type to camera.hpp
fetch camera type from cpp (in qml)
renames geekworm to hdmi to csi

* move drop down select list(s) for camera type to camera.hpp
fetch camera type from cpp (in qml)
renames geekworm to hdmi to csi

* fix documentation

* experiment - debug drm / kms

* disable audio on android

* drm / kms debug off for non-dev branch

* i need to merge this (with failing CIs) to test rock

* uncomment the debug_kms stuff, not needed anymore

* custom hw make 1 selectable

* custom hw make 1 selectable

* update platform, camera

* improve UI if card sub type is known

* don't show 2.4G on X20

* change version code to beta

---------

Co-authored-by: Consti10 <[email protected]>
Co-authored-by: tbago <[email protected]>
  • Loading branch information
3 people authored Apr 22, 2024
1 parent 0d58394 commit b79fb3a
Show file tree
Hide file tree
Showing 32 changed files with 458 additions and 453 deletions.
2 changes: 2 additions & 0 deletions QOpenHD.pro
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ QT +=core quick qml gui \
widgets
QT += opengl
QT += charts
#QT += gui-private
#LIBS += Ldrm

INCLUDEPATH += $$PWD/lib
INCLUDEPATH += $$PWD/app
Expand Down
37 changes: 37 additions & 0 deletions app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ RESOLVEFUNC(SSL_get1_peer_certificate);
RESOLVEFUNC(EVP_PKEY_get_base_id);
#endif // OPENSSL_VERSION_MAJOR >= 3

//#include <qpa/qplatformnativeinterface.h>
//#include <xf86drm.h>
//#include <xf86drmMode.h>

// Load all the fonts we use ?!
static void load_fonts(){
Expand Down Expand Up @@ -197,6 +200,39 @@ static void android_check_permissions(){
#endif
}

/*static void debug_kms(){
qDebug()<<"platform name:"<<QGuiApplication::platformName();
if(QGuiApplication::platformName().contains("eglfs", Qt::CaseInsensitive)){
int fd = 0;
uint32_t crtc = 0;
uint32_t connector = 0;
bool useatomic = false;
auto * pni = QGuiApplication::platformNativeInterface();
QScreen *qScreen=QGuiApplication::primaryScreen();
auto * drifd = pni->nativeResourceForIntegration("dri_fd");
if (drifd)
fd = static_cast<int>(reinterpret_cast<qintptr>(drifd));
auto * crtcid = pni->nativeResourceForScreen("dri_crtcid", qScreen);
if (crtcid)
crtc = static_cast<uint32_t>(reinterpret_cast<qintptr>(crtcid));
auto * connid = pni->nativeResourceForScreen("dri_connectorid", qScreen);
if (connid)
connector = static_cast<uint32_t>(reinterpret_cast<qintptr>(connid));
auto * atomic = pni->nativeResourceForIntegration("dri_atomic_request");
if (atomic){
//auto * request = reinterpret_cast<drmModeAtomicReq*>(atomic);
auto * request = atomic;
if (request != nullptr)
useatomic = true;
}
qDebug()<<QString("%1 Qt EGLFS/KMS Fd:%2 Crtc id:%3 Connector id:%4 Atomic: %5")
.arg("xx").arg(fd).arg(crtc).arg(connector).arg(useatomic);
}else{
qDebug()<<"No eglfs";
}
}*/


int main(int argc, char *argv[]) {

QCoreApplication::setOrganizationName("OpenHD");
Expand Down Expand Up @@ -438,6 +474,7 @@ int main(int argc, char *argv[]) {
MavlinkTelemetry::instance().start();

QRenderStats::instance().register_to_root_window(engine);
//debug_kms();
LogMessagesModel::instanceGround().addLogMessage("QOpenHD","running");
const int retval = app.exec();
// Terminating needs a bit of special care due to the singleton usage and threads
Expand Down
2 changes: 1 addition & 1 deletion app/telemetry/models/aohdsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void AOHDSystem::process_onboard_computer_status(const mavlink_onboard_computer_
set_air_reported_fc_sys_id(air_reported_sys_id);
const uint8_t ohd_platform=msg.link_type[0];
set_ohd_platform(ohd_platform);
const auto platform_as_str=openhd::x_platform_type_to_string(ohd_platform);
const auto platform_as_str=x_platform_type_to_string(ohd_platform);
set_ohd_platform_type_as_string(platform_as_str.c_str());
}

Expand Down
45 changes: 45 additions & 0 deletions app/telemetry/models/camerastreammodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,48 @@ std::string CameraStreamModel::resolution_framerate_to_string(const ResolutionFr
ss<<(int)data.width<<"x"<<(int)data.height<<"@"<<data.framerate;
return ss.str();
}

QVariantList CameraStreamModel::get_camera_choices(int platform_type)
{
QList<QCameraNameAndType> list{
QCameraNameAndType{"XLOL",1}
};
auto tmp= QManufacturerForPlatform{
"LOL",
list
};
QVariantList ret;
return ret;
}

QStringList CameraStreamModel::get_manufacturer_choices(int platform_type)
{
auto all_choices=get_camera_choices_for_platform(platform_type,m_camera_index!=0);
QStringList ret;
for(auto& choice: all_choices){
ret.push_back(choice.manufacturer_name.c_str());
}
return ret;
}

QList<int> CameraStreamModel::get_manufacturer_cameras_type(int platform_type, int index)
{
auto all_choices=get_camera_choices_for_platform(platform_type,m_camera_index!=0);
QList<int> ret;
if(index>=all_choices.size())index=0;
for(auto& choice: all_choices[index].cameras){
ret.push_back(choice.type);
}
return ret;
}

QStringList CameraStreamModel::get_manufacturer_cameras_names(int platform_type, int index)
{
auto all_choices=get_camera_choices_for_platform(platform_type,m_camera_index!=0);
QStringList ret;
if(index>=all_choices.size())index=0;
for(auto& choice: all_choices[index].cameras){
ret.push_back(choice.name.c_str());
}
return ret;
}
17 changes: 17 additions & 0 deletions app/telemetry/models/camerastreammodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@
#define AIRCAMERAMODEL_H

#include <QObject>
#include <QVariant>

#include "../tutil/mavlink_include.h"

#include "util/lqutils_include.h"

struct QCameraNameAndType{
QString name;
int type;
};
struct QManufacturerForPlatform{
QString manufacturer_name;
QList<QCameraNameAndType> cameras;
};
Q_DECLARE_METATYPE(QCameraNameAndType);
Q_DECLARE_METATYPE(QManufacturerForPlatform);

// NOTE1: This class exists to avoid duplicated code for primary and secondary camera(stream)-stats displayed in the HUD
// NOTE2: Here we have only stats for one camera / camera stream that are transmitted via lossy
// telemetry messages, aka in regular intervalls.
Expand Down Expand Up @@ -114,6 +126,11 @@ class CameraStreamModel : public QObject
private:
std::chrono::steady_clock::time_point m_last_tx_frame_drop_calculation=std::chrono::steady_clock::now();
int m_last_tx_frame_drop_calculation_count=-1;
public:
Q_INVOKABLE QVariantList get_camera_choices(int platform_type);
Q_INVOKABLE QStringList get_manufacturer_choices(int platform_type);
Q_INVOKABLE QList<int> get_manufacturer_cameras_type(int platform_type,int index);
Q_INVOKABLE QStringList get_manufacturer_cameras_names(int platform_type,int index);
};

#endif // AIRCAMERAMODEL_H
Loading

0 comments on commit b79fb3a

Please sign in to comment.