diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d40cacc2..bb167400e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ find_package(Qt6 ${X_QT_VERSION} REQUIRED COMPONENTS Widgets) qt_standard_project_setup(REQUIRES ${X_QT_VERSION}) -qt_add_executable(QOpenHDApp +set(QOPENHD_SOURCE_FILES_LIST app/main.cpp # app/adsb/adsbvehicle.cpp @@ -45,14 +45,11 @@ qt_add_executable(QOpenHDApp app/telemetry/action/fcmissionhandler.cpp app/telemetry/action/fcmsgintervalhandler.cpp app/telemetry/action/ohdaction.cpp - # app/telemetry/action/impl/cmdsender.cpp app/telemetry/action/impl/xparam.cpp - ## app/telemetry/connection/mavlinkchannel.cpp app/telemetry/connection/tcp_connection.cpp app/telemetry/connection/udp_connection.cpp - # app/telemetry/models/aohdsystem.cpp app/telemetry/models/camerastreammodel.cpp app/telemetry/models/fcmapmodel.cpp @@ -61,7 +58,6 @@ qt_add_executable(QOpenHDApp app/telemetry/models/markermodel.cpp app/telemetry/models/rcchannelsmodel.cpp app/telemetry/models/wificard.cpp - # app/telemetry/settings/documentedparam.cpp app/telemetry/settings/frequencyhelper.cpp app/telemetry/settings/improvedintsetting.cpp @@ -69,10 +65,8 @@ qt_add_executable(QOpenHDApp app/telemetry/settings/mavlinksettingsmodel.cpp app/telemetry/settings/pollutionhelper.cpp app/telemetry/settings/wblinksettingshelper.cpp - # app/telemetry/tutil/geodesi_helper.cpp - - ### + # #app/videostreaming/vscommon/custom/rawreceiver.cpp #app/videostreaming/vscommon/rtp/rtpreceiver.cpp #app/videostreaming/vscommon/rtp/ParseRTP.cpp @@ -82,13 +76,17 @@ qt_add_executable(QOpenHDApp app/videostreaming/vscommon/rtp/rtpreceiver.cpp app/videostreaming/vscommon/udp/UDPReceiver.cpp app/videostreaming/vscommon/decodingstatistcs.cpp +) +qt_add_executable(QOpenHDApp + MANUAL_FINALIZATION + ${QOPENHD_SOURCE_FILES_LIST} ## lib/geographiclib-c-2.0/src/geodesic.c ## - ## - ## qml/qml.qrc + ## + androidqt6/AndroidManifest.xml ) target_include_directories(QOpenHDApp PUBLIC app) @@ -124,10 +122,15 @@ target_link_libraries(QOpenHDApp PRIVATE Qt6::Core Qt6::Quick Qt6::Gui Qt6::Widgets ) +set_property(TARGET QOpenHDApp APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR + ${CMAKE_CURRENT_SOURCE_DIR}/androidqt6) + include(lib/h264/h264.cmake) -include(app/videostreaming/avcodec/avcodec_video.cmake) -include(app/videostreaming/android/videostreamingandroid.cmake) +#include(app/videostreaming/avcodec/avcodec_video.cmake) +#include(app/videostreaming/android/videostreamingandroid.cmake) +#include(app/videostreaming/gstreamer/gst_video.cmake) +qt_finalize_executable(QOpenHDApp) #include(GNUInstallDirs) #install(TARGETS QOpenHD # BUNDLE DESTINATION . diff --git a/androidqt6/AndroidManifest.xml b/androidqt6/AndroidManifest.xml new file mode 100644 index 000000000..c02d81581 --- /dev/null +++ b/androidqt6/AndroidManifest.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/androidqt6/qopenhd_key.jks b/androidqt6/qopenhd_key.jks new file mode 100644 index 000000000..9db73378f Binary files /dev/null and b/androidqt6/qopenhd_key.jks differ diff --git a/androidqt6/res/drawable-hdpi/icon.png b/androidqt6/res/drawable-hdpi/icon.png new file mode 100644 index 000000000..433d514fb Binary files /dev/null and b/androidqt6/res/drawable-hdpi/icon.png differ diff --git a/androidqt6/res/drawable-hdpi/splashscreen.png b/androidqt6/res/drawable-hdpi/splashscreen.png new file mode 100644 index 000000000..207a35094 Binary files /dev/null and b/androidqt6/res/drawable-hdpi/splashscreen.png differ diff --git a/androidqt6/res/drawable-ldpi/icon.png b/androidqt6/res/drawable-ldpi/icon.png new file mode 100644 index 000000000..f2f9309f7 Binary files /dev/null and b/androidqt6/res/drawable-ldpi/icon.png differ diff --git a/androidqt6/res/drawable-ldpi/splashscreen.png b/androidqt6/res/drawable-ldpi/splashscreen.png new file mode 100644 index 000000000..bb3e9f26e Binary files /dev/null and b/androidqt6/res/drawable-ldpi/splashscreen.png differ diff --git a/androidqt6/res/drawable-mdpi/icon.png b/androidqt6/res/drawable-mdpi/icon.png new file mode 100644 index 000000000..f2f9309f7 Binary files /dev/null and b/androidqt6/res/drawable-mdpi/icon.png differ diff --git a/androidqt6/res/drawable-mdpi/splashscreen.png b/androidqt6/res/drawable-mdpi/splashscreen.png new file mode 100644 index 000000000..9ad039218 Binary files /dev/null and b/androidqt6/res/drawable-mdpi/splashscreen.png differ diff --git a/androidqt6/res/drawable-xhdpi/icon.png b/androidqt6/res/drawable-xhdpi/icon.png new file mode 100644 index 000000000..58c5e1515 Binary files /dev/null and b/androidqt6/res/drawable-xhdpi/icon.png differ diff --git a/androidqt6/res/drawable-xhdpi/splashscreen.png b/androidqt6/res/drawable-xhdpi/splashscreen.png new file mode 100644 index 000000000..f222e8d43 Binary files /dev/null and b/androidqt6/res/drawable-xhdpi/splashscreen.png differ diff --git a/androidqt6/res/drawable-xxhdpi/icon.png b/androidqt6/res/drawable-xxhdpi/icon.png new file mode 100644 index 000000000..a744fdd62 Binary files /dev/null and b/androidqt6/res/drawable-xxhdpi/icon.png differ diff --git a/androidqt6/res/drawable-xxhdpi/splashscreen.png b/androidqt6/res/drawable-xxhdpi/splashscreen.png new file mode 100644 index 000000000..a83f205c1 Binary files /dev/null and b/androidqt6/res/drawable-xxhdpi/splashscreen.png differ diff --git a/androidqt6/res/drawable-xxxhdpi/icon.png b/androidqt6/res/drawable-xxxhdpi/icon.png new file mode 100644 index 000000000..3ea4153b5 Binary files /dev/null and b/androidqt6/res/drawable-xxxhdpi/icon.png differ diff --git a/androidqt6/res/drawable-xxxhdpi/splashscreen.png b/androidqt6/res/drawable-xxxhdpi/splashscreen.png new file mode 100644 index 000000000..8051e2945 Binary files /dev/null and b/androidqt6/res/drawable-xxxhdpi/splashscreen.png differ diff --git a/androidqt6/res/play_store.png b/androidqt6/res/play_store.png new file mode 100644 index 000000000..3d2aee472 Binary files /dev/null and b/androidqt6/res/play_store.png differ diff --git a/app/telemetry/models/camerastreammodel.cpp b/app/telemetry/models/camerastreammodel.cpp index eb5818ba4..e27e28556 100644 --- a/app/telemetry/models/camerastreammodel.cpp +++ b/app/telemetry/models/camerastreammodel.cpp @@ -39,7 +39,7 @@ CameraStreamModel &CameraStreamModel::instance(int cam_index) QString CameraStreamModel::camera_type_to_string(int camera_type) { if(camera_type<0)return "N/A"; - auto tmp=XCamera{camera_type,0,""}; + auto tmp=XCamera{camera_type,0,0}; return tmp.cam_type_as_verbose_string().c_str(); } @@ -78,7 +78,7 @@ bool CameraStreamModel::is_valid_resolution_fps_string(QString input) QString CameraStreamModel::get_default_resolution() { - auto tmp=XCamera{m_camera_type,0,""}; + auto tmp=XCamera{m_camera_type,0,0}; auto default_res_fps=tmp.get_default_resolution_fps(); return default_res_fps.as_string().c_str(); } @@ -86,7 +86,7 @@ QString CameraStreamModel::get_default_resolution() QStringList CameraStreamModel::get_supported_resolutions() { QStringList ret; - auto tmp_cam=XCamera{m_camera_type,0,""}; + auto tmp_cam=XCamera{m_camera_type,0,0}; auto tmp=tmp_cam.get_supported_resolutions(); for(auto& element:tmp){ ret.push_back(element.as_string().c_str()); diff --git a/app/telemetry/models/openhd_core/camera.hpp b/app/telemetry/models/openhd_core/camera.hpp index 6c07fb19d..b3621c49e 100644 --- a/app/telemetry/models/openhd_core/camera.hpp +++ b/app/telemetry/models/openhd_core/camera.hpp @@ -171,7 +171,7 @@ struct XCamera { // Only valid if camera is of type USB // For CSI camera(s) we in general 'know' from platform and cam type how to // tell the pipeline which cam/source to use. - std::string usb_v4l2_device_node; + int usb_v4l2_device_number; bool requires_rpi_mmal_pipeline() const { return camera_type == X_CAM_TYPE_RPI_MMAL_HDMI_TO_CSI; } @@ -202,16 +202,13 @@ struct XCamera { std::vector get_supported_resolutions() const { if (requires_rpi_veye_pipeline()) { // Except one, all veye camera(s) only do 1080p30 - - // Urghs but not via v4l2. So we only expose 1080p30 - /*if(camera_type==X_CAM_TYPE_RPI_V4L2_VEYE_CSIMX307){ + if (camera_type == X_CAM_TYPE_RPI_V4L2_VEYE_CSIMX307) { std::vector ret; - ret.push_back(ResolutionFramerate{640, 480, 90}); - ret.push_back(ResolutionFramerate{1280, 720, 50}); ret.push_back(ResolutionFramerate{1280, 720, 60}); ret.push_back(ResolutionFramerate{1920, 1080, 30}); - }else{ + } else { return {ResolutionFramerate{1920, 1080, 30}}; - }*/ + } return {ResolutionFramerate{1920, 1080, 30}}; } else if (requires_x20_cedar_pipeline()) { // also easy, 720p60 only (for now) @@ -380,4 +377,10 @@ static std::string get_verbose_string_of_resolution( return ss.str(); } +static std::string get_v4l2_device_name_string(int value) { + std::stringstream ss; + ss << "/dev/video" << value; + return ss.str(); +} + #endif // OPENHD_CAMERA_HPP diff --git a/app/telemetry/settings/mavlinksettingsmodel.cpp b/app/telemetry/settings/mavlinksettingsmodel.cpp index 61a4244c4..043569796 100644 --- a/app/telemetry/settings/mavlinksettingsmodel.cpp +++ b/app/telemetry/settings/mavlinksettingsmodel.cpp @@ -294,7 +294,7 @@ QVariant MavlinkSettingsModel::data(const QModelIndex &index, int role) const if(std::holds_alternative(data.value)){ if(data.unique_id=="CAMERA_TYPE"){ auto value=std::get(data.value); - XCamera tmp{value,0,""}; + XCamera tmp{value,0,0}; return tmp.cam_type_as_verbose_string().c_str(); } auto value=std::get(data.value); diff --git a/app/videostreaming/gstreamer/gst_video.cmake b/app/videostreaming/gstreamer/gst_video.cmake new file mode 100644 index 000000000..a6aa394dc --- /dev/null +++ b/app/videostreaming/gstreamer/gst_video.cmake @@ -0,0 +1,27 @@ +set(GSTREAMER_SOURCES + ${CMAKE_CURRENT_LIST_DIR}/gstqmlglsinkstream.cpp + ${CMAKE_CURRENT_LIST_DIR}/gstrtpaudioplayer.cpp + ${CMAKE_CURRENT_LIST_DIR}/gstrtpreceiver.cpp +) + +target_sources(QOpenHDApp PRIVATE ${GSTREAMER_SOURCES}) + +target_include_directories(QOpenHDApp + PUBLIC + ${CMAKE_CURRENT_LIST_DIR} +) + +# Link to gstreamer + +find_package(PkgConfig REQUIRED) +pkg_search_module(GST REQUIRED + gstreamer-1.0>=1.4 + gstreamer-app-1.0>=1.4 + ) +pkg_search_module(gstreamer REQUIRED IMPORTED_TARGET gstreamer-1.0>=1.4) +pkg_search_module(gstreamer-app REQUIRED IMPORTED_TARGET gstreamer-app-1.0>=1.4) +target_link_libraries(QOpenHDApp PRIVATE PkgConfig::gstreamer PkgConfig::gstreamer-app) +#target_link_libraries(QOpenHDApp PRIVATE gstreamer-1.0 gstreamer-video-1.0 gstreamer-gl-1.0 gstreamer-app-1.0) + +add_compile_definitions(QOPENHD_ENABLE_GSTREAMER_QMLGLSINK) +add_compile_definitions(QOPENHD_GSTREAMER_SECONDARY_VIDEO) diff --git a/qml/main.qml b/qml/main.qml index f3a4dcf94..1975aad8e 100755 --- a/qml/main.qml +++ b/qml/main.qml @@ -35,8 +35,8 @@ ApplicationWindow { _qrenderstats.set_window_height(height) } - //contentOrientation: settings.general_screen_rotation===0 ? Qt.PortraitOrientation : Qt.LandscapeOrientation - //contentItem.rotation: settings.general_screen_rotation + contentOrientation: settings.general_screen_rotation===0 ? Qt.PortraitOrientation : Qt.LandscapeOrientation + contentItem.rotation: settings.general_screen_rotation //minimumWidth: 850 //minimumHeight: 480