This commit is contained in:
2026-09-13 13:30:21 +08:00
commit a6bbd520cf
2744 changed files with 1598795 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
#pragma once
#include <memory>
#include <string>
namespace fpv {
class Stream;
// 兼容输出用的 RTSP 服务器。
// 只做“把已经在收的 RTP 转成 RTSP 供 VLC/ffplay 拉流”,低延迟主路径仍是 UDP 直推。
// 支持 TCP interleaved 与 UDP 两种传输,H.265 单轨。
class RtspServer {
public:
// udpBase > 0 时启用 UDP 传输(RTP=udpBase, RTCP=udpBase+1)。
RtspServer(std::string address, int udpBase);
~RtspServer();
RtspServer(const RtspServer&) = delete;
RtspServer& operator=(const RtspServer&) = delete;
// 注册一路流,路径为 /<name>。
void addStream(Stream* stream);
void start();
void stop();
private:
struct Impl;
std::unique_ptr<Impl> impl_;
};
} // namespace fpv