Closed kadavris closed 10 months ago
This is looking good, and I started using your changes, but I believe the examples/ESP32-devcam.ino no longer compiles with the changes to some of the APIs. Also, the example doesn't appear to support multiple clients correctly.
@brainrecall Glad to hear. I though this project is effectively dead already ;( . I did not tried one in examples as I have no lcd module it uses. And it is a bit outdated indeed, The one I did run is in the 'test' folder.
Actually, I think I discovered a problem. Seems like it can't parse the client sockets from the SETUP, the server will fail to PLAY, and the client will revert back to TCP which succeeds, but I found is significantly slower on the ESP32CAM so not desirable. I suggest you watch the connection on Wireshark and you'll see the port issue.
And, I think I got a fix. In CRtspSession.c, around line 321. if ( m_ClientRTPPort == -1 && 0 == strncmp( cur_pos, "client_port=", 12 ) )
This is being skipped, it never even tries to find the client_port. What I discovered is m_ClientRTPPort
is a uint16. Apparently newer GCC compilers are treating a comparison between an unsigned short and -1 as always false, so it completely removes the if! I would suggest not bothering to check if m_ClientRTPPort was unset or explicitly set and check m_ClientRTPPort as 65535.
I've been working on this some more, and I've come to a few conclusions. Most of these aren't related directly to your work, @kadavris , which has been excellent in helping this code, but I'd thought I'd bring them up:
I'm still working on some issues, but I think my plan is to branch from your code and put in my fixes (mainly the multi-session reversion).
Also fixed some issues, combed some code to be more readable. tested on windows and esp32 ai thinker with 1-2 simultaneous clients (vlc via tcp)