You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. MediaMtx (C++) - settings of the reusable parts (WebRTC server, recorder)
  3. Shared by the stand-alone server (Projects/MediaMtx, which adds the command line, the paths file, the
  4. RTSP sources and the API) and la_mojo (kernelModuleEmbedVideo, which feeds the streams itself).
  5. The names follow MediaMTX (webrtcAddress, recordPath, ...).
  6. */
  7. #pragma once
  8. #include <cstdint>
  9. #include <string>
  10. #include <vector>
  11. namespace mtx {
  12. struct ServerConf
  13. {
  14. // WebRTC (WHEP)
  15. std::string webrtcAddress = ":8889";
  16. std::string webrtcAllowOrigin = "*";
  17. std::vector<std::string> webrtcICEServers; // e.g. stun:stun.l.google.com:19302
  18. std::string webrtcBindAddress; // ICE: bind to this local address (default: all)
  19. uint16_t webrtcUDPPortMin = 8189;
  20. uint16_t webrtcUDPPortMax = 8289;
  21. // recording
  22. std::string recordPath = "./recordings/%path/%Y-%m-%d_%H-%M-%S-%f";
  23. int64_t recordSegmentDurationMs = 60000;
  24. int64_t recordPartDurationMs = 1000;
  25. };
  26. // "60s", "1m", "500ms", "1h", "1.5s"; plain number = seconds
  27. bool parseDurationMs(const std::string & s, int64_t & ms);
  28. // "host:port" / ":port" -> host ("" = any) and port
  29. bool splitHostPort(const std::string & addr, std::string & host, uint16_t & port);
  30. // rtsp://user:pass@host/... -> rtsp://host/... (for logs)
  31. std::string hideCredentials(const std::string & url);
  32. } // namespace mtx