From 21370e01f7ee0fd0bb614b277d641a70ce43bd6a Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Mon, 13 May 2024 17:23:23 +0200 Subject: [PATCH] First step to make Windows work again --- app/telemetry/connection/tcp_connection.cpp | 15 +++++++++++---- .../vscommon/custom/rawreceiver.cpp | 4 ++++ app/videostreaming/vscommon/udp/UDPReceiver.h | 6 ++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/telemetry/connection/tcp_connection.cpp b/app/telemetry/connection/tcp_connection.cpp index b6c2f180c..3773eba14 100644 --- a/app/telemetry/connection/tcp_connection.cpp +++ b/app/telemetry/connection/tcp_connection.cpp @@ -5,30 +5,33 @@ #define _WIN32_WINNT 0x0600 //TODO dirty #include #include // For InetPton +#include #else #include #include #include +#endif #include #include -#endif #include #include "mavlinkchannel.h" -static int linux_tcp_socket_try_connect(const std::string remote_ip, const int remote_port,const int timeout_seconds){ - //qDebug()<<"linux_tcp_socket_try_connect:"<0){ m_last_data_ms=QOpenHDMavlinkHelper::getTimeMilliseconds(); receive_until_stopped(); @@ -265,4 +271,5 @@ void TCPConnection::loop_connect_receive() } } qDebug()<<"TCPConnection2::loop_connect_receive end"; +#endif } diff --git a/app/videostreaming/vscommon/custom/rawreceiver.cpp b/app/videostreaming/vscommon/custom/rawreceiver.cpp index 56a3761ff..b7400ff18 100644 --- a/app/videostreaming/vscommon/custom/rawreceiver.cpp +++ b/app/videostreaming/vscommon/custom/rawreceiver.cpp @@ -7,6 +7,7 @@ RawReceiver::RawReceiver(int port,std::string ip,bool is_h265,bool unused): is_h265(is_h265) { +#ifdef __linux__ m_keyframe_finder=std::make_unique(); auto udp_config=UDPReceiver::Configuration{std::nullopt,port}; udp_config.opt_os_receive_buff_size=UDPReceiver::BIG_UDP_RECEIVE_BUFFER_SIZE; @@ -16,13 +17,16 @@ RawReceiver::RawReceiver(int port,std::string ip,bool is_h265,bool unused): this->udp_raw_data_callback(payload,payloadSize); }); m_udp_receiver->startReceiving(); +#endif } RawReceiver::~RawReceiver() { +#ifdef __linux__ if(m_udp_receiver){ m_udp_receiver->stopReceiving(); } +#endif } std::shared_ptr RawReceiver::get_next_frame(std::optional timeout) diff --git a/app/videostreaming/vscommon/udp/UDPReceiver.h b/app/videostreaming/vscommon/udp/UDPReceiver.h index ecb06622d..c22149145 100644 --- a/app/videostreaming/vscommon/udp/UDPReceiver.h +++ b/app/videostreaming/vscommon/udp/UDPReceiver.h @@ -3,8 +3,14 @@ #define FPV_VR_UDPRECEIVER_H #include +#ifdef __linux__ #include #include +#else +#include +#include // For InetPton +#include +#endif #include #include #include