geeksville / Micro-RTSP

A RTSP video server intended for very small CPUs (ESP32 etc)
MIT License
790 stars 203 forks source link

Compilation fail with warnings. #51

Open kakopappa opened 1 year ago

kakopappa commented 1 year ago

Hi,

looks like Micro-RTSP is not compatible with the latest version of ESP32 Core.

c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\OV2640.cpp:37:1: warning: missing initializer for member 'camera_config_t::fb_location' [-Wmissing-field-initializers]
 };
 ^
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\OV2640.cpp:37:1: warning: missing initializer for member 'camera_config_t::grab_mode' [-Wmissing-field-initializers]
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\OV2640.cpp:37:1: warning: missing initializer for member 'camera_config_t::sccb_i2c_port' [-Wmissing-field-initializers]
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\OV2640.cpp:72:1: warning: missing initializer for member 'camera_config_t::fb_location' [-Wmissing-field-initializers]
 };
 ^
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\OV2640.cpp:72:1: warning: missing initializer for member 'camera_config_t::grab_mode' [-Wmissing-field-initializers]
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\OV2640.cpp:72:1: warning: missing initializer for member 'camera_config_t::sccb_i2c_port' [-Wmissing-field-initializers]
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\OV2640.cpp:102:1: warning: missing initializer for member 'camera_config_t::fb_location' [-Wmissing-field-initializers]
 };
 ^
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\OV2640.cpp:102:1: warning: missing initializer for member 'camera_config_t::grab_mode' [-Wmissing-field-initializers]
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\OV2640.cpp:102:1: warning: missing initializer for member 'camera_config_t::sccb_i2c_port' [-Wmissing-field-initializers]
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\CStreamer.cpp: In member function 'void CStreamer::addSession(WiFiClient&)':
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\CStreamer.cpp:41:19: warning: unused variable 'session' [-Wunused-variable]
     CRtspSession* session = new CRtspSession(aClient, this); // our threads RTSP session and state
                   ^~~~~~~
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\CRtspSession.cpp: In member function 'void CRtspSession::Handle_RtspDESCRIBE()':
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\CRtspSession.cpp:298:14: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size between 784 and 983 [-Wformat-truncation=]
              "RTSP/1.0 200 OK\r\nCSeq: %s\r\n"
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              "%s\r\n"
              ~~~~~~~~
              "Content-Base: %s/\r\n"
              ~~~~~~~~~~~~~~~~~~~~~~~
              "Content-Type: application/sdp\r\n"
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              "Content-Length: %d\r\n\r\n"
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              "%s",
              ~~~~
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\CRtspSession.cpp:306:14:
              URLBuf,
              ~~~~~~
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\CRtspSession.cpp:298:14: note: directive argument in the range [0, 1023]
c:\Users\user\Documents\Arduino\libraries\Micro-RTSP-master\src\CRtspSession.cpp:297:13: note: 'snprintf' output 97 or more bytes (assuming 2345) into a destination of size 1024
     snprintf(Response,sizeof(Response),
     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
              "RTSP/1.0 200 OK\r\nCSeq: %s\r\n"
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              "%s\r\n"
              ~~~~~~~~
              "Content-Base: %s/\r\n"
              ~~~~~~~~~~~~~~~~~~~~~~~
              "Content-Type: application/sdp\r\n"
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              "Content-Length: %d\r\n\r\n"
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              "%s",
              ~~~~~
              m_CSeq,
              ~~~~~~~
              DateHeader(),
              ~~~~~~~~~~~~~
              URLBuf,
              ~~~~~~~
              (int) strlen(SDPBuf),
              ~~~~~~~~~~~~~~~~~~~~~
              SDPBuf);
              ~~~~~~~
kakopappa commented 1 year ago

To fix:

  1. Goto C:\Users\\AppData\Local\Arduino15\packages\esp32\hardware\esp32\

  2. Make a copy of platform.txt and rename it to platform.local.txt.

  3. Open platform.txt. Change

Arduino Compile Warning Levels

compiler.warning_flags=-w compiler.warning_flags.none=-w compiler.warning_flags.default= compiler.warning_flags.more=-Wall -Werror=all compiler.warning_flags.all=-Wall -Werror=all -Wextra

To:

Arduino Compile Warning Levels

compiler.warning_flags=-w compiler.warning_flags.none=-w compiler.warning_flags.default= compiler.warning_flags.more=-Wall compiler.warning_flags.all=-Wall -Wextra

4. Restart Arduino IDE !!!!